From f907cb18f851a2ac0aa078465dac781f258b697e Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Tue, 30 Sep 2014 16:52:58 -0700 Subject: [PATCH] Clean up include files for int8_t,...int64_t Use 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"//' {} \; > 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 --- app/stream_descriptor.h | 4 +-- media/base/audio_timestamp_helper.h | 4 ++- media/base/bit_reader.h | 5 ++-- media/base/buffer_reader.h | 4 ++- media/base/buffer_writer_unittest.cc | 29 +++++++++---------- media/base/byte_queue.h | 3 +- media/base/container_names.cc | 3 +- media/base/container_names.h | 2 +- media/base/decrypt_config.h | 3 +- media/base/limits.h | 2 -- media/base/muxer_options.h | 4 +-- media/base/muxer_util.h | 4 +-- media/base/network_util.h | 3 +- media/base/offset_byte_queue.cc | 3 +- media/base/offset_byte_queue.h | 3 +- media/base/offset_byte_queue_unittest.cc | 2 +- media/base/request_signer.h | 1 - media/base/rsa_key.h | 2 +- media/base/rsa_test_data.cc | 2 ++ media/base/rsa_test_data.h | 2 +- media/base/timestamp.h | 8 +++-- media/event/muxer_listener.h | 4 +-- media/event/muxer_listener_internal.h | 3 +- media/file/file.h | 4 ++- media/file/local_file.h | 3 +- media/file/udp_file.cc | 4 ++- media/file/udp_file.h | 3 +- media/filters/h264_bit_reader.h | 3 +- .../h264_byte_to_unit_stream_converter.h | 3 +- media/filters/h264_parser.h | 2 +- media/formats/mp2t/adts_header.h | 4 ++- media/formats/mp2t/es_parser.h | 3 +- media/formats/mp2t/es_parser_adts.cc | 3 +- media/formats/mp2t/es_parser_h264.cc | 3 +- media/formats/mp2t/es_parser_h264.h | 3 +- media/formats/mp2t/ts_packet.h | 4 ++- media/formats/mp2t/ts_section_pes.h | 3 +- media/formats/mp2t/ts_section_psi.cc | 3 +- media/formats/mp4/aac_audio_specific_config.h | 5 ++-- media/formats/mp4/box.h | 3 +- media/formats/mp4/box_definitions.cc | 7 +++-- media/formats/mp4/box_definitions_unittest.cc | 7 +++-- media/formats/mp4/box_reader.cc | 5 +++- media/formats/mp4/box_reader_unittest.cc | 2 +- media/formats/mp4/cenc.h | 3 +- media/formats/mp4/chunk_info_iterator.h | 3 ++ .../formats/mp4/composition_offset_iterator.h | 3 ++ media/formats/mp4/decoding_time_iterator.h | 3 ++ media/formats/mp4/es_descriptor.h | 5 ++-- media/formats/mp4/fragmenter.cc | 4 ++- media/formats/mp4/mp4_media_parser.cc | 4 ++- media/formats/mp4/mp4_media_parser.h | 3 +- media/formats/mp4/sync_sample_iterator.h | 3 ++ media/formats/mp4/track_run_iterator.cc | 13 ++++++--- .../mp4/track_run_iterator_unittest.cc | 2 +- media/test/test_data_util.h | 3 +- mpd/base/bandwidth_estimator.h | 5 ++-- mpd/base/bandwidth_estimator_test.cc | 1 + mpd/base/mpd_builder.h | 3 +- mpd/base/mpd_notifier.h | 2 +- mpd/base/mpd_utils.h | 2 -- mpd/base/xml/xml_node.cc | 3 +- mpd/base/xml/xml_node.h | 2 +- mpd/util/mpd_writer.cc | 2 +- mpd/util/mpd_writer.h | 4 +-- 65 files changed, 155 insertions(+), 95 deletions(-) diff --git a/app/stream_descriptor.h b/app/stream_descriptor.h index e54d52aa63..1bd3de5cd0 100644 --- a/app/stream_descriptor.h +++ b/app/stream_descriptor.h @@ -7,11 +7,11 @@ #ifndef APP_STREAM_DESCRIPTOR_H_ #define APP_STREAM_DESCRIPTOR_H_ +#include + #include #include -#include "base/basictypes.h" - namespace edash_packager { namespace media { diff --git a/media/base/audio_timestamp_helper.h b/media/base/audio_timestamp_helper.h index 36f3d0d9a5..53ba37924b 100644 --- a/media/base/audio_timestamp_helper.h +++ b/media/base/audio_timestamp_helper.h @@ -5,7 +5,9 @@ #ifndef MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_ #define MEDIA_BASE_AUDIO_TIMESTAMP_HELPER_H_ -#include "base/basictypes.h" +#include + +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/base/bit_reader.h b/media/base/bit_reader.h index 8896ddef51..850c84ba35 100644 --- a/media/base/bit_reader.h +++ b/media/base/bit_reader.h @@ -5,9 +5,9 @@ #ifndef MEDIA_BASE_BIT_READER_H_ #define MEDIA_BASE_BIT_READER_H_ +#include #include -#include "base/basictypes.h" #include "base/logging.h" namespace edash_packager { @@ -31,7 +31,8 @@ class BitReader { /// bits in the stream), true otherwise. When false is returned, the /// stream will enter a state where further ReadBits/SkipBits /// operations will always return false unless @a num_bits is 0. - template bool ReadBits(int num_bits, T *out) { + template + bool ReadBits(int num_bits, T* out) { DCHECK_LE(num_bits, static_cast(sizeof(T) * 8)); uint64_t temp; bool ret = ReadBitsInternal(num_bits, &temp); diff --git a/media/base/buffer_reader.h b/media/base/buffer_reader.h index 3d439097da..1780e16e84 100644 --- a/media/base/buffer_reader.h +++ b/media/base/buffer_reader.h @@ -7,10 +7,12 @@ #ifndef MEDIA_BASE_BUFFER_READER_H_ #define MEDIA_BASE_BUFFER_READER_H_ +#include + #include -#include "base/basictypes.h" #include "base/compiler_specific.h" +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/base/buffer_writer_unittest.cc b/media/base/buffer_writer_unittest.cc index d7a148f852..337f93dd94 100644 --- a/media/base/buffer_writer_unittest.cc +++ b/media/base/buffer_writer_unittest.cc @@ -6,6 +6,8 @@ #include "media/base/buffer_writer.h" +#include + #include "base/file_util.h" #include "base/memory/scoped_ptr.h" #include "media/base/buffer_reader.h" @@ -14,14 +16,6 @@ namespace { 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 uint16_t kuint16 = 1000; const int16_t kint16 = -1000; @@ -59,7 +53,10 @@ class BufferWriterTest : public testing::Test { } template - void Verify(T min, T max, T val) { + void Verify(T val) { + T min = std::numeric_limits::min(); + T max = std::numeric_limits::max(); + writer_->AppendInt(min); writer_->AppendInt(max); writer_->AppendInt(val); @@ -79,13 +76,13 @@ class BufferWriterTest : public testing::Test { DISALLOW_COPY_AND_ASSIGN(BufferWriterTest); }; -TEST_F(BufferWriterTest, Append1) { Verify(kuint8min, kuint8max, kuint8); } -TEST_F(BufferWriterTest, Append2) { Verify(kuint16min, kuint16max, kuint16); } -TEST_F(BufferWriterTest, Append2s) { Verify(kint16min, kint16max, kint16); } -TEST_F(BufferWriterTest, Append4) { Verify(kuint32min, kuint32max, kuint32); } -TEST_F(BufferWriterTest, Append4s) { Verify(kint32min, kint32max, kint32); } -TEST_F(BufferWriterTest, Append8) { Verify(kuint64min, kuint64max, kuint64); } -TEST_F(BufferWriterTest, Append8s) { Verify(kint64min, kint64max, kint64); } +TEST_F(BufferWriterTest, Append1) { Verify(kuint8); } +TEST_F(BufferWriterTest, Append2) { Verify(kuint16); } +TEST_F(BufferWriterTest, Append2s) { Verify(kint16); } +TEST_F(BufferWriterTest, Append4) { Verify(kuint32); } +TEST_F(BufferWriterTest, Append4s) { Verify(kint32); } +TEST_F(BufferWriterTest, Append8) { Verify(kuint64); } +TEST_F(BufferWriterTest, Append8s) { Verify(kint64); } TEST_F(BufferWriterTest, AppendNBytes) { // Write the least significant four bytes and verify the result. diff --git a/media/base/byte_queue.h b/media/base/byte_queue.h index 2c27d1d947..3573019c21 100644 --- a/media/base/byte_queue.h +++ b/media/base/byte_queue.h @@ -5,7 +5,8 @@ #ifndef MEDIA_BASE_BYTE_QUEUE_H_ #define MEDIA_BASE_BYTE_QUEUE_H_ -#include "base/basictypes.h" +#include + #include "base/memory/scoped_ptr.h" namespace edash_packager { diff --git a/media/base/container_names.cc b/media/base/container_names.cc index 4f8a7ec6d0..35b3c7c2e2 100644 --- a/media/base/container_names.cc +++ b/media/base/container_names.cc @@ -4,10 +4,11 @@ #include "media/base/container_names.h" +#include + #include #include -#include "base/basictypes.h" #include "base/logging.h" #include "media/base/bit_reader.h" diff --git a/media/base/container_names.h b/media/base/container_names.h index 66bf716077..24db2c5566 100644 --- a/media/base/container_names.h +++ b/media/base/container_names.h @@ -5,7 +5,7 @@ #ifndef MEDIA_BASE_CONTAINER_NAMES_H_ #define MEDIA_BASE_CONTAINER_NAMES_H_ -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/base/decrypt_config.h b/media/base/decrypt_config.h index 9a71a61315..4d27cd3818 100644 --- a/media/base/decrypt_config.h +++ b/media/base/decrypt_config.h @@ -5,10 +5,11 @@ #ifndef MEDIA_BASE_DECRYPT_CONFIG_H_ #define MEDIA_BASE_DECRYPT_CONFIG_H_ +#include + #include #include -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" namespace edash_packager { diff --git a/media/base/limits.h b/media/base/limits.h index 0b9df839b9..e090a8f743 100644 --- a/media/base/limits.h +++ b/media/base/limits.h @@ -7,8 +7,6 @@ #ifndef MEDIA_BASE_LIMITS_H_ #define MEDIA_BASE_LIMITS_H_ -#include "base/basictypes.h" - namespace edash_packager { namespace media { diff --git a/media/base/muxer_options.h b/media/base/muxer_options.h index e77470a8dc..315036b80c 100644 --- a/media/base/muxer_options.h +++ b/media/base/muxer_options.h @@ -7,12 +7,10 @@ #ifndef MEDIA_BASE_MUXER_OPTIONS_H_ #define MEDIA_BASE_MUXER_OPTIONS_H_ -#include "base/basictypes.h" +#include #include -#include "base/basictypes.h" - namespace edash_packager { namespace media { diff --git a/media/base/muxer_util.h b/media/base/muxer_util.h index bc180598d0..ff437c7f03 100644 --- a/media/base/muxer_util.h +++ b/media/base/muxer_util.h @@ -9,9 +9,9 @@ #ifndef MEDIA_BASE_MUXER_UTIL_H_ #define MEDIA_BASE_MUXER_UTIL_H_ -#include +#include -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/base/network_util.h b/media/base/network_util.h index d3bea6e5ea..cf96243b2b 100644 --- a/media/base/network_util.h +++ b/media/base/network_util.h @@ -5,8 +5,7 @@ #ifndef MEDIA_BASE_NETWORK_UTIL_H_ #define MEDIA_BASE_NETWORK_UTIL_H_ -#include "base/base_export.h" -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/base/offset_byte_queue.cc b/media/base/offset_byte_queue.cc index cf2d93cbe0..9320e33601 100644 --- a/media/base/offset_byte_queue.cc +++ b/media/base/offset_byte_queue.cc @@ -4,7 +4,8 @@ #include "media/base/offset_byte_queue.h" -#include "base/basictypes.h" +#include + #include "base/logging.h" namespace edash_packager { diff --git a/media/base/offset_byte_queue.h b/media/base/offset_byte_queue.h index b4140e0d14..34cb5a2d4d 100644 --- a/media/base/offset_byte_queue.h +++ b/media/base/offset_byte_queue.h @@ -5,7 +5,8 @@ #ifndef MEDIA_BASE_OFFSET_BYTE_QUEUE_H_ #define MEDIA_BASE_OFFSET_BYTE_QUEUE_H_ -#include "base/basictypes.h" +#include + #include "media/base/byte_queue.h" namespace edash_packager { diff --git a/media/base/offset_byte_queue_unittest.cc b/media/base/offset_byte_queue_unittest.cc index 7f1a302852..84e67e7985 100644 --- a/media/base/offset_byte_queue_unittest.cc +++ b/media/base/offset_byte_queue_unittest.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include +#include #include -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "media/base/offset_byte_queue.h" diff --git a/media/base/request_signer.h b/media/base/request_signer.h index 7003b75ae4..0416b41bba 100644 --- a/media/base/request_signer.h +++ b/media/base/request_signer.h @@ -9,7 +9,6 @@ #include -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" namespace edash_packager { diff --git a/media/base/rsa_key.h b/media/base/rsa_key.h index c838d7bd9a..683fd180cb 100644 --- a/media/base/rsa_key.h +++ b/media/base/rsa_key.h @@ -12,7 +12,7 @@ #include -#include "base/basictypes.h" +#include "base/macros.h" struct rsa_st; typedef struct rsa_st RSA; diff --git a/media/base/rsa_test_data.cc b/media/base/rsa_test_data.cc index 318675de9a..46f1196d2c 100644 --- a/media/base/rsa_test_data.cc +++ b/media/base/rsa_test_data.cc @@ -6,6 +6,8 @@ #include "media/base/rsa_test_data.h" +#include + namespace { const uint8_t kTestRsaPrivateKey_3072[] = { 0x30, 0x82, 0x06, 0xe3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x81, 0x00, diff --git a/media/base/rsa_test_data.h b/media/base/rsa_test_data.h index 396a5bd7ae..8c84b6bd00 100644 --- a/media/base/rsa_test_data.h +++ b/media/base/rsa_test_data.h @@ -11,7 +11,7 @@ #include -#include "base/basictypes.h" +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/base/timestamp.h b/media/base/timestamp.h index b8aa6a4a3f..1fb89e3869 100644 --- a/media/base/timestamp.h +++ b/media/base/timestamp.h @@ -8,13 +8,15 @@ #ifndef MEDIA_BASE_TIMESTAMP_H_ #define MEDIA_BASE_TIMESTAMP_H_ -#include "base/basictypes.h" +#include + +#include namespace edash_packager { namespace media { -const int64_t kNoTimestamp = kint64min; -const int64_t kInfiniteDuration = kint64max; +const int64_t kNoTimestamp = std::numeric_limits::min(); +const int64_t kInfiniteDuration = std::numeric_limits::max(); } // namespace media } // namespace edash_packager diff --git a/media/event/muxer_listener.h b/media/event/muxer_listener.h index f7da5a6f5c..ae93c962f4 100644 --- a/media/event/muxer_listener.h +++ b/media/event/muxer_listener.h @@ -9,9 +9,9 @@ #ifndef MEDIA_EVENT_MUXER_LISTENER_H_ #define MEDIA_EVENT_MUXER_LISTENER_H_ -#include +#include -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/event/muxer_listener_internal.h b/media/event/muxer_listener_internal.h index 0f24fe1514..ef3f83845c 100644 --- a/media/event/muxer_listener_internal.h +++ b/media/event/muxer_listener_internal.h @@ -7,10 +7,11 @@ #ifndef MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_ #define MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_ +#include + #include #include -#include "base/basictypes.h" #include "media/event/muxer_listener.h" namespace edash_packager { diff --git a/media/file/file.h b/media/file/file.h index 3f81931e1d..0197278d35 100644 --- a/media/file/file.h +++ b/media/file/file.h @@ -7,9 +7,11 @@ #ifndef PACKAGER_FILE_FILE_H_ #define PACKAGER_FILE_FILE_H_ +#include + #include -#include "base/basictypes.h" +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/file/local_file.h b/media/file/local_file.h index b34a2bbd84..481d7147ac 100644 --- a/media/file/local_file.h +++ b/media/file/local_file.h @@ -7,9 +7,10 @@ #ifndef PACKAGER_FILE_LOCAL_FILE_H_ #define PACKAGER_FILE_LOCAL_FILE_H_ +#include + #include -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "media/file/file.h" diff --git a/media/file/udp_file.cc b/media/file/udp_file.cc index 949ca2baa8..01d334e63d 100644 --- a/media/file/udp_file.cc +++ b/media/file/udp_file.cc @@ -12,6 +12,8 @@ #include #include +#include + #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "gflags/gflags.h" @@ -119,7 +121,7 @@ int64_t UdpFile::Size() { if (socket_ == kInvalidSocket) return -1; - return kint64max; + return std::numeric_limits::max(); } bool UdpFile::Flush() { diff --git a/media/file/udp_file.h b/media/file/udp_file.h index 5dc828e1e9..da03376e9a 100644 --- a/media/file/udp_file.h +++ b/media/file/udp_file.h @@ -7,9 +7,10 @@ #ifndef MEDIA_FILE_UDP_FILE_H_ #define MEDIA_FILE_UDP_FILE_H_ +#include + #include -#include "base/basictypes.h" #include "base/compiler_specific.h" #include "media/file/file.h" diff --git a/media/filters/h264_bit_reader.h b/media/filters/h264_bit_reader.h index f0931d7402..7695a53c9a 100644 --- a/media/filters/h264_bit_reader.h +++ b/media/filters/h264_bit_reader.h @@ -7,9 +7,10 @@ #ifndef MEDIA_FILTERS_H264_BIT_READER_H_ #define MEDIA_FILTERS_H264_BIT_READER_H_ +#include #include -#include "base/basictypes.h" +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/filters/h264_byte_to_unit_stream_converter.h b/media/filters/h264_byte_to_unit_stream_converter.h index b84734272c..056f9c9c09 100644 --- a/media/filters/h264_byte_to_unit_stream_converter.h +++ b/media/filters/h264_byte_to_unit_stream_converter.h @@ -7,7 +7,8 @@ #ifndef MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_ #define MEDIA_FILTERS_H264_BYTE_TO_UNIT_STREAM_CONVERTER_H_ -#include "base/basictypes.h" +#include +#include #include diff --git a/media/filters/h264_parser.h b/media/filters/h264_parser.h index e074c9cad5..c9051f37fd 100644 --- a/media/filters/h264_parser.h +++ b/media/filters/h264_parser.h @@ -7,11 +7,11 @@ #ifndef MEDIA_FILTERS_H264_PARSER_H_ #define MEDIA_FILTERS_H264_PARSER_H_ +#include #include #include -#include "base/basictypes.h" #include "media/filters/h264_bit_reader.h" namespace edash_packager { diff --git a/media/formats/mp2t/adts_header.h b/media/formats/mp2t/adts_header.h index 26acbc33e7..cccfb15a34 100644 --- a/media/formats/mp2t/adts_header.h +++ b/media/formats/mp2t/adts_header.h @@ -7,10 +7,12 @@ #ifndef MEDIA_FORMATS_MP2T_ADTS_HEADER_H_ #define MEDIA_FORMATS_MP2T_ADTS_HEADER_H_ -#include "base/basictypes.h" +#include #include +#include "base/macros.h" + namespace edash_packager { namespace media { namespace mp2t { diff --git a/media/formats/mp2t/es_parser.h b/media/formats/mp2t/es_parser.h index e6897b8acb..c335938358 100644 --- a/media/formats/mp2t/es_parser.h +++ b/media/formats/mp2t/es_parser.h @@ -5,7 +5,8 @@ #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H_ #define MEDIA_FORMATS_MP2T_ES_PARSER_H_ -#include "base/basictypes.h" +#include + #include "base/callback.h" #include "base/memory/ref_counted.h" diff --git a/media/formats/mp2t/es_parser_adts.cc b/media/formats/mp2t/es_parser_adts.cc index 2ea2720b99..fa78ca232e 100644 --- a/media/formats/mp2t/es_parser_adts.cc +++ b/media/formats/mp2t/es_parser_adts.cc @@ -4,9 +4,10 @@ #include "media/formats/mp2t/es_parser_adts.h" +#include + #include -#include "base/basictypes.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "media/base/audio_timestamp_helper.h" diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc index 5447c09b8d..f9fcd7a754 100644 --- a/media/formats/mp2t/es_parser_h264.cc +++ b/media/formats/mp2t/es_parser_h264.cc @@ -4,7 +4,8 @@ #include "media/formats/mp2t/es_parser_h264.h" -#include "base/basictypes.h" +#include + #include "base/logging.h" #include "base/numerics/safe_conversions.h" #include "media/base/media_sample.h" diff --git a/media/formats/mp2t/es_parser_h264.h b/media/formats/mp2t/es_parser_h264.h index 9b8b55fae2..9eff45b1cd 100644 --- a/media/formats/mp2t/es_parser_h264.h +++ b/media/formats/mp2t/es_parser_h264.h @@ -5,10 +5,11 @@ #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ #define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_ +#include + #include #include -#include "base/basictypes.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" diff --git a/media/formats/mp2t/ts_packet.h b/media/formats/mp2t/ts_packet.h index eb205e0af8..c3fbf7f55a 100644 --- a/media/formats/mp2t/ts_packet.h +++ b/media/formats/mp2t/ts_packet.h @@ -5,7 +5,9 @@ #ifndef MEDIA_FORMATS_MP2T_TS_PACKET_H_ #define MEDIA_FORMATS_MP2T_TS_PACKET_H_ -#include "base/basictypes.h" +#include + +#include "base/macros.h" namespace edash_packager { namespace media { diff --git a/media/formats/mp2t/ts_section_pes.h b/media/formats/mp2t/ts_section_pes.h index 76051d3860..0ea3e38fa8 100644 --- a/media/formats/mp2t/ts_section_pes.h +++ b/media/formats/mp2t/ts_section_pes.h @@ -5,7 +5,8 @@ #ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_ #define MEDIA_FORMATS_MP2T_TS_SECTION_PES_H_ -#include "base/basictypes.h" +#include + #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "media/base/byte_queue.h" diff --git a/media/formats/mp2t/ts_section_psi.cc b/media/formats/mp2t/ts_section_psi.cc index eaba1457a3..9cd6332722 100644 --- a/media/formats/mp2t/ts_section_psi.cc +++ b/media/formats/mp2t/ts_section_psi.cc @@ -4,7 +4,8 @@ #include "media/formats/mp2t/ts_section_psi.h" -#include "base/basictypes.h" +#include + #include "base/logging.h" #include "media/base/bit_reader.h" #include "media/formats/mp2t/mp2t_common.h" diff --git a/media/formats/mp4/aac_audio_specific_config.h b/media/formats/mp4/aac_audio_specific_config.h index 1b4c0638a7..7da98d3392 100644 --- a/media/formats/mp4/aac_audio_specific_config.h +++ b/media/formats/mp4/aac_audio_specific_config.h @@ -5,9 +5,10 @@ #ifndef MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_ #define MEDIA_FORMATS_MP4_AAC_AUDIO_SPECIFIC_CONFIG_H_ -#include +#include +#include -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/formats/mp4/box.h b/media/formats/mp4/box.h index 175611448a..050aa08053 100644 --- a/media/formats/mp4/box.h +++ b/media/formats/mp4/box.h @@ -7,7 +7,8 @@ #ifndef MEDIA_FORMATS_MP4_BOX_H_ #define MEDIA_FORMATS_MP4_BOX_H_ -#include "base/basictypes.h" +#include + #include "base/compiler_specific.h" #include "media/formats/mp4/fourccs.h" diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc index 87266a5bd5..f31806f223 100644 --- a/media/formats/mp4/box_definitions.cc +++ b/media/formats/mp4/box_definitions.cc @@ -4,6 +4,8 @@ #include "media/formats/mp4/box_definitions.h" +#include + #include "base/logging.h" #include "media/base/bit_reader.h" #include "media/formats/mp4/box_buffer.h" @@ -31,10 +33,11 @@ const uint16_t kVideoFrameCount = 1; const uint16_t kVideoDepth = 0x0018; bool IsFitIn32Bits(uint64_t a) { - return a <= kuint32max; + return a <= std::numeric_limits::max(); } bool IsFitIn32Bits(int64_t a) { - return a <= kint32max && a >= kint32min; + return a <= std::numeric_limits::max() && + a >= std::numeric_limits::min(); } bool IsFitIn32Bits(uint64_t a, uint64_t b) { return IsFitIn32Bits(a) && IsFitIn32Bits(b); diff --git a/media/formats/mp4/box_definitions_unittest.cc b/media/formats/mp4/box_definitions_unittest.cc index 249ae8cc06..6c1f791271 100644 --- a/media/formats/mp4/box_definitions_unittest.cc +++ b/media/formats/mp4/box_definitions_unittest.cc @@ -6,6 +6,8 @@ #include +#include + #include "base/memory/scoped_ptr.h" #include "media/base/buffer_writer.h" #include "media/formats/mp4/box_definitions.h" @@ -447,7 +449,8 @@ class BoxDefinitionsTestGeneral : public testing::Test { void Fill(MediaHeader* mdhd) { mdhd->creation_time = 124231432; - mdhd->modification_time = static_cast(kuint32max) + 1; + mdhd->modification_time = + static_cast(std::numeric_limits::max()) + 1; mdhd->timescale = 50000; mdhd->duration = 250000; strcpy(mdhd->language, "abc"); @@ -456,7 +459,7 @@ class BoxDefinitionsTestGeneral : public testing::Test { void Modify(MediaHeader* mdhd) { mdhd->creation_time = 2; - mdhd->modification_time = kuint32max; + mdhd->modification_time = std::numeric_limits::max(); strcpy(mdhd->language, "und"); mdhd->version = 0; } diff --git a/media/formats/mp4/box_reader.cc b/media/formats/mp4/box_reader.cc index 1e4a31817d..9fc386f341 100644 --- a/media/formats/mp4/box_reader.cc +++ b/media/formats/mp4/box_reader.cc @@ -6,6 +6,8 @@ #include +#include + #include "base/logging.h" #include "base/memory/scoped_ptr.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. - if (size > static_cast(kint32max) && type_ != FOURCC_MDAT) { + if (size > static_cast(std::numeric_limits::max()) && + type_ != FOURCC_MDAT) { LOG(ERROR) << base::StringPrintf("Box '%s' size (%" PRIu64 ") is too large.", FourCCToString(type_).c_str(), diff --git a/media/formats/mp4/box_reader_unittest.cc b/media/formats/mp4/box_reader_unittest.cc index 58db942c7c..57d5c5b87e 100644 --- a/media/formats/mp4/box_reader_unittest.cc +++ b/media/formats/mp4/box_reader_unittest.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include +#include #include -#include "base/basictypes.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "media/formats/mp4/box_buffer.h" diff --git a/media/formats/mp4/cenc.h b/media/formats/mp4/cenc.h index c769f68438..84690f5da5 100644 --- a/media/formats/mp4/cenc.h +++ b/media/formats/mp4/cenc.h @@ -5,9 +5,10 @@ #ifndef MEDIA_FORMATS_MP4_CENC_H_ #define MEDIA_FORMATS_MP4_CENC_H_ +#include + #include -#include "base/basictypes.h" #include "media/base/decrypt_config.h" namespace edash_packager { diff --git a/media/formats/mp4/chunk_info_iterator.h b/media/formats/mp4/chunk_info_iterator.h index 9fc3b0f445..e1c4312a0a 100644 --- a/media/formats/mp4/chunk_info_iterator.h +++ b/media/formats/mp4/chunk_info_iterator.h @@ -7,8 +7,11 @@ #ifndef MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_ #define MEDIA_FORMATS_MP4_CHUNK_INFO_ITERATOR_H_ +#include + #include +#include "base/macros.h" #include "media/formats/mp4/box_definitions.h" namespace edash_packager { diff --git a/media/formats/mp4/composition_offset_iterator.h b/media/formats/mp4/composition_offset_iterator.h index e9e0b35380..815faf7951 100644 --- a/media/formats/mp4/composition_offset_iterator.h +++ b/media/formats/mp4/composition_offset_iterator.h @@ -7,8 +7,11 @@ #ifndef MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_ #define MEDIA_FORMATS_MP4_COMPOSITION_OFFSET_ITERATOR_H_ +#include + #include +#include "base/macros.h" #include "media/formats/mp4/box_definitions.h" namespace edash_packager { diff --git a/media/formats/mp4/decoding_time_iterator.h b/media/formats/mp4/decoding_time_iterator.h index 70f14098ed..b03c5f962a 100644 --- a/media/formats/mp4/decoding_time_iterator.h +++ b/media/formats/mp4/decoding_time_iterator.h @@ -7,8 +7,11 @@ #ifndef MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_ #define MEDIA_FORMATS_MP4_DECODING_TIME_ITERATOR_H_ +#include + #include +#include "base/macros.h" #include "media/formats/mp4/box_definitions.h" namespace edash_packager { diff --git a/media/formats/mp4/es_descriptor.h b/media/formats/mp4/es_descriptor.h index effc7461f7..04efc4e8a5 100644 --- a/media/formats/mp4/es_descriptor.h +++ b/media/formats/mp4/es_descriptor.h @@ -5,9 +5,10 @@ #ifndef MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_ #define MEDIA_FORMATS_MP4_ES_DESCRIPTOR_H_ -#include +#include +#include -#include "base/basictypes.h" +#include namespace edash_packager { namespace media { diff --git a/media/formats/mp4/fragmenter.cc b/media/formats/mp4/fragmenter.cc index fccd1c69d1..2edb878dfd 100644 --- a/media/formats/mp4/fragmenter.cc +++ b/media/formats/mp4/fragmenter.cc @@ -6,6 +6,8 @@ #include "media/formats/mp4/fragmenter.h" +#include + #include "media/base/buffer_writer.h" #include "media/base/media_sample.h" #include "media/formats/mp4/box_definitions.h" @@ -15,7 +17,7 @@ namespace media { namespace mp4 { namespace { -const int64_t kInvalidTime = kint64max; +const int64_t kInvalidTime = std::numeric_limits::max(); } // namespace Fragmenter::Fragmenter(TrackFragment* traf) diff --git a/media/formats/mp4/mp4_media_parser.cc b/media/formats/mp4/mp4_media_parser.cc index bd4709f624..8e314db52b 100644 --- a/media/formats/mp4/mp4_media_parser.cc +++ b/media/formats/mp4/mp4_media_parser.cc @@ -4,6 +4,8 @@ #include "media/formats/mp4/mp4_media_parser.h" +#include + #include "base/callback.h" #include "base/callback_helpers.h" #include "base/logging.h" @@ -170,7 +172,7 @@ bool MP4MediaParser::ParseMoov(BoxReader* reader) { moov_->header.timescale, timescale); } else if (moov_->header.duration > 0 && - moov_->header.duration != kuint64max) { + moov_->header.duration != std::numeric_limits::max()) { DCHECK(moov_->header.timescale != 0); duration = Rescale(moov_->header.duration, moov_->header.timescale, timescale); diff --git a/media/formats/mp4/mp4_media_parser.h b/media/formats/mp4/mp4_media_parser.h index 615a7d4239..0928a57008 100644 --- a/media/formats/mp4/mp4_media_parser.h +++ b/media/formats/mp4/mp4_media_parser.h @@ -7,10 +7,11 @@ #ifndef MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_ #define MEDIA_FORMATS_MP4_MP4_MEDIA_PARSER_H_ +#include + #include #include -#include "base/basictypes.h" #include "base/callback_forward.h" #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" diff --git a/media/formats/mp4/sync_sample_iterator.h b/media/formats/mp4/sync_sample_iterator.h index 7a14f94973..2ff039238a 100644 --- a/media/formats/mp4/sync_sample_iterator.h +++ b/media/formats/mp4/sync_sample_iterator.h @@ -7,8 +7,11 @@ #ifndef MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_ #define MEDIA_FORMATS_MP4_SYNC_SAMPLE_ITERATOR_H_ +#include + #include +#include "base/macros.h" #include "media/formats/mp4/box_definitions.h" namespace edash_packager { diff --git a/media/formats/mp4/track_run_iterator.cc b/media/formats/mp4/track_run_iterator.cc index 985f55015b..d3986b36c7 100644 --- a/media/formats/mp4/track_run_iterator.cc +++ b/media/formats/mp4/track_run_iterator.cc @@ -5,6 +5,7 @@ #include "media/formats/mp4/track_run_iterator.h" #include +#include #include "media/base/buffer_reader.h" #include "media/formats/mp4/chunk_info_iterator.h" @@ -13,6 +14,10 @@ #include "media/formats/mp4/rcheck.h" #include "media/formats/mp4/sync_sample_iterator.h" +namespace { +const int64_t kInvalidOffset = std::numeric_limits::max(); +} // namespace + namespace edash_packager { namespace media { namespace mp4 { @@ -116,8 +121,8 @@ static void PopulateSampleInfo(const TrackExtends& trex, class CompareMinTrackRunDataOffset { public: 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 b_aux = b.aux_info_total_size ? b.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 : kInvalidOffset; int64_t a_lesser = std::min(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 // not have any inter-run ordering restrictions.) int64_t TrackRunIterator::GetMaxClearOffset() { - int64_t offset = kint64max; + int64_t offset = kInvalidOffset; if (IsSampleValid()) { offset = std::min(offset, sample_offset_); @@ -446,7 +451,7 @@ int64_t TrackRunIterator::GetMaxClearOffset() { 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 offset; } diff --git a/media/formats/mp4/track_run_iterator_unittest.cc b/media/formats/mp4/track_run_iterator_unittest.cc index 2eb20ff2eb..354e9b7e61 100644 --- a/media/formats/mp4/track_run_iterator_unittest.cc +++ b/media/formats/mp4/track_run_iterator_unittest.cc @@ -3,8 +3,8 @@ // found in the LICENSE file. #include +#include -#include "base/basictypes.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "media/formats/mp4/box_definitions.h" diff --git a/media/test/test_data_util.h b/media/test/test_data_util.h index c99f945f24..94784882ed 100644 --- a/media/test/test_data_util.h +++ b/media/test/test_data_util.h @@ -5,9 +5,10 @@ #ifndef MEDIA_TEST_TEST_DATA_UTIL_H_ #define MEDIA_TEST_TEST_DATA_UTIL_H_ +#include + #include -#include "base/basictypes.h" #include "base/files/file_path.h" namespace edash_packager { diff --git a/mpd/base/bandwidth_estimator.h b/mpd/base/bandwidth_estimator.h index 3541251ced..c82b59f47d 100644 --- a/mpd/base/bandwidth_estimator.h +++ b/mpd/base/bandwidth_estimator.h @@ -7,9 +7,10 @@ #ifndef MPD_BASE_BANDWIDTH_ESTIMATOR_H_ #define MPD_BASE_BANDWIDTH_ESTIMATOR_H_ -#include +#include +#include -#include "base/basictypes.h" +#include class BandwidthEstimator { public: diff --git a/mpd/base/bandwidth_estimator_test.cc b/mpd/base/bandwidth_estimator_test.cc index 683107d4b6..aa1daae125 100644 --- a/mpd/base/bandwidth_estimator_test.cc +++ b/mpd/base/bandwidth_estimator_test.cc @@ -8,6 +8,7 @@ #include +#include "base/macros.h" #include "mpd/base/bandwidth_estimator.h" namespace edash_packager { diff --git a/mpd/base/mpd_builder.h b/mpd/base/mpd_builder.h index 4c045317c3..95547b3211 100644 --- a/mpd/base/mpd_builder.h +++ b/mpd/base/mpd_builder.h @@ -10,11 +10,12 @@ #ifndef MPD_BASE_MPD_BUILDER_H_ #define MPD_BASE_MPD_BUILDER_H_ +#include + #include #include #include "base/atomic_sequence_num.h" -#include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/stl_util.h" #include "base/synchronization/lock.h" diff --git a/mpd/base/mpd_notifier.h b/mpd/base/mpd_notifier.h index 3d150ff469..38357e5e28 100644 --- a/mpd/base/mpd_notifier.h +++ b/mpd/base/mpd_notifier.h @@ -10,7 +10,7 @@ #ifndef MPD_BASE_MPD_NOTIFIER_H_ #define MPD_BASE_MPD_NOTIFIER_H_ -#include "base/basictypes.h" +#include namespace edash_packager { diff --git a/mpd/base/mpd_utils.h b/mpd/base/mpd_utils.h index e8c295af29..ce8a797ce2 100644 --- a/mpd/base/mpd_utils.h +++ b/mpd/base/mpd_utils.h @@ -13,8 +13,6 @@ #include -#include "base/basictypes.h" - namespace edash_packager { class MediaInfo; diff --git a/mpd/base/xml/xml_node.cc b/mpd/base/xml/xml_node.cc index 8fdefe9130..342418a4be 100644 --- a/mpd/base/xml/xml_node.cc +++ b/mpd/base/xml/xml_node.cc @@ -6,6 +6,7 @@ #include "mpd/base/xml/xml_node.h" +#include #include #include "base/logging.h" @@ -487,7 +488,7 @@ bool RepresentationXmlNode::AddAudioChannelInfo( void RepresentationXmlNode::AddAudioSamplingRateInfo( const RepeatedAudioInfo& repeated_audio_info) { bool has_sampling_frequency = false; - uint32_t min_sampling_frequency = kuint32max; + uint32_t min_sampling_frequency = std::numeric_limits::max(); uint32_t max_sampling_frequency = 0; for (int i = 0; i < repeated_audio_info.size(); ++i) { diff --git a/mpd/base/xml/xml_node.h b/mpd/base/xml/xml_node.h index 06e5540534..4db9f96285 100644 --- a/mpd/base/xml/xml_node.h +++ b/mpd/base/xml/xml_node.h @@ -11,10 +11,10 @@ #define MPD_BASE_XML_XML_NODE_H_ #include +#include #include -#include "base/basictypes.h" #include "mpd/base/content_protection_element.h" #include "mpd/base/media_info.pb.h" #include "mpd/base/xml/scoped_xml_ptr.h" diff --git a/mpd/util/mpd_writer.cc b/mpd/util/mpd_writer.cc index 25fedf3190..12773762ec 100644 --- a/mpd/util/mpd_writer.cc +++ b/mpd/util/mpd_writer.cc @@ -7,8 +7,8 @@ #include "mpd/util/mpd_writer.h" #include +#include -#include "base/basictypes.h" #include "media/file/file.h" #include "mpd/base/mpd_builder.h" diff --git a/mpd/util/mpd_writer.h b/mpd/util/mpd_writer.h index 26d3e3c694..ed9b16a665 100644 --- a/mpd/util/mpd_writer.h +++ b/mpd/util/mpd_writer.h @@ -12,13 +12,11 @@ #include #include -#include "base/basictypes.h" +#include "base/macros.h" namespace edash_packager { namespace media { - class File; - } // namespace media } // namespace edash_packager