Clean up include files for int8_t,...int64_t
Use <stdint.h> rather than "base/basictypes.h". This is a follow up to previous CL. Also get rid of ku?intxx(min|max) and use std::numeric_limits as per base/basictypes.h, it is DEPRECATED too. The change was made using the below commands with some adjustments like include order etc: > find {media,app,mpd} -type f -exec sed -r -i 's/"base\/basictypes.h"/<stdint.h>/' {} \; > find {media,app,mpd} -type f -exec sed -r -i 's/k(u?int[0-9]+)(min|max)/std::numeric_limits<\1_t>::\2\(\)/g' {} \; Change-Id: I6347723989c3d66e64ffcc54123b5c182b8c71b7
This commit is contained in:
parent
d1068964ae
commit
f907cb18f8
|
@ -7,11 +7,11 @@
|
||||||
#ifndef APP_STREAM_DESCRIPTOR_H_
|
#ifndef APP_STREAM_DESCRIPTOR_H_
|
||||||
#define APP_STREAM_DESCRIPTOR_H_
|
#define APP_STREAM_DESCRIPTOR_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
#ifndef MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_
|
#ifndef MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_
|
||||||
#define MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_
|
#define MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
#ifndef MEDIA_BASE_BIT_READER_H_
|
#ifndef MEDIA_BASE_BIT_READER_H_
|
||||||
#define MEDIA_BASE_BIT_READER_H_
|
#define MEDIA_BASE_BIT_READER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
@ -31,7 +31,8 @@ class BitReader {
|
||||||
/// bits in the stream), true otherwise. When false is returned, the
|
/// bits in the stream), true otherwise. When false is returned, the
|
||||||
/// stream will enter a state where further ReadBits/SkipBits
|
/// stream will enter a state where further ReadBits/SkipBits
|
||||||
/// operations will always return false unless @a num_bits is 0.
|
/// operations will always return false unless @a num_bits is 0.
|
||||||
template<typename T> bool ReadBits(int num_bits, T *out) {
|
template <typename T>
|
||||||
|
bool ReadBits(int num_bits, T* out) {
|
||||||
DCHECK_LE(num_bits, static_cast<int>(sizeof(T) * 8));
|
DCHECK_LE(num_bits, static_cast<int>(sizeof(T) * 8));
|
||||||
uint64_t temp;
|
uint64_t temp;
|
||||||
bool ret = ReadBitsInternal(num_bits, &temp);
|
bool ret = ReadBitsInternal(num_bits, &temp);
|
||||||
|
|
|
@ -7,10 +7,12 @@
|
||||||
#ifndef MEDIA_BASE_BUFFER_READER_H_
|
#ifndef MEDIA_BASE_BUFFER_READER_H_
|
||||||
#define MEDIA_BASE_BUFFER_READER_H_
|
#define MEDIA_BASE_BUFFER_READER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "media/base/buffer_writer.h"
|
#include "media/base/buffer_writer.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/file_util.h"
|
#include "base/file_util.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/base/buffer_reader.h"
|
#include "media/base/buffer_reader.h"
|
||||||
|
@ -14,14 +16,6 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int kReservedBufferCapacity = 1000;
|
const int kReservedBufferCapacity = 1000;
|
||||||
// Min values for various integers of different size. Min values for signed
|
|
||||||
// integers are already defined in //base/basictypes.h.
|
|
||||||
const uint8_t kuint8min = 0;
|
|
||||||
const uint16_t kuint16min = 0;
|
|
||||||
const uint32_t kuint32min = 0;
|
|
||||||
const uint64_t kuint64min = 0;
|
|
||||||
// Max values for various integers are already defined in //base/basictypes.h.
|
|
||||||
// Other integer values.
|
|
||||||
const uint8_t kuint8 = 10;
|
const uint8_t kuint8 = 10;
|
||||||
const uint16_t kuint16 = 1000;
|
const uint16_t kuint16 = 1000;
|
||||||
const int16_t kint16 = -1000;
|
const int16_t kint16 = -1000;
|
||||||
|
@ -59,7 +53,10 @@ class BufferWriterTest : public testing::Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void Verify(T min, T max, T val) {
|
void Verify(T val) {
|
||||||
|
T min = std::numeric_limits<T>::min();
|
||||||
|
T max = std::numeric_limits<T>::max();
|
||||||
|
|
||||||
writer_->AppendInt(min);
|
writer_->AppendInt(min);
|
||||||
writer_->AppendInt(max);
|
writer_->AppendInt(max);
|
||||||
writer_->AppendInt(val);
|
writer_->AppendInt(val);
|
||||||
|
@ -79,13 +76,13 @@ class BufferWriterTest : public testing::Test {
|
||||||
DISALLOW_COPY_AND_ASSIGN(BufferWriterTest);
|
DISALLOW_COPY_AND_ASSIGN(BufferWriterTest);
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(BufferWriterTest, Append1) { Verify(kuint8min, kuint8max, kuint8); }
|
TEST_F(BufferWriterTest, Append1) { Verify(kuint8); }
|
||||||
TEST_F(BufferWriterTest, Append2) { Verify(kuint16min, kuint16max, kuint16); }
|
TEST_F(BufferWriterTest, Append2) { Verify(kuint16); }
|
||||||
TEST_F(BufferWriterTest, Append2s) { Verify(kint16min, kint16max, kint16); }
|
TEST_F(BufferWriterTest, Append2s) { Verify(kint16); }
|
||||||
TEST_F(BufferWriterTest, Append4) { Verify(kuint32min, kuint32max, kuint32); }
|
TEST_F(BufferWriterTest, Append4) { Verify(kuint32); }
|
||||||
TEST_F(BufferWriterTest, Append4s) { Verify(kint32min, kint32max, kint32); }
|
TEST_F(BufferWriterTest, Append4s) { Verify(kint32); }
|
||||||
TEST_F(BufferWriterTest, Append8) { Verify(kuint64min, kuint64max, kuint64); }
|
TEST_F(BufferWriterTest, Append8) { Verify(kuint64); }
|
||||||
TEST_F(BufferWriterTest, Append8s) { Verify(kint64min, kint64max, kint64); }
|
TEST_F(BufferWriterTest, Append8s) { Verify(kint64); }
|
||||||
|
|
||||||
TEST_F(BufferWriterTest, AppendNBytes) {
|
TEST_F(BufferWriterTest, AppendNBytes) {
|
||||||
// Write the least significant four bytes and verify the result.
|
// Write the least significant four bytes and verify the result.
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#ifndef MEDIA_BASE_BYTE_QUEUE_H_
|
#ifndef MEDIA_BASE_BYTE_QUEUE_H_
|
||||||
#define MEDIA_BASE_BYTE_QUEUE_H_
|
#define MEDIA_BASE_BYTE_QUEUE_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
|
|
||||||
#include "media/base/container_names.h"
|
#include "media/base/container_names.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "media/base/bit_reader.h"
|
#include "media/base/bit_reader.h"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#ifndef MEDIA_BASE_CONTAINER_NAMES_H_
|
#ifndef MEDIA_BASE_CONTAINER_NAMES_H_
|
||||||
#define MEDIA_BASE_CONTAINER_NAMES_H_
|
#define MEDIA_BASE_CONTAINER_NAMES_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
#ifndef MEDIA_BASE_DECRYPT_CONFIG_H_
|
#ifndef MEDIA_BASE_DECRYPT_CONFIG_H_
|
||||||
#define MEDIA_BASE_DECRYPT_CONFIG_H_
|
#define MEDIA_BASE_DECRYPT_CONFIG_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
#ifndef MEDIA_BASE_LIMITS_H_
|
#ifndef MEDIA_BASE_LIMITS_H_
|
||||||
#define MEDIA_BASE_LIMITS_H_
|
#define MEDIA_BASE_LIMITS_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,10 @@
|
||||||
#ifndef MEDIA_BASE_MUXER_OPTIONS_H_
|
#ifndef MEDIA_BASE_MUXER_OPTIONS_H_
|
||||||
#define MEDIA_BASE_MUXER_OPTIONS_H_
|
#define MEDIA_BASE_MUXER_OPTIONS_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#ifndef MEDIA_BASE_MUXER_UTIL_H_
|
#ifndef MEDIA_BASE_MUXER_UTIL_H_
|
||||||
#define MEDIA_BASE_MUXER_UTIL_H_
|
#define MEDIA_BASE_MUXER_UTIL_H_
|
||||||
|
|
||||||
#include <string>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <string>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
#ifndef MEDIA_BASE_NETWORK_UTIL_H_
|
#ifndef MEDIA_BASE_NETWORK_UTIL_H_
|
||||||
#define MEDIA_BASE_NETWORK_UTIL_H_
|
#define MEDIA_BASE_NETWORK_UTIL_H_
|
||||||
|
|
||||||
#include "base/base_export.h"
|
#include <stdint.h>
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
#include "media/base/offset_byte_queue.h"
|
#include "media/base/offset_byte_queue.h"
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#ifndef MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
|
#ifndef MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
|
||||||
#define MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
|
#define MEDIA_BASE_OFFSET_BYTE_QUEUE_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "media/base/byte_queue.h"
|
#include "media/base/byte_queue.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/base/offset_byte_queue.h"
|
#include "media/base/offset_byte_queue.h"
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
struct rsa_st;
|
struct rsa_st;
|
||||||
typedef struct rsa_st RSA;
|
typedef struct rsa_st RSA;
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "media/base/rsa_test_data.h"
|
#include "media/base/rsa_test_data.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const uint8_t kTestRsaPrivateKey_3072[] = {
|
const uint8_t kTestRsaPrivateKey_3072[] = {
|
||||||
0x30, 0x82, 0x06, 0xe3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x81, 0x00,
|
0x30, 0x82, 0x06, 0xe3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x81, 0x00,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -8,13 +8,15 @@
|
||||||
#ifndef MEDIA_BASE_TIMESTAMP_H_
|
#ifndef MEDIA_BASE_TIMESTAMP_H_
|
||||||
#define MEDIA_BASE_TIMESTAMP_H_
|
#define MEDIA_BASE_TIMESTAMP_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
const int64_t kNoTimestamp = kint64min;
|
const int64_t kNoTimestamp = std::numeric_limits<int64_t>::min();
|
||||||
const int64_t kInfiniteDuration = kint64max;
|
const int64_t kInfiniteDuration = std::numeric_limits<int64_t>::max();
|
||||||
|
|
||||||
} // namespace media
|
} // namespace media
|
||||||
} // namespace edash_packager
|
} // namespace edash_packager
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#ifndef MEDIA_EVENT_MUXER_LISTENER_H_
|
#ifndef MEDIA_EVENT_MUXER_LISTENER_H_
|
||||||
#define MEDIA_EVENT_MUXER_LISTENER_H_
|
#define MEDIA_EVENT_MUXER_LISTENER_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <vector>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
#ifndef MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_
|
#ifndef MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_
|
||||||
#define MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_
|
#define MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "media/event/muxer_listener.h"
|
#include "media/event/muxer_listener.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,9 +7,11 @@
|
||||||
#ifndef PACKAGER_FILE_FILE_H_
|
#ifndef PACKAGER_FILE_FILE_H_
|
||||||
#define PACKAGER_FILE_FILE_H_
|
#define PACKAGER_FILE_FILE_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
#ifndef PACKAGER_FILE_LOCAL_FILE_H_
|
#ifndef PACKAGER_FILE_LOCAL_FILE_H_
|
||||||
#define PACKAGER_FILE_LOCAL_FILE_H_
|
#define PACKAGER_FILE_LOCAL_FILE_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "media/file/file.h"
|
#include "media/file/file.h"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "gflags/gflags.h"
|
#include "gflags/gflags.h"
|
||||||
|
@ -119,7 +121,7 @@ int64_t UdpFile::Size() {
|
||||||
if (socket_ == kInvalidSocket)
|
if (socket_ == kInvalidSocket)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return kint64max;
|
return std::numeric_limits<int64_t>::max();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UdpFile::Flush() {
|
bool UdpFile::Flush() {
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
#ifndef MEDIA_FILE_UDP_FILE_H_
|
#ifndef MEDIA_FILE_UDP_FILE_H_
|
||||||
#define MEDIA_FILE_UDP_FILE_H_
|
#define MEDIA_FILE_UDP_FILE_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "media/file/file.h"
|
#include "media/file/file.h"
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
#ifndef MEDIA_FILTERS_H264_BIT_READER_H_
|
#ifndef MEDIA_FILTERS_H264_BIT_READER_H_
|
||||||
#define MEDIA_FILTERS_H264_BIT_READER_H_
|
#define MEDIA_FILTERS_H264_BIT_READER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
#ifndef MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_
|
#ifndef MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_
|
||||||
#define MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_
|
#define MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
#ifndef MEDIA_FILTERS_H264_PARSER_H_
|
#ifndef MEDIA_FILTERS_H264_PARSER_H_
|
||||||
#define MEDIA_FILTERS_H264_PARSER_H_
|
#define MEDIA_FILTERS_H264_PARSER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "media/filters/h264_bit_reader.h"
|
#include "media/filters/h264_bit_reader.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,10 +7,12 @@
|
||||||
#ifndef MEDIA_FORMATS_MP2T_ADTS_HEADER_H_
|
#ifndef MEDIA_FORMATS_MP2T_ADTS_HEADER_H_
|
||||||
#define MEDIA_FORMATS_MP2T_ADTS_HEADER_H_
|
#define MEDIA_FORMATS_MP2T_ADTS_HEADER_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
namespace mp2t {
|
namespace mp2t {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H_
|
#ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H_
|
||||||
#define MEDIA_FORMATS_MP2T_ES_PARSER_H_
|
#define MEDIA_FORMATS_MP2T_ES_PARSER_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
|
|
||||||
#include "media/formats/mp2t/es_parser_adts.h"
|
#include "media/formats/mp2t/es_parser_adts.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "media/base/audio_timestamp_helper.h"
|
#include "media/base/audio_timestamp_helper.h"
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
#include "media/formats/mp2t/es_parser_h264.h"
|
#include "media/formats/mp2t/es_parser_h264.h"
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/numerics/safe_conversions.h"
|
#include "base/numerics/safe_conversions.h"
|
||||||
#include "media/base/media_sample.h"
|
#include "media/base/media_sample.h"
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
|
#ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
|
||||||
#define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
|
#define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
#ifndef MEDIA_FORMATS_MP2T_TS_PACKET_H_
|
#ifndef MEDIA_FORMATS_MP2T_TS_PACKET_H_
|
||||||
#define MEDIA_FORMATS_MP2T_TS_PACKET_H_
|
#define MEDIA_FORMATS_MP2T_TS_PACKET_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
#ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_
|
#ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_
|
||||||
#define MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_
|
#define MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/base/byte_queue.h"
|
#include "media/base/byte_queue.h"
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
|
|
||||||
#include "media/formats/mp2t/ts_section_psi.h"
|
#include "media/formats/mp2t/ts_section_psi.h"
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "media/base/bit_reader.h"
|
#include "media/base/bit_reader.h"
|
||||||
#include "media/formats/mp2t/mp2t_common.h"
|
#include "media/formats/mp2t/mp2t_common.h"
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_
|
#ifndef MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_
|
||||||
#define MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_
|
#define MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <vector>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_BOX_H_
|
#ifndef MEDIA_FORMATS_MP4_BOX_H_
|
||||||
#define MEDIA_FORMATS_MP4_BOX_H_
|
#define MEDIA_FORMATS_MP4_BOX_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "media/formats/mp4/fourccs.h"
|
#include "media/formats/mp4/fourccs.h"
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "media/base/bit_reader.h"
|
#include "media/base/bit_reader.h"
|
||||||
#include "media/formats/mp4/box_buffer.h"
|
#include "media/formats/mp4/box_buffer.h"
|
||||||
|
@ -31,10 +33,11 @@ const uint16_t kVideoFrameCount = 1;
|
||||||
const uint16_t kVideoDepth = 0x0018;
|
const uint16_t kVideoDepth = 0x0018;
|
||||||
|
|
||||||
bool IsFitIn32Bits(uint64_t a) {
|
bool IsFitIn32Bits(uint64_t a) {
|
||||||
return a <= kuint32max;
|
return a <= std::numeric_limits<uint32_t>::max();
|
||||||
}
|
}
|
||||||
bool IsFitIn32Bits(int64_t a) {
|
bool IsFitIn32Bits(int64_t a) {
|
||||||
return a <= kint32max && a >= kint32min;
|
return a <= std::numeric_limits<int32_t>::max() &&
|
||||||
|
a >= std::numeric_limits<int32_t>::min();
|
||||||
}
|
}
|
||||||
bool IsFitIn32Bits(uint64_t a, uint64_t b) {
|
bool IsFitIn32Bits(uint64_t a, uint64_t b) {
|
||||||
return IsFitIn32Bits(a) && IsFitIn32Bits(b);
|
return IsFitIn32Bits(a) && IsFitIn32Bits(b);
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/base/buffer_writer.h"
|
#include "media/base/buffer_writer.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
@ -447,7 +449,8 @@ class BoxDefinitionsTestGeneral : public testing::Test {
|
||||||
|
|
||||||
void Fill(MediaHeader* mdhd) {
|
void Fill(MediaHeader* mdhd) {
|
||||||
mdhd->creation_time = 124231432;
|
mdhd->creation_time = 124231432;
|
||||||
mdhd->modification_time = static_cast<uint64_t>(kuint32max) + 1;
|
mdhd->modification_time =
|
||||||
|
static_cast<uint64_t>(std::numeric_limits<uint32_t>::max()) + 1;
|
||||||
mdhd->timescale = 50000;
|
mdhd->timescale = 50000;
|
||||||
mdhd->duration = 250000;
|
mdhd->duration = 250000;
|
||||||
strcpy(mdhd->language, "abc");
|
strcpy(mdhd->language, "abc");
|
||||||
|
@ -456,7 +459,7 @@ class BoxDefinitionsTestGeneral : public testing::Test {
|
||||||
|
|
||||||
void Modify(MediaHeader* mdhd) {
|
void Modify(MediaHeader* mdhd) {
|
||||||
mdhd->creation_time = 2;
|
mdhd->creation_time = 2;
|
||||||
mdhd->modification_time = kuint32max;
|
mdhd->modification_time = std::numeric_limits<uint32_t>::max();
|
||||||
strcpy(mdhd->language, "und");
|
strcpy(mdhd->language, "und");
|
||||||
mdhd->version = 0;
|
mdhd->version = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
|
@ -170,7 +172,8 @@ bool BoxReader::ReadHeader(bool* err) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'mdat' box could have a 64-bit size; other boxes should be very small.
|
// 'mdat' box could have a 64-bit size; other boxes should be very small.
|
||||||
if (size > static_cast<uint64_t>(kint32max) && type_ != FOURCC_MDAT) {
|
if (size > static_cast<uint64_t>(std::numeric_limits<int32_t>::max()) &&
|
||||||
|
type_ != FOURCC_MDAT) {
|
||||||
LOG(ERROR) << base::StringPrintf("Box '%s' size (%" PRIu64
|
LOG(ERROR) << base::StringPrintf("Box '%s' size (%" PRIu64
|
||||||
") is too large.",
|
") is too large.",
|
||||||
FourCCToString(type_).c_str(),
|
FourCCToString(type_).c_str(),
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/formats/mp4/box_buffer.h"
|
#include "media/formats/mp4/box_buffer.h"
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_CENC_H_
|
#ifndef MEDIA_FORMATS_MP4_CENC_H_
|
||||||
#define MEDIA_FORMATS_MP4_CENC_H_
|
#define MEDIA_FORMATS_MP4_CENC_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "media/base/decrypt_config.h"
|
#include "media/base/decrypt_config.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,8 +7,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_
|
#ifndef MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_
|
||||||
#define MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_
|
#define MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,8 +7,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_
|
#ifndef MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_
|
||||||
#define MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_
|
#define MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,8 +7,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
|
#ifndef MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
|
||||||
#define MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
|
#define MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_
|
#ifndef MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_
|
||||||
#define MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_
|
#define MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <vector>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
#include "media/formats/mp4/fragmenter.h"
|
#include "media/formats/mp4/fragmenter.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "media/base/buffer_writer.h"
|
#include "media/base/buffer_writer.h"
|
||||||
#include "media/base/media_sample.h"
|
#include "media/base/media_sample.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
@ -15,7 +17,7 @@ namespace media {
|
||||||
namespace mp4 {
|
namespace mp4 {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int64_t kInvalidTime = kint64max;
|
const int64_t kInvalidTime = std::numeric_limits<int64_t>::max();
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Fragmenter::Fragmenter(TrackFragment* traf)
|
Fragmenter::Fragmenter(TrackFragment* traf)
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "media/formats/mp4/mp4_media_parser.h"
|
#include "media/formats/mp4/mp4_media_parser.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "base/callback.h"
|
#include "base/callback.h"
|
||||||
#include "base/callback_helpers.h"
|
#include "base/callback_helpers.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
@ -170,7 +172,7 @@ bool MP4MediaParser::ParseMoov(BoxReader* reader) {
|
||||||
moov_->header.timescale,
|
moov_->header.timescale,
|
||||||
timescale);
|
timescale);
|
||||||
} else if (moov_->header.duration > 0 &&
|
} else if (moov_->header.duration > 0 &&
|
||||||
moov_->header.duration != kuint64max) {
|
moov_->header.duration != std::numeric_limits<uint64_t>::max()) {
|
||||||
DCHECK(moov_->header.timescale != 0);
|
DCHECK(moov_->header.timescale != 0);
|
||||||
duration =
|
duration =
|
||||||
Rescale(moov_->header.duration, moov_->header.timescale, timescale);
|
Rescale(moov_->header.duration, moov_->header.timescale, timescale);
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
|
#ifndef MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
|
||||||
#define MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
|
#define MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/callback_forward.h"
|
#include "base/callback_forward.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
|
@ -7,8 +7,11 @@
|
||||||
#ifndef MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_
|
#ifndef MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_
|
||||||
#define MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_
|
#define MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "media/formats/mp4/track_run_iterator.h"
|
#include "media/formats/mp4/track_run_iterator.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include "media/base/buffer_reader.h"
|
#include "media/base/buffer_reader.h"
|
||||||
#include "media/formats/mp4/chunk_info_iterator.h"
|
#include "media/formats/mp4/chunk_info_iterator.h"
|
||||||
|
@ -13,6 +14,10 @@
|
||||||
#include "media/formats/mp4/rcheck.h"
|
#include "media/formats/mp4/rcheck.h"
|
||||||
#include "media/formats/mp4/sync_sample_iterator.h"
|
#include "media/formats/mp4/sync_sample_iterator.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const int64_t kInvalidOffset = std::numeric_limits<int64_t>::max();
|
||||||
|
} // namespace
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
namespace mp4 {
|
namespace mp4 {
|
||||||
|
@ -116,8 +121,8 @@ static void PopulateSampleInfo(const TrackExtends& trex,
|
||||||
class CompareMinTrackRunDataOffset {
|
class CompareMinTrackRunDataOffset {
|
||||||
public:
|
public:
|
||||||
bool operator()(const TrackRunInfo& a, const TrackRunInfo& b) {
|
bool operator()(const TrackRunInfo& a, const TrackRunInfo& b) {
|
||||||
int64_t a_aux = a.aux_info_total_size ? a.aux_info_start_offset : kint64max;
|
int64_t a_aux = a.aux_info_total_size ? a.aux_info_start_offset : kInvalidOffset;
|
||||||
int64_t b_aux = b.aux_info_total_size ? b.aux_info_start_offset : kint64max;
|
int64_t b_aux = b.aux_info_total_size ? b.aux_info_start_offset : kInvalidOffset;
|
||||||
|
|
||||||
int64_t a_lesser = std::min(a_aux, a.sample_start_offset);
|
int64_t a_lesser = std::min(a_aux, a.sample_start_offset);
|
||||||
int64_t a_greater = std::max(a_aux, a.sample_start_offset);
|
int64_t a_greater = std::max(a_aux, a.sample_start_offset);
|
||||||
|
@ -431,7 +436,7 @@ bool TrackRunIterator::IsSampleValid() const {
|
||||||
// offset of this track alone - is not guaranteed, because the BMFF spec does
|
// offset of this track alone - is not guaranteed, because the BMFF spec does
|
||||||
// not have any inter-run ordering restrictions.)
|
// not have any inter-run ordering restrictions.)
|
||||||
int64_t TrackRunIterator::GetMaxClearOffset() {
|
int64_t TrackRunIterator::GetMaxClearOffset() {
|
||||||
int64_t offset = kint64max;
|
int64_t offset = kInvalidOffset;
|
||||||
|
|
||||||
if (IsSampleValid()) {
|
if (IsSampleValid()) {
|
||||||
offset = std::min(offset, sample_offset_);
|
offset = std::min(offset, sample_offset_);
|
||||||
|
@ -446,7 +451,7 @@ int64_t TrackRunIterator::GetMaxClearOffset() {
|
||||||
offset = std::min(offset, next_run->aux_info_start_offset);
|
offset = std::min(offset, next_run->aux_info_start_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (offset == kint64max)
|
if (offset == kInvalidOffset)
|
||||||
return runs_.empty() ? 0 : runs_[0].sample_start_offset;
|
return runs_.empty() ? 0 : runs_[0].sample_start_offset;
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "media/formats/mp4/box_definitions.h"
|
#include "media/formats/mp4/box_definitions.h"
|
||||||
|
|
|
@ -5,9 +5,10 @@
|
||||||
#ifndef MEDIA_TEST_TEST_DATA_UTIL_H_
|
#ifndef MEDIA_TEST_TEST_DATA_UTIL_H_
|
||||||
#define MEDIA_TEST_TEST_DATA_UTIL_H_
|
#define MEDIA_TEST_TEST_DATA_UTIL_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
#ifndef MPD_BASE_BANDWIDTH_ESTIMATOR_H_
|
#ifndef MPD_BASE_BANDWIDTH_ESTIMATOR_H_
|
||||||
#define MPD_BASE_BANDWIDTH_ESTIMATOR_H_
|
#define MPD_BASE_BANDWIDTH_ESTIMATOR_H_
|
||||||
|
|
||||||
#include <list>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <list>
|
||||||
|
|
||||||
class BandwidthEstimator {
|
class BandwidthEstimator {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#include "base/macros.h"
|
||||||
#include "mpd/base/bandwidth_estimator.h"
|
#include "mpd/base/bandwidth_estimator.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
|
@ -10,11 +10,12 @@
|
||||||
#ifndef MPD_BASE_MPD_BUILDER_H_
|
#ifndef MPD_BASE_MPD_BUILDER_H_
|
||||||
#define MPD_BASE_MPD_BUILDER_H_
|
#define MPD_BASE_MPD_BUILDER_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/atomic_sequence_num.h"
|
#include "base/atomic_sequence_num.h"
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "base/gtest_prod_util.h"
|
#include "base/gtest_prod_util.h"
|
||||||
#include "base/stl_util.h"
|
#include "base/stl_util.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#ifndef MPD_BASE_MPD_NOTIFIER_H_
|
#ifndef MPD_BASE_MPD_NOTIFIER_H_
|
||||||
#define MPD_BASE_MPD_NOTIFIER_H_
|
#define MPD_BASE_MPD_NOTIFIER_H_
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
||||||
class MediaInfo;
|
class MediaInfo;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "mpd/base/xml/xml_node.h"
|
#include "mpd/base/xml/xml_node.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
|
@ -487,7 +488,7 @@ bool RepresentationXmlNode::AddAudioChannelInfo(
|
||||||
void RepresentationXmlNode::AddAudioSamplingRateInfo(
|
void RepresentationXmlNode::AddAudioSamplingRateInfo(
|
||||||
const RepeatedAudioInfo& repeated_audio_info) {
|
const RepeatedAudioInfo& repeated_audio_info) {
|
||||||
bool has_sampling_frequency = false;
|
bool has_sampling_frequency = false;
|
||||||
uint32_t min_sampling_frequency = kuint32max;
|
uint32_t min_sampling_frequency = std::numeric_limits<uint32_t>::max();
|
||||||
uint32_t max_sampling_frequency = 0;
|
uint32_t max_sampling_frequency = 0;
|
||||||
|
|
||||||
for (int i = 0; i < repeated_audio_info.size(); ++i) {
|
for (int i = 0; i < repeated_audio_info.size(); ++i) {
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
#define MPD_BASE_XML_XML_NODE_H_
|
#define MPD_BASE_XML_XML_NODE_H_
|
||||||
|
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "mpd/base/content_protection_element.h"
|
#include "mpd/base/content_protection_element.h"
|
||||||
#include "mpd/base/media_info.pb.h"
|
#include "mpd/base/media_info.pb.h"
|
||||||
#include "mpd/base/xml/scoped_xml_ptr.h"
|
#include "mpd/base/xml/scoped_xml_ptr.h"
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
#include "mpd/util/mpd_writer.h"
|
#include "mpd/util/mpd_writer.h"
|
||||||
|
|
||||||
#include <google/protobuf/text_format.h>
|
#include <google/protobuf/text_format.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
|
||||||
#include "media/file/file.h"
|
#include "media/file/file.h"
|
||||||
#include "mpd/base/mpd_builder.h"
|
#include "mpd/base/mpd_builder.h"
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,11 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/macros.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
class File;
|
class File;
|
||||||
|
|
||||||
} // namespace media
|
} // namespace media
|
||||||
} // namespace edash_packager
|
} // namespace edash_packager
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue