diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index d2549de3e8..1d13520682 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -78,7 +78,7 @@ namespace media { // testing. class FakeClock : public base::Clock { public: - virtual base::Time Now() OVERRIDE { return base::Time(); } + base::Time Now() override { return base::Time(); } }; // Demux, Mux(es) and worker thread used to remux a source file/stream. @@ -88,7 +88,7 @@ class RemuxJob : public base::SimpleThread { : SimpleThread("RemuxJob"), demuxer_(demuxer.Pass()) {} - virtual ~RemuxJob() { + ~RemuxJob() override { STLDeleteElements(&muxers_); } @@ -100,7 +100,7 @@ class RemuxJob : public base::SimpleThread { Status status() { return status_; } private: - virtual void Run() OVERRIDE { + void Run() override { DCHECK(demuxer_); status_ = demuxer_->Run(); } diff --git a/packager/app/widevine_encryption_flags.cc b/packager/app/widevine_encryption_flags.cc index 1448bc8098..ba5caa2c96 100644 --- a/packager/app/widevine_encryption_flags.cc +++ b/packager/app/widevine_encryption_flags.cc @@ -76,7 +76,8 @@ bool ValidateWidevineCryptoFlags() { success = false; } if (widevine_crypto && FLAGS_signer.empty() && - StartsWithASCII(FLAGS_key_server_url, "http", false)) { + base::StartsWith(FLAGS_key_server_url, "http", + base::CompareCase::INSENSITIVE_ASCII)) { LOG(WARNING) << "--signer is likely required with " "--enable_widevine_encryption/decryption."; } diff --git a/packager/common.gypi b/packager/common.gypi index b3a5a43821..feec248ebb 100644 --- a/packager/common.gypi +++ b/packager/common.gypi @@ -18,6 +18,10 @@ ], 'conditions': [ ['clang==1', { + 'cflags': [ + # Temporary workaround a gtest bug on ImplicitCast_. + '-Wno-pessimizing-move', + ], # Revert the relevant settings in Chromium's common.gypi. 'cflags!': [ '-Wno-char-subscripts', diff --git a/packager/media/base/aes_encryptor_unittest.cc b/packager/media/base/aes_encryptor_unittest.cc index f2089ee1d0..4e6f638f71 100644 --- a/packager/media/base/aes_encryptor_unittest.cc +++ b/packager/media/base/aes_encryptor_unittest.cc @@ -135,7 +135,7 @@ namespace media { class AesCtrEncryptorTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { key_.assign(kAesKey, kAesKey + arraysize(kAesKey)); iv_.assign(kAesIv, kAesIv + arraysize(kAesIv)); plaintext_.assign(kAesCtrPlaintext, @@ -400,7 +400,7 @@ TEST_F(AesCbcPkcs5EncryptorTestEncryptionDecryption, EncryptAES192CBCRegression) class AesCbcPkcs5EncryptorTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { const std::string kKey = "128=SixteenBytes"; const std::string kIv = "Sweet Sixteen IV"; key_.assign(kKey.begin(), kKey.end()); @@ -443,7 +443,7 @@ TEST_F(AesCbcPkcs5EncryptorTest, CipherTextNotMultipleOfBlockSize) { class AesCbcCtsEncryptorDecryptorTest : public testing::Test { public: - virtual void SetUp() { + void SetUp() override { key_.assign(kAesKey, kAesKey + arraysize(kAesKey)); iv_.assign(kAesIv, kAesIv + arraysize(kAesIv)); } diff --git a/packager/media/base/audio_stream_info.h b/packager/media/base/audio_stream_info.h index 63b6db6662..10c7964361 100644 --- a/packager/media/base/audio_stream_info.h +++ b/packager/media/base/audio_stream_info.h @@ -52,8 +52,8 @@ class AudioStreamInfo : public StreamInfo { /// @name StreamInfo implementation overrides. /// @{ - virtual bool IsValidConfig() const OVERRIDE; - virtual std::string ToString() const OVERRIDE; + bool IsValidConfig() const override; + std::string ToString() const override; /// @} AudioCodec codec() const { return codec_; } @@ -76,7 +76,7 @@ class AudioStreamInfo : public StreamInfo { uint8_t audio_object_type); private: - virtual ~AudioStreamInfo(); + ~AudioStreamInfo() override; AudioCodec codec_; uint8_t sample_bits_; diff --git a/packager/media/base/buffer_writer_unittest.cc b/packager/media/base/buffer_writer_unittest.cc index 1fbb8433c2..0b2386f4b3 100644 --- a/packager/media/base/buffer_writer_unittest.cc +++ b/packager/media/base/buffer_writer_unittest.cc @@ -8,7 +8,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/memory/scoped_ptr.h" #include "packager/media/base/buffer_reader.h" #include "packager/media/base/test/status_test_util.h" diff --git a/packager/media/base/closure_thread.h b/packager/media/base/closure_thread.h index f751bee980..3a11964dc2 100644 --- a/packager/media/base/closure_thread.h +++ b/packager/media/base/closure_thread.h @@ -33,11 +33,11 @@ class ClosureThread : public base::SimpleThread { const base::Closure& task); /// The destructor calls Join automatically if it is not yet joined. - virtual ~ClosureThread(); + ~ClosureThread() override; protected: /// SimpleThread implementation overrides. - virtual void Run() OVERRIDE; + void Run() override; private: const base::Closure task_; diff --git a/packager/media/base/closure_thread_unittest.cc b/packager/media/base/closure_thread_unittest.cc index 2c8c65e2bf..d8b1127415 100644 --- a/packager/media/base/closure_thread_unittest.cc +++ b/packager/media/base/closure_thread_unittest.cc @@ -40,7 +40,7 @@ class ClosureThreadTest : public ::testing::Test { base::Unretained(this)))), val_(0) {} - virtual ~ClosureThreadTest() {} + ~ClosureThreadTest() override {} void ClosureCallback() { // Exit the loop if DoSomething return false. diff --git a/packager/media/base/container_names_unittest.cc b/packager/media/base/container_names_unittest.cc index 9006bb740f..8ef93fb9d7 100644 --- a/packager/media/base/container_names_unittest.cc +++ b/packager/media/base/container_names_unittest.cc @@ -4,7 +4,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/media/base/container_names.h" #include "packager/media/test/test_data_util.h" diff --git a/packager/media/base/http_key_fetcher.h b/packager/media/base/http_key_fetcher.h index 1e8ba852d1..6f6587480c 100644 --- a/packager/media/base/http_key_fetcher.h +++ b/packager/media/base/http_key_fetcher.h @@ -30,12 +30,12 @@ class HttpKeyFetcher : public KeyFetcher { /// Create a fetcher with timeout. /// @param timeout_in_seconds specifies the timeout in seconds. HttpKeyFetcher(uint32_t timeout_in_seconds); - virtual ~HttpKeyFetcher(); + ~HttpKeyFetcher() override; /// @name KeyFetcher implementation overrides. - virtual Status FetchKeys(const std::string& url, - const std::string& request, - std::string* response) OVERRIDE; + Status FetchKeys(const std::string& url, + const std::string& request, + std::string* response) override; /// Fetch content using HTTP GET. /// @param url specifies the content URL. diff --git a/packager/media/base/offset_byte_queue_unittest.cc b/packager/media/base/offset_byte_queue_unittest.cc index 79d068054d..bd04db4a20 100644 --- a/packager/media/base/offset_byte_queue_unittest.cc +++ b/packager/media/base/offset_byte_queue_unittest.cc @@ -14,7 +14,7 @@ namespace media { class OffsetByteQueueTest : public testing::Test { public: - virtual void SetUp() OVERRIDE { + void SetUp() override { uint8_t buf[256]; for (int i = 0; i < 256; i++) { buf[i] = i; diff --git a/packager/media/base/producer_consumer_queue_unittest.cc b/packager/media/base/producer_consumer_queue_unittest.cc index 5c517edb3b..f30a15673a 100644 --- a/packager/media/base/producer_consumer_queue_unittest.cc +++ b/packager/media/base/producer_consumer_queue_unittest.cc @@ -185,11 +185,11 @@ class MultiThreadProducerConsumerQueueTest : public ::testing::Test { base::Bind(&MultiThreadProducerConsumerQueueTest::PushTask, base::Unretained(this))), queue_(kCapacity) {} - virtual ~MultiThreadProducerConsumerQueueTest() {} + ~MultiThreadProducerConsumerQueueTest() override {} protected: - virtual void SetUp() OVERRIDE { thread_.Start(); } - virtual void TearDown() OVERRIDE { thread_.Join(); } + void SetUp() override { thread_.Start(); } + void TearDown() override { thread_.Join(); } void PushTask() { int val = 0; @@ -302,7 +302,7 @@ class MultiThreadProducerConsumerQueueStopTest : public ::testing::TestWithParam { public: MultiThreadProducerConsumerQueueStopTest() : queue_(1), event_(true, false) {} - virtual ~MultiThreadProducerConsumerQueueStopTest() {} + ~MultiThreadProducerConsumerQueueStopTest() override {} public: void ClosureTask(Operation op) { diff --git a/packager/media/base/request_signer.h b/packager/media/base/request_signer.h index f64757fb90..886070ecb7 100644 --- a/packager/media/base/request_signer.h +++ b/packager/media/base/request_signer.h @@ -42,7 +42,7 @@ class RequestSigner { /// AesRequestSigner uses AES-CBC signing. class AesRequestSigner : public RequestSigner { public: - virtual ~AesRequestSigner(); + ~AesRequestSigner() override; /// Create an AesSigner object from key and iv in hex. /// @return The created AesRequestSigner object on success, NULL otherwise. @@ -51,8 +51,8 @@ class AesRequestSigner : public RequestSigner { const std::string& iv_hex); /// RequestSigner implementation override. - virtual bool GenerateSignature(const std::string& message, - std::string* signature) OVERRIDE; + bool GenerateSignature(const std::string& message, + std::string* signature) override; private: AesRequestSigner(const std::string& signer_name, @@ -66,7 +66,7 @@ class AesRequestSigner : public RequestSigner { /// RsaRequestSigner uses RSA-PSS signing. class RsaRequestSigner : public RequestSigner { public: - virtual ~RsaRequestSigner(); + ~RsaRequestSigner() override; /// Create an RsaSigner object using a DER encoded PKCS#1 RSAPrivateKey. /// @return The created RsaRequestSigner object on success, NULL otherwise. @@ -74,8 +74,8 @@ class RsaRequestSigner : public RequestSigner { const std::string& pkcs1_rsa_key); /// RequestSigner implementation override. - virtual bool GenerateSignature(const std::string& message, - std::string* signature) OVERRIDE; + bool GenerateSignature(const std::string& message, + std::string* signature) override; private: RsaRequestSigner(const std::string& signer_name, diff --git a/packager/media/base/rsa_key_unittest.cc b/packager/media/base/rsa_key_unittest.cc index 8acb8dee75..d3567c7866 100644 --- a/packager/media/base/rsa_key_unittest.cc +++ b/packager/media/base/rsa_key_unittest.cc @@ -20,7 +20,7 @@ class RsaKeyTest : public ::testing::TestWithParam { public: RsaKeyTest() : test_set_(GetParam()) {} - virtual void SetUp() { + void SetUp() override { // Make OpenSSL RSA deterministic. ASSERT_TRUE(fake_prng::StartFakePrng()); @@ -29,7 +29,7 @@ class RsaKeyTest : public ::testing::TestWithParam { public_key_.reset(RsaPublicKey::Create(test_set_.public_key)); ASSERT_TRUE(public_key_ != NULL); } - virtual void TearDown() { fake_prng::StopFakePrng(); } + void TearDown() override { fake_prng::StopFakePrng(); } protected: const RsaTestSet& test_set_; diff --git a/packager/media/base/test/fake_prng.cc b/packager/media/base/test/fake_prng.cc index 266ef0c9c7..feffe9f566 100644 --- a/packager/media/base/test/fake_prng.cc +++ b/packager/media/base/test/fake_prng.cc @@ -8,7 +8,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/logging.h" #include "packager/media/test/test_data_util.h" diff --git a/packager/media/base/text_track.h b/packager/media/base/text_track.h index 5e84d7f184..1d0cf84a22 100644 --- a/packager/media/base/text_track.h +++ b/packager/media/base/text_track.h @@ -25,7 +25,7 @@ enum TextKind { class TextTrack { public: - virtual ~TextTrack() {} + ~TextTrack() override {} virtual void addWebVTTCue(const base::TimeDelta& start, const base::TimeDelta& end, const std::string& id, diff --git a/packager/media/base/video_stream_info.cc b/packager/media/base/video_stream_info.cc index f81a219446..b6dd918da3 100644 --- a/packager/media/base/video_stream_info.cc +++ b/packager/media/base/video_stream_info.cc @@ -104,7 +104,7 @@ std::string VideoStreamInfo::GetCodecString(VideoCodec codec, case kCodecH264: { const uint8_t bytes[] = {profile, compatible_profiles, level}; return "avc1." + - StringToLowerASCII(base::HexEncode(bytes, arraysize(bytes))); + base::StringToLowerASCII(base::HexEncode(bytes, arraysize(bytes))); } default: NOTIMPLEMENTED() << "Unknown Codec: " << codec; diff --git a/packager/media/base/video_stream_info.h b/packager/media/base/video_stream_info.h index a122a3e709..821701e92e 100644 --- a/packager/media/base/video_stream_info.h +++ b/packager/media/base/video_stream_info.h @@ -51,8 +51,8 @@ class VideoStreamInfo : public StreamInfo { /// @name StreamInfo implementation overrides. /// @{ - virtual bool IsValidConfig() const OVERRIDE; - virtual std::string ToString() const OVERRIDE; + bool IsValidConfig() const override; + std::string ToString() const override; /// @} VideoCodec codec() const { return codec_; } @@ -80,7 +80,7 @@ class VideoStreamInfo : public StreamInfo { uint8_t level); private: - virtual ~VideoStreamInfo(); + ~VideoStreamInfo() override; VideoCodec codec_; uint16_t width_; diff --git a/packager/media/base/widevine_key_source.cc b/packager/media/base/widevine_key_source.cc index e8859277f0..b2eb1d948d 100644 --- a/packager/media/base/widevine_key_source.cc +++ b/packager/media/base/widevine_key_source.cc @@ -386,7 +386,7 @@ void WidevineKeySource::FillRequest(bool enable_key_rotation, request_dict_.SetInteger("crypto_period_count", crypto_period_count_); } - base::JSONWriter::Write(&request_dict_, request); + base::JSONWriter::Write(request_dict_, request); } Status WidevineKeySource::GenerateKeyMessage(const std::string& request, @@ -412,7 +412,7 @@ Status WidevineKeySource::GenerateKeyMessage(const std::string& request, request_dict.SetString("signer", signer_->signer_name()); } - base::JSONWriter::Write(&request_dict, message); + base::JSONWriter::Write(request_dict, message); return Status::OK; } diff --git a/packager/media/base/widevine_key_source.h b/packager/media/base/widevine_key_source.h index c4fb254133..85cb9b6c13 100644 --- a/packager/media/base/widevine_key_source.h +++ b/packager/media/base/widevine_key_source.h @@ -28,22 +28,22 @@ class WidevineKeySource : public KeySource { /// @param server_url is the Widevine common encryption server url. explicit WidevineKeySource(const std::string& server_url); - virtual ~WidevineKeySource(); + ~WidevineKeySource() override; /// @name KeySource implementation overrides. /// @{ - virtual Status FetchKeys(const std::vector& content_id, - const std::string& policy) OVERRIDE; - virtual Status FetchKeys(const std::vector& pssh_data) OVERRIDE; - virtual Status FetchKeys(uint32_t asset_id) OVERRIDE; + Status FetchKeys(const std::vector& content_id, + const std::string& policy) override; + Status FetchKeys(const std::vector& pssh_data) override; + Status FetchKeys(uint32_t asset_id) override; - virtual Status GetKey(TrackType track_type, EncryptionKey* key) OVERRIDE; - virtual Status GetKey(const std::vector& key_id, - EncryptionKey* key) OVERRIDE; - virtual Status GetCryptoPeriodKey(uint32_t crypto_period_index, - TrackType track_type, - EncryptionKey* key) OVERRIDE; - virtual std::string UUID() OVERRIDE; + Status GetKey(TrackType track_type, EncryptionKey* key) override; + Status GetKey(const std::vector& key_id, + EncryptionKey* key) override; + Status GetCryptoPeriodKey(uint32_t crypto_period_index, + TrackType track_type, + EncryptionKey* key) override; + std::string UUID() override; /// @} /// Set signer for the key source. diff --git a/packager/media/base/widevine_key_source_unittest.cc b/packager/media/base/widevine_key_source_unittest.cc index 45160a1498..beb10ab8df 100644 --- a/packager/media/base/widevine_key_source_unittest.cc +++ b/packager/media/base/widevine_key_source_unittest.cc @@ -120,7 +120,7 @@ class MockRequestSigner : public RequestSigner { public: explicit MockRequestSigner(const std::string& signer_name) : RequestSigner(signer_name) {} - virtual ~MockRequestSigner() {} + ~MockRequestSigner() override {} MOCK_METHOD2(GenerateSignature, bool(const std::string& message, std::string* signature)); @@ -132,7 +132,7 @@ class MockRequestSigner : public RequestSigner { class MockKeyFetcher : public KeyFetcher { public: MockKeyFetcher() : KeyFetcher() {} - virtual ~MockKeyFetcher() {} + ~MockKeyFetcher() override {} MOCK_METHOD3(FetchKeys, Status(const std::string& service_address, @@ -149,7 +149,7 @@ class WidevineKeySourceTest : public ::testing::Test { : mock_request_signer_(new MockRequestSigner(kSignerName)), mock_key_fetcher_(new MockKeyFetcher()) {} - virtual void SetUp() OVERRIDE { + void SetUp() override { content_id_.assign( reinterpret_cast(kContentId), reinterpret_cast(kContentId) + strlen(kContentId)); @@ -158,8 +158,7 @@ class WidevineKeySourceTest : public ::testing::Test { protected: void CreateWidevineKeySource() { widevine_key_source_.reset(new WidevineKeySource(kServerUrl)); - widevine_key_source_->set_key_fetcher( - mock_key_fetcher_.PassAs()); + widevine_key_source_->set_key_fetcher(mock_key_fetcher_.Pass()); } void VerifyKeys(bool classic) { @@ -203,8 +202,7 @@ TEST_F(WidevineKeySourceTest, GenerateSignatureFailure) { .WillOnce(Return(false)); CreateWidevineKeySource(); - widevine_key_source_->set_signer( - mock_request_signer_.PassAs()); + widevine_key_source_->set_signer(mock_request_signer_.Pass()); ASSERT_EQ(Status(error::INTERNAL_ERROR, "Signature generation failed."), widevine_key_source_->FetchKeys(content_id_, kPolicy)); } @@ -228,8 +226,7 @@ TEST_F(WidevineKeySourceTest, HttpFetchFailure) { .WillOnce(Return(kMockStatus)); CreateWidevineKeySource(); - widevine_key_source_->set_signer( - mock_request_signer_.PassAs()); + widevine_key_source_->set_signer(mock_request_signer_.Pass()); ASSERT_EQ(kMockStatus, widevine_key_source_->FetchKeys(content_id_, kPolicy)); } @@ -417,8 +414,7 @@ TEST_F(WidevineKeySourceTest, KeyRotationTest) { } CreateWidevineKeySource(); - widevine_key_source_->set_signer( - mock_request_signer_.PassAs()); + widevine_key_source_->set_signer(mock_request_signer_.Pass()); ASSERT_OK(widevine_key_source_->FetchKeys(content_id_, kPolicy)); EncryptionKey encryption_key; diff --git a/packager/media/event/mpd_notify_muxer_listener.h b/packager/media/event/mpd_notify_muxer_listener.h index 535fbf40ac..14b8cb4b1f 100644 --- a/packager/media/event/mpd_notify_muxer_listener.h +++ b/packager/media/event/mpd_notify_muxer_listener.h @@ -29,7 +29,7 @@ class MpdNotifyMuxerListener : public MuxerListener { /// @param mpd_notifier must be initialized, i.e mpd_notifier->Init() must be /// called. explicit MpdNotifyMuxerListener(MpdNotifier* mpd_notifier); - virtual ~MpdNotifyMuxerListener(); + ~MpdNotifyMuxerListener() override; /// If the stream is encrypted use this as 'schemeIdUri' attribute for /// ContentProtection element. @@ -37,28 +37,27 @@ class MpdNotifyMuxerListener : public MuxerListener { /// @name MuxerListener implementation overrides. /// @{ - virtual void OnEncryptionInfoReady( - bool is_initial_encryption_info, - const std::string& content_protection_uuid, - const std::string& content_protection_name_version, - const std::vector& key_id, - const std::vector& pssh) OVERRIDE; - virtual void OnMediaStart(const MuxerOptions& muxer_options, - const StreamInfo& stream_info, - uint32_t time_scale, - ContainerType container_type) OVERRIDE; - virtual void OnSampleDurationReady(uint32_t sample_duration) OVERRIDE; - virtual void OnMediaEnd(bool has_init_range, - uint64_t init_range_start, - uint64_t init_range_end, - bool has_index_range, - uint64_t index_range_start, - uint64_t index_range_end, - float duration_seconds, - uint64_t file_size) OVERRIDE; - virtual void OnNewSegment(uint64_t start_time, - uint64_t duration, - uint64_t segment_file_size) OVERRIDE; + void OnEncryptionInfoReady(bool is_initial_encryption_info, + const std::string& content_protection_uuid, + const std::string& content_protection_name_version, + const std::vector& key_id, + const std::vector& pssh) override; + void OnMediaStart(const MuxerOptions& muxer_options, + const StreamInfo& stream_info, + uint32_t time_scale, + ContainerType container_type) override; + void OnSampleDurationReady(uint32_t sample_duration) override; + void OnMediaEnd(bool has_init_range, + uint64_t init_range_start, + uint64_t init_range_end, + bool has_index_range, + uint64_t index_range_start, + uint64_t index_range_end, + float duration_seconds, + uint64_t file_size) override; + void OnNewSegment(uint64_t start_time, + uint64_t duration, + uint64_t segment_file_size) override; /// @} private: diff --git a/packager/media/event/vod_media_info_dump_muxer_listener.h b/packager/media/event/vod_media_info_dump_muxer_listener.h index a4add0b6bf..8f626964c3 100644 --- a/packager/media/event/vod_media_info_dump_muxer_listener.h +++ b/packager/media/event/vod_media_info_dump_muxer_listener.h @@ -28,7 +28,7 @@ namespace media { class VodMediaInfoDumpMuxerListener : public MuxerListener { public: VodMediaInfoDumpMuxerListener(const std::string& output_file_name); - virtual ~VodMediaInfoDumpMuxerListener(); + ~VodMediaInfoDumpMuxerListener() override; /// If the stream is encrypted use this as 'schemeIdUri' attribute for /// ContentProtection element. @@ -36,29 +36,27 @@ class VodMediaInfoDumpMuxerListener : public MuxerListener { /// @name MuxerListener implementation overrides. /// @{ - virtual void OnEncryptionInfoReady( - bool is_initial_encryption_info, - const std::string& content_protection_uuid, - const std::string& content_protection_name_version, - const std::vector& default_key_id, - const std::vector& pssh) OVERRIDE; - virtual void OnMediaStart( - const MuxerOptions& muxer_options, - const StreamInfo& stream_info, - uint32_t time_scale, - ContainerType container_type) OVERRIDE; - virtual void OnSampleDurationReady(uint32_t sample_duration) OVERRIDE; - virtual void OnMediaEnd(bool has_init_range, - uint64_t init_range_start, - uint64_t init_range_end, - bool has_index_range, - uint64_t index_range_start, - uint64_t index_range_end, - float duration_seconds, - uint64_t file_size) OVERRIDE; - virtual void OnNewSegment(uint64_t start_time, - uint64_t duration, - uint64_t segment_file_size) OVERRIDE; + void OnEncryptionInfoReady(bool is_initial_encryption_info, + const std::string& content_protection_uuid, + const std::string& content_protection_name_version, + const std::vector& default_key_id, + const std::vector& pssh) override; + void OnMediaStart(const MuxerOptions& muxer_options, + const StreamInfo& stream_info, + uint32_t time_scale, + ContainerType container_type) override; + void OnSampleDurationReady(uint32_t sample_duration) override; + void OnMediaEnd(bool has_init_range, + uint64_t init_range_start, + uint64_t init_range_end, + bool has_index_range, + uint64_t index_range_start, + uint64_t index_range_end, + float duration_seconds, + uint64_t file_size) override; + void OnNewSegment(uint64_t start_time, + uint64_t duration, + uint64_t segment_file_size) override; /// @} private: diff --git a/packager/media/event/vod_media_info_dump_muxer_listener_unittest.cc b/packager/media/event/vod_media_info_dump_muxer_listener_unittest.cc index 8d73800d51..0a2e8b2311 100644 --- a/packager/media/event/vod_media_info_dump_muxer_listener_unittest.cc +++ b/packager/media/event/vod_media_info_dump_muxer_listener_unittest.cc @@ -9,7 +9,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/files/file_path.h" #include "packager/media/base/muxer_options.h" #include "packager/media/base/video_stream_info.h" @@ -61,16 +61,16 @@ void ExpectTextFormatMediaInfoEqual(const std::string& expect, class VodMediaInfoDumpMuxerListenerTest : public ::testing::Test { public: VodMediaInfoDumpMuxerListenerTest() {} - virtual ~VodMediaInfoDumpMuxerListenerTest() {} + ~VodMediaInfoDumpMuxerListenerTest() override {} - virtual void SetUp() OVERRIDE { + void SetUp() override { ASSERT_TRUE(base::CreateTemporaryFile(&temp_file_path_)); DLOG(INFO) << "Created temp file: " << temp_file_path_.value(); listener_.reset(new VodMediaInfoDumpMuxerListener(temp_file_path_.value())); } - virtual void TearDown() OVERRIDE { + void TearDown() override { base::DeleteFile(temp_file_path_, false); } diff --git a/packager/media/file/file_unittest.cc b/packager/media/file/file_unittest.cc index 2205e04efc..e545d66b05 100644 --- a/packager/media/file/file_unittest.cc +++ b/packager/media/file/file_unittest.cc @@ -6,7 +6,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/media/file/file.h" namespace { @@ -18,7 +18,7 @@ namespace media { class LocalFileTest : public testing::Test { protected: - virtual void SetUp() { + void SetUp() override { data_.resize(kDataSize); for (int i = 0; i < kDataSize; ++i) data_[i] = i % 256; @@ -32,7 +32,7 @@ class LocalFileTest : public testing::Test { local_file_name_ += local_file_name_no_prefix_; } - virtual void TearDown() { + void TearDown() override { // Remove test file if created. base::DeleteFile(base::FilePath(local_file_name_no_prefix_), false); } @@ -56,7 +56,7 @@ TEST_F(LocalFileTest, ReadNotExist) { TEST_F(LocalFileTest, Size) { ASSERT_EQ(kDataSize, - file_util::WriteFile(test_file_path_, data_.data(), kDataSize)); + base::WriteFile(test_file_path_, data_.data(), kDataSize)); ASSERT_EQ(kDataSize, File::GetFileSize(local_file_name_.c_str())); } @@ -80,7 +80,7 @@ TEST_F(LocalFileTest, Write) { TEST_F(LocalFileTest, Read_And_Eof) { // Write file using file_util API. ASSERT_EQ(kDataSize, - file_util::WriteFile(test_file_path_, data_.data(), kDataSize)); + base::WriteFile(test_file_path_, data_.data(), kDataSize)); // Read file using File API. File* file = File::Open(local_file_name_.c_str(), "r"); diff --git a/packager/media/file/io_cache.h b/packager/media/file/io_cache.h index 13be7376a8..94ec3e7d1b 100644 --- a/packager/media/file/io_cache.h +++ b/packager/media/file/io_cache.h @@ -20,7 +20,7 @@ namespace media { class IoCache { public: explicit IoCache(uint64_t cache_size); - virtual ~IoCache(); + ~IoCache(); /// Read data from the cache. This function may block until there is data in /// the cache. diff --git a/packager/media/file/io_cache_unittest.cc b/packager/media/file/io_cache_unittest.cc index d3fbeeae50..9d2dd1d634 100644 --- a/packager/media/file/io_cache_unittest.cc +++ b/packager/media/file/io_cache_unittest.cc @@ -46,14 +46,14 @@ class IoCacheTest : public testing::Test { } protected: - virtual void SetUp() OVERRIDE { + void SetUp() override { for (unsigned int idx = 0; idx < kBlockSize; ++idx) reference_block_[idx] = idx; cache_.reset(new IoCache(kCacheSize)); cache_closed_ = false; } - virtual void TearDown() OVERRIDE { + void TearDown() override { WaitForWriterThread(); } diff --git a/packager/media/file/local_file.cc b/packager/media/file/local_file.cc index bba5168222..ef29390af4 100644 --- a/packager/media/file/local_file.cc +++ b/packager/media/file/local_file.cc @@ -8,7 +8,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/logging.h" namespace edash_packager { diff --git a/packager/media/file/local_file.h b/packager/media/file/local_file.h index aacaa94df0..ac4fe0ee15 100644 --- a/packager/media/file/local_file.h +++ b/packager/media/file/local_file.h @@ -27,13 +27,13 @@ class LocalFile : public File { /// @name File implementation overrides. /// @{ - virtual bool Close() OVERRIDE; - virtual int64_t Read(void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Write(const void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Size() OVERRIDE; - virtual bool Flush() OVERRIDE; - virtual bool Seek(uint64_t position) OVERRIDE; - virtual bool Tell(uint64_t* position) OVERRIDE; + bool Close() override; + int64_t Read(void* buffer, uint64_t length) override; + int64_t Write(const void* buffer, uint64_t length) override; + int64_t Size() override; + bool Flush() override; + bool Seek(uint64_t position) override; + bool Tell(uint64_t* position) override; /// @} /// Delete a local file. @@ -42,9 +42,9 @@ class LocalFile : public File { static bool Delete(const char* file_name); protected: - virtual ~LocalFile(); + ~LocalFile() override; - virtual bool Open() OVERRIDE; + bool Open() override; private: std::string file_mode_; diff --git a/packager/media/file/threaded_io_file.h b/packager/media/file/threaded_io_file.h index ba3611562a..cecd52e804 100644 --- a/packager/media/file/threaded_io_file.h +++ b/packager/media/file/threaded_io_file.h @@ -33,19 +33,19 @@ class ThreadedIoFile : public File { /// @name File implementation overrides. /// @{ - virtual bool Close() OVERRIDE; - virtual int64_t Read(void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Write(const void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Size() OVERRIDE; - virtual bool Flush() OVERRIDE; - virtual bool Seek(uint64_t position) OVERRIDE; - virtual bool Tell(uint64_t* position) OVERRIDE; + bool Close() override; + int64_t Read(void* buffer, uint64_t length) override; + int64_t Write(const void* buffer, uint64_t length) override; + int64_t Size() override; + bool Flush() override; + bool Seek(uint64_t position) override; + bool Tell(uint64_t* position) override; /// @} protected: - virtual ~ThreadedIoFile(); + ~ThreadedIoFile() override; - virtual bool Open() OVERRIDE; + bool Open() override; void RunInInputMode(); void RunInOutputMode(); diff --git a/packager/media/file/udp_file.h b/packager/media/file/udp_file.h index ef64f4a140..3afe6ab904 100644 --- a/packager/media/file/udp_file.h +++ b/packager/media/file/udp_file.h @@ -26,19 +26,19 @@ class UdpFile : public File { /// @name File implementation overrides. /// @{ - virtual bool Close() OVERRIDE; - virtual int64_t Read(void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Write(const void* buffer, uint64_t length) OVERRIDE; - virtual int64_t Size() OVERRIDE; - virtual bool Flush() OVERRIDE; - virtual bool Seek(uint64_t position) OVERRIDE; - virtual bool Tell(uint64_t* position) OVERRIDE; + bool Close() override; + int64_t Read(void* buffer, uint64_t length) override; + int64_t Write(const void* buffer, uint64_t length) override; + int64_t Size() override; + bool Flush() override; + bool Seek(uint64_t position) override; + bool Tell(uint64_t* position) override; /// @} protected: - virtual ~UdpFile(); + ~UdpFile() override; - virtual bool Open() OVERRIDE; + bool Open() override; private: int socket_; diff --git a/packager/media/formats/mp2t/adts_header_unittest.cc b/packager/media/formats/mp2t/adts_header_unittest.cc index 479d1540d9..d0ed356c19 100644 --- a/packager/media/formats/mp2t/adts_header_unittest.cc +++ b/packager/media/formats/mp2t/adts_header_unittest.cc @@ -41,7 +41,7 @@ namespace mp2t { class AdtsHeaderTest : public testing::Test { public: - virtual void SetUp() OVERRIDE { + void SetUp() override { ASSERT_TRUE(base::HexStringToBytes(kValidAdtsFrame, &adts_frame_)); } diff --git a/packager/media/formats/mp2t/es_parser.h b/packager/media/formats/mp2t/es_parser.h index c97eafdde9..a309f82caa 100644 --- a/packager/media/formats/mp2t/es_parser.h +++ b/packager/media/formats/mp2t/es_parser.h @@ -20,8 +20,9 @@ namespace mp2t { class EsParser { public: - typedef base::Callback&)> NewStreamInfoCB; - typedef base::Callback&)> + typedef base::Callback&)> + NewStreamInfoCB; + typedef base::Callback&)> EmitSampleCB; EsParser(uint32_t pid) : pid_(pid) {} diff --git a/packager/media/formats/mp2t/es_parser_adts.h b/packager/media/formats/mp2t/es_parser_adts.h index 17854f5400..921ce8f03e 100644 --- a/packager/media/formats/mp2t/es_parser_adts.h +++ b/packager/media/formats/mp2t/es_parser_adts.h @@ -28,15 +28,12 @@ class EsParserAdts : public EsParser { const NewStreamInfoCB& new_stream_info_cb, const EmitSampleCB& emit_sample_cb, bool sbr_in_mimetype); - virtual ~EsParserAdts(); + ~EsParserAdts() override; // EsParser implementation. - virtual bool Parse(const uint8_t* buf, - int size, - int64_t pts, - int64_t dts) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual void Reset() OVERRIDE; + bool Parse(const uint8_t* buf, int size, int64_t pts, int64_t dts) override; + void Flush() override; + void Reset() override; private: // Used to link a PTS with a byte position in the ES stream. diff --git a/packager/media/formats/mp2t/es_parser_h264.h b/packager/media/formats/mp2t/es_parser_h264.h index 4aa03b8188..14f33c1f86 100644 --- a/packager/media/formats/mp2t/es_parser_h264.h +++ b/packager/media/formats/mp2t/es_parser_h264.h @@ -35,15 +35,12 @@ class EsParserH264 : public EsParser { EsParserH264(uint32_t pid, const NewStreamInfoCB& new_stream_info_cb, const EmitSampleCB& emit_sample_cb); - virtual ~EsParserH264(); + ~EsParserH264() override; // EsParser implementation overrides. - virtual bool Parse(const uint8_t* buf, - int size, - int64_t pts, - int64_t dts) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual void Reset() OVERRIDE; + bool Parse(const uint8_t* buf, int size, int64_t pts, int64_t dts) override; + void Flush() override; + void Reset() override; private: struct TimingDesc { diff --git a/packager/media/formats/mp2t/es_parser_h264_unittest.cc b/packager/media/formats/mp2t/es_parser_h264_unittest.cc index d83045b338..ab99296581 100644 --- a/packager/media/formats/mp2t/es_parser_h264_unittest.cc +++ b/packager/media/formats/mp2t/es_parser_h264_unittest.cc @@ -125,13 +125,13 @@ class EsParserH264Test : public testing::Test { void LoadStream(const char* filename); void ProcessPesPackets(const std::vector& pes_packets); - void EmitSample(uint32_t pid, scoped_refptr& sample) { + void EmitSample(uint32_t pid, const scoped_refptr& sample) { sample_count_++; if (sample_count_ == 1) first_frame_is_key_frame_ = sample->is_key_frame(); } - void NewVideoConfig(scoped_refptr& config) { + void NewVideoConfig(const scoped_refptr& config) { DVLOG(1) << config->ToString(); stream_map_[config->track_id()] = config; } diff --git a/packager/media/formats/mp2t/mp2t_media_parser.cc b/packager/media/formats/mp2t/mp2t_media_parser.cc index 0d7f7521cb..06f2ba420d 100644 --- a/packager/media/formats/mp2t/mp2t_media_parser.cc +++ b/packager/media/formats/mp2t/mp2t_media_parser.cc @@ -60,7 +60,7 @@ class PidState { PidType pid_type() const { return pid_type_; } scoped_refptr& config() { return config_; } - void set_config(scoped_refptr& config) { config_ = config; } + void set_config(const scoped_refptr& config) { config_ = config; } SampleQueue& sample_queue() { return sample_queue_; } @@ -326,7 +326,7 @@ void Mp2tMediaParser::RegisterPes(int pmt_pid, } void Mp2tMediaParser::OnNewStreamInfo( - scoped_refptr& new_stream_info) { + const scoped_refptr& new_stream_info) { DCHECK(new_stream_info); DVLOG(1) << "OnVideoConfigChanged for pid=" << new_stream_info->track_id(); @@ -374,8 +374,9 @@ bool Mp2tMediaParser::FinishInitializationIfNeeded() { return true; } -void Mp2tMediaParser::OnEmitSample(uint32_t pes_pid, - scoped_refptr& new_sample) { +void Mp2tMediaParser::OnEmitSample( + uint32_t pes_pid, + const scoped_refptr& new_sample) { DCHECK(new_sample); DVLOG(LOG_LEVEL_ES) << "OnEmitSample: " diff --git a/packager/media/formats/mp2t/mp2t_media_parser.h b/packager/media/formats/mp2t/mp2t_media_parser.h index 92cfc05223..cb35af0665 100644 --- a/packager/media/formats/mp2t/mp2t_media_parser.h +++ b/packager/media/formats/mp2t/mp2t_media_parser.h @@ -30,16 +30,16 @@ typedef std::deque > SampleQueue; class Mp2tMediaParser : public MediaParser { public: Mp2tMediaParser(); - virtual ~Mp2tMediaParser(); + ~Mp2tMediaParser() override; // MediaParser implementation overrides. - virtual void Init(const InitCB& init_cb, - const NewSampleCB& new_sample_cb, - KeySource* decryption_key_source) OVERRIDE; + void Init(const InitCB& init_cb, + const NewSampleCB& new_sample_cb, + KeySource* decryption_key_source) override; - virtual void Flush() OVERRIDE; + void Flush() override; - virtual bool Parse(const uint8_t* buf, int size) OVERRIDE; + bool Parse(const uint8_t* buf, int size) override; private: typedef std::map PidMap; @@ -56,11 +56,12 @@ class Mp2tMediaParser : public MediaParser { // Callback invoked each time the audio/video decoder configuration is // changed. - void OnNewStreamInfo(scoped_refptr& new_stream_info); + void OnNewStreamInfo(const scoped_refptr& new_stream_info); // Callback invoked by the ES media parser // to emit a new audio/video access unit. - void OnEmitSample(uint32_t pes_pid, scoped_refptr& new_sample); + void OnEmitSample(uint32_t pes_pid, + const scoped_refptr& new_sample); // Invoke the initialization callback if needed. bool FinishInitializationIfNeeded(); diff --git a/packager/media/formats/mp2t/ts_section_pat.h b/packager/media/formats/mp2t/ts_section_pat.h index 2e6c4da966..4b435206c8 100644 --- a/packager/media/formats/mp2t/ts_section_pat.h +++ b/packager/media/formats/mp2t/ts_section_pat.h @@ -19,11 +19,11 @@ class TsSectionPat : public TsSectionPsi { typedef base::Callback RegisterPmtCb; explicit TsSectionPat(const RegisterPmtCb& register_pmt_cb); - virtual ~TsSectionPat(); + ~TsSectionPat() override; // TsSectionPsi implementation. - virtual bool ParsePsiSection(BitReader* bit_reader) OVERRIDE; - virtual void ResetPsiSection() OVERRIDE; + bool ParsePsiSection(BitReader* bit_reader) override; + void ResetPsiSection() override; private: RegisterPmtCb register_pmt_cb_; diff --git a/packager/media/formats/mp2t/ts_section_pes.h b/packager/media/formats/mp2t/ts_section_pes.h index 1d2d59b391..3216349715 100644 --- a/packager/media/formats/mp2t/ts_section_pes.h +++ b/packager/media/formats/mp2t/ts_section_pes.h @@ -21,14 +21,14 @@ class EsParser; class TsSectionPes : public TsSection { public: explicit TsSectionPes(scoped_ptr es_parser); - virtual ~TsSectionPes(); + ~TsSectionPes() override; // TsSection implementation. - virtual bool Parse(bool payload_unit_start_indicator, - const uint8_t* buf, - int size) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual void Reset() OVERRIDE; + bool Parse(bool payload_unit_start_indicator, + const uint8_t* buf, + int size) override; + void Flush() override; + void Reset() override; private: // Emit a reassembled PES packet. diff --git a/packager/media/formats/mp2t/ts_section_pmt.h b/packager/media/formats/mp2t/ts_section_pmt.h index 74a29c7b5e..301b51f39d 100644 --- a/packager/media/formats/mp2t/ts_section_pmt.h +++ b/packager/media/formats/mp2t/ts_section_pmt.h @@ -21,11 +21,11 @@ class TsSectionPmt : public TsSectionPsi { typedef base::Callback RegisterPesCb; explicit TsSectionPmt(const RegisterPesCb& register_pes_cb); - virtual ~TsSectionPmt(); + ~TsSectionPmt() override; // Mpeg2TsPsiParser implementation. - virtual bool ParsePsiSection(BitReader* bit_reader) OVERRIDE; - virtual void ResetPsiSection() OVERRIDE; + bool ParsePsiSection(BitReader* bit_reader) override; + void ResetPsiSection() override; private: RegisterPesCb register_pes_cb_; diff --git a/packager/media/formats/mp2t/ts_section_psi.h b/packager/media/formats/mp2t/ts_section_psi.h index 9ff585cb93..865c4e3747 100644 --- a/packager/media/formats/mp2t/ts_section_psi.h +++ b/packager/media/formats/mp2t/ts_section_psi.h @@ -19,14 +19,14 @@ namespace mp2t { class TsSectionPsi : public TsSection { public: TsSectionPsi(); - virtual ~TsSectionPsi(); + ~TsSectionPsi() override; // TsSection implementation. - virtual bool Parse(bool payload_unit_start_indicator, - const uint8_t* buf, - int size) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual void Reset() OVERRIDE; + bool Parse(bool payload_unit_start_indicator, + const uint8_t* buf, + int size) override; + void Flush() override; + void Reset() override; // Parse the content of the PSI section. virtual bool ParsePsiSection(BitReader* bit_reader) = 0; diff --git a/packager/media/formats/mp4/box.h b/packager/media/formats/mp4/box.h index 02f060c4fc..2fc2e05a68 100644 --- a/packager/media/formats/mp4/box.h +++ b/packager/media/formats/mp4/box.h @@ -58,13 +58,13 @@ struct Box { struct FullBox : Box { public: FullBox(); - virtual ~FullBox(); + ~FullBox() override; uint8_t version; uint32_t flags; protected: - virtual bool ReadWrite(BoxBuffer* buffer) OVERRIDE; + bool ReadWrite(BoxBuffer* buffer) override; }; } // namespace mp4 diff --git a/packager/media/formats/mp4/box_definitions.h b/packager/media/formats/mp4/box_definitions.h index 03566c85bf..cc87fe3fcb 100644 --- a/packager/media/formats/mp4/box_definitions.h +++ b/packager/media/formats/mp4/box_definitions.h @@ -31,10 +31,10 @@ class BoxBuffer; #define DECLARE_BOX_METHODS(T) \ T(); \ - virtual ~T(); \ - virtual bool ReadWrite(BoxBuffer* buffer) OVERRIDE; \ - virtual FourCC BoxType() const OVERRIDE; \ - virtual uint32_t ComputeSize() OVERRIDE; + ~T() override; \ + bool ReadWrite(BoxBuffer* buffer) override; \ + FourCC BoxType() const override; \ + uint32_t ComputeSize() override; struct FileType : Box { DECLARE_BOX_METHODS(FileType); diff --git a/packager/media/formats/mp4/box_reader_unittest.cc b/packager/media/formats/mp4/box_reader_unittest.cc index 9e901a1e21..1c4c4c2422 100644 --- a/packager/media/formats/mp4/box_reader_unittest.cc +++ b/packager/media/formats/mp4/box_reader_unittest.cc @@ -30,22 +30,22 @@ static const uint8_t kSkipBox[] = { 0x00}; struct FreeBox : Box { - virtual bool ReadWrite(BoxBuffer* buffer) OVERRIDE { + bool ReadWrite(BoxBuffer* buffer) override { return true; } - virtual FourCC BoxType() const OVERRIDE { return FOURCC_FREE; } - virtual uint32_t ComputeSize() OVERRIDE { + FourCC BoxType() const override { return FOURCC_FREE; } + uint32_t ComputeSize() override { NOTIMPLEMENTED(); return 0; } }; struct PsshBox : Box { - virtual bool ReadWrite(BoxBuffer* buffer) OVERRIDE { + bool ReadWrite(BoxBuffer* buffer) override { return buffer->ReadWriteUInt32(&val); } - virtual FourCC BoxType() const OVERRIDE { return FOURCC_PSSH; } - virtual uint32_t ComputeSize() OVERRIDE { + FourCC BoxType() const override { return FOURCC_PSSH; } + uint32_t ComputeSize() override { NOTIMPLEMENTED(); return 0; } @@ -54,7 +54,7 @@ struct PsshBox : Box { }; struct SkipBox : FullBox { - virtual bool ReadWrite(BoxBuffer* buffer) OVERRIDE { + bool ReadWrite(BoxBuffer* buffer) override { RCHECK(FullBox::ReadWrite(buffer) && buffer->ReadWriteUInt8(&a) && buffer->ReadWriteUInt8(&b) && buffer->ReadWriteUInt16(&c) && buffer->ReadWriteInt32(&d) && @@ -68,8 +68,8 @@ struct SkipBox : FullBox { } return buffer->TryReadWriteChild(&empty); } - virtual FourCC BoxType() const OVERRIDE { return FOURCC_SKIP; } - virtual uint32_t ComputeSize() OVERRIDE { + FourCC BoxType() const override { return FOURCC_SKIP; } + uint32_t ComputeSize() override { NOTIMPLEMENTED(); return 0; } diff --git a/packager/media/formats/mp4/encrypting_fragmenter.h b/packager/media/formats/mp4/encrypting_fragmenter.h index 9d192bd12d..f0c772adff 100644 --- a/packager/media/formats/mp4/encrypting_fragmenter.h +++ b/packager/media/formats/mp4/encrypting_fragmenter.h @@ -31,13 +31,13 @@ class EncryptingFragmenter : public Fragmenter { int64_t clear_time, uint8_t nalu_length_size); - virtual ~EncryptingFragmenter(); + ~EncryptingFragmenter() override; /// @name Fragmenter implementation overrides. /// @{ - virtual Status AddSample(scoped_refptr sample) OVERRIDE; - virtual Status InitializeFragment(int64_t first_sample_dts) OVERRIDE; - virtual void FinalizeFragment() OVERRIDE; + Status AddSample(scoped_refptr sample) override; + Status InitializeFragment(int64_t first_sample_dts) override; + void FinalizeFragment() override; /// @} protected: diff --git a/packager/media/formats/mp4/key_rotation_fragmenter.h b/packager/media/formats/mp4/key_rotation_fragmenter.h index 1c8ff218d9..06c68146f5 100644 --- a/packager/media/formats/mp4/key_rotation_fragmenter.h +++ b/packager/media/formats/mp4/key_rotation_fragmenter.h @@ -43,13 +43,13 @@ class KeyRotationFragmenter : public EncryptingFragmenter { int64_t clear_time, uint8_t nalu_length_size, MuxerListener* muxer_listener); - virtual ~KeyRotationFragmenter(); + ~KeyRotationFragmenter() override; protected: /// @name Fragmenter implementation overrides. /// @{ - virtual Status PrepareFragmentForEncryption(bool enable_encryption) OVERRIDE; - virtual void FinalizeFragmentForEncryption() OVERRIDE; + Status PrepareFragmentForEncryption(bool enable_encryption) override; + void FinalizeFragmentForEncryption() override; /// @} private: diff --git a/packager/media/formats/mp4/mp4_media_parser.h b/packager/media/formats/mp4/mp4_media_parser.h index 73226bba44..08f5a59787 100644 --- a/packager/media/formats/mp4/mp4_media_parser.h +++ b/packager/media/formats/mp4/mp4_media_parser.h @@ -36,15 +36,15 @@ struct ProtectionSystemSpecificHeader; class MP4MediaParser : public MediaParser { public: MP4MediaParser(); - virtual ~MP4MediaParser(); + ~MP4MediaParser() override; /// @name MediaParser implementation overrides. /// @{ - virtual void Init(const InitCB& init_cb, - const NewSampleCB& new_sample_cb, - KeySource* decryption_key_source) OVERRIDE; - virtual void Flush() OVERRIDE; - virtual bool Parse(const uint8_t* buf, int size) OVERRIDE; + void Init(const InitCB& init_cb, + const NewSampleCB& new_sample_cb, + KeySource* decryption_key_source) override; + void Flush() override; + bool Parse(const uint8_t* buf, int size) override; /// @} /// Handles ISO-BMFF containers which have the 'moov' box trailing the diff --git a/packager/media/formats/mp4/mp4_muxer.h b/packager/media/formats/mp4/mp4_muxer.h index e9c3d2ff06..5e45848274 100644 --- a/packager/media/formats/mp4/mp4_muxer.h +++ b/packager/media/formats/mp4/mp4_muxer.h @@ -33,14 +33,14 @@ class MP4Muxer : public Muxer { public: /// Create a MP4Muxer object from MuxerOptions. explicit MP4Muxer(const MuxerOptions& options); - virtual ~MP4Muxer(); + ~MP4Muxer() override; private: // Muxer implementation overrides. - virtual Status Initialize() OVERRIDE; - virtual Status Finalize() OVERRIDE; - virtual Status DoAddSample(const MediaStream* stream, - scoped_refptr sample) OVERRIDE; + Status Initialize() override; + Status Finalize() override; + Status DoAddSample(const MediaStream* stream, + scoped_refptr sample) override; // Generate Audio/Video Track atom. void InitializeTrak(const StreamInfo* info, Track* trak); diff --git a/packager/media/formats/mp4/multi_segment_segmenter.h b/packager/media/formats/mp4/multi_segment_segmenter.h index 2189c7b771..35fde15d2e 100644 --- a/packager/media/formats/mp4/multi_segment_segmenter.h +++ b/packager/media/formats/mp4/multi_segment_segmenter.h @@ -33,19 +33,19 @@ class MultiSegmentSegmenter : public Segmenter { MultiSegmentSegmenter(const MuxerOptions& options, scoped_ptr ftyp, scoped_ptr moov); - virtual ~MultiSegmentSegmenter(); + ~MultiSegmentSegmenter() override; /// @name Segmenter implementation overrides. /// @{ - virtual bool GetInitRange(size_t* offset, size_t* size) OVERRIDE; - virtual bool GetIndexRange(size_t* offset, size_t* size) OVERRIDE; + bool GetInitRange(size_t* offset, size_t* size) override; + bool GetIndexRange(size_t* offset, size_t* size) override; /// @} private: // Segmenter implementation overrides. - virtual Status DoInitialize() OVERRIDE; - virtual Status DoFinalize() OVERRIDE; - virtual Status DoFinalizeSegment() OVERRIDE; + Status DoInitialize() override; + Status DoFinalize() override; + Status DoFinalizeSegment() override; // Write segment to file. Status WriteSegment(); diff --git a/packager/media/formats/mp4/single_segment_segmenter.cc b/packager/media/formats/mp4/single_segment_segmenter.cc index ef3f82e78e..27e6ce44cf 100644 --- a/packager/media/formats/mp4/single_segment_segmenter.cc +++ b/packager/media/formats/mp4/single_segment_segmenter.cc @@ -10,7 +10,7 @@ #include #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/strings/stringprintf.h" #include "packager/base/threading/platform_thread.h" #include "packager/base/time/time.h" diff --git a/packager/media/formats/mp4/single_segment_segmenter.h b/packager/media/formats/mp4/single_segment_segmenter.h index 0d5b0abe47..c01d32b6e7 100644 --- a/packager/media/formats/mp4/single_segment_segmenter.h +++ b/packager/media/formats/mp4/single_segment_segmenter.h @@ -30,19 +30,19 @@ class SingleSegmentSegmenter : public Segmenter { SingleSegmentSegmenter(const MuxerOptions& options, scoped_ptr ftyp, scoped_ptr moov); - virtual ~SingleSegmentSegmenter(); + ~SingleSegmentSegmenter() override; /// @name Segmenter implementation overrides. /// @{ - virtual bool GetInitRange(size_t* offset, size_t* size) OVERRIDE; - virtual bool GetIndexRange(size_t* offset, size_t* size) OVERRIDE; + bool GetInitRange(size_t* offset, size_t* size) override; + bool GetIndexRange(size_t* offset, size_t* size) override; /// @} private: // Segmenter implementation overrides. - virtual Status DoInitialize() OVERRIDE; - virtual Status DoFinalize() OVERRIDE; - virtual Status DoFinalizeSegment() OVERRIDE; + Status DoInitialize() override; + Status DoFinalize() override; + Status DoFinalizeSegment() override; scoped_ptr vod_sidx_; std::string temp_file_name_; diff --git a/packager/media/formats/wvm/wvm_media_parser.h b/packager/media/formats/wvm/wvm_media_parser.h index 92174efdbf..7c7b054c68 100644 --- a/packager/media/formats/wvm/wvm_media_parser.h +++ b/packager/media/formats/wvm/wvm_media_parser.h @@ -50,16 +50,16 @@ struct PrevSampleData { class WvmMediaParser : public MediaParser { public: WvmMediaParser(); - virtual ~WvmMediaParser(); + ~WvmMediaParser() override; // MediaParser implementation overrides. - virtual void Init(const InitCB& init_cb, - const NewSampleCB& new_sample_cb, - KeySource* decryption_key_source) OVERRIDE; + void Init(const InitCB& init_cb, + const NewSampleCB& new_sample_cb, + KeySource* decryption_key_source) override; - virtual void Flush() OVERRIDE; + void Flush() override; - virtual bool Parse(const uint8_t* buf, int size) OVERRIDE; + bool Parse(const uint8_t* buf, int size) override; private: enum Tag { diff --git a/packager/media/formats/wvm/wvm_media_parser_unittest.cc b/packager/media/formats/wvm/wvm_media_parser_unittest.cc index efdb42cb49..9bd2196c47 100644 --- a/packager/media/formats/wvm/wvm_media_parser_unittest.cc +++ b/packager/media/formats/wvm/wvm_media_parser_unittest.cc @@ -52,7 +52,7 @@ namespace media { class MockKeySource : public KeySource { public: MockKeySource() {} - virtual ~MockKeySource() {} + ~MockKeySource() override {} MOCK_METHOD1(FetchKeys, Status(uint32_t asset_id)); MOCK_METHOD2(GetKey, Status(TrackType track_type, diff --git a/packager/media/test/packager_test.cc b/packager/media/test/packager_test.cc index da9de41011..3f92521f91 100644 --- a/packager/media/test/packager_test.cc +++ b/packager/media/test/packager_test.cc @@ -6,7 +6,7 @@ #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/strings/string_number_conversions.h" #include "packager/base/strings/stringprintf.h" #include "packager/base/time/clock.h" @@ -80,14 +80,14 @@ MediaStream* FindFirstAudioStream(const std::vector& streams) { class FakeClock : public base::Clock { public: // Fake the clock to return NULL time. - virtual base::Time Now() OVERRIDE { return base::Time(); } + base::Time Now() override { return base::Time(); } }; class PackagerTestBasic : public ::testing::TestWithParam { public: PackagerTestBasic() {} - virtual void SetUp() OVERRIDE { + void SetUp() override { // Create a test directory for testing, will be deleted after test. ASSERT_TRUE(base::CreateNewTempDirectory("packager_", &test_directory_)); @@ -96,7 +96,7 @@ class PackagerTestBasic : public ::testing::TestWithParam { test_directory_.AppendASCII(GetParam()))); } - virtual void TearDown() OVERRIDE { base::DeleteFile(test_directory_, true); } + void TearDown() override { base::DeleteFile(test_directory_, true); } std::string GetFullPath(const std::string& file_name); // Check if |file1| and |file2| are the same. @@ -271,7 +271,7 @@ TEST_P(PackagerTestBasic, MP4MuxerSingleSegmentEncryptedAudio) { class PackagerTest : public PackagerTestBasic { public: - virtual void SetUp() OVERRIDE { + void SetUp() override { PackagerTestBasic::SetUp(); ASSERT_NO_FATAL_FAILURE(Remux(GetParam(), @@ -347,9 +347,8 @@ TEST_P(PackagerTest, MP4MuxerMultiSegmentsUnencryptedVideo) { std::string segment_content; ASSERT_TRUE(base::ReadFileToString(segment_path, &segment_content)); - int bytes_written = file_util::AppendToFile( - output_path, segment_content.data(), segment_content.size()); - ASSERT_EQ(segment_content.size(), static_cast(bytes_written)); + EXPECT_TRUE(base::AppendToFile(output_path, segment_content.data(), + segment_content.size())); ++segment_index; } diff --git a/packager/media/test/run_tests_with_atexit_manager.cc b/packager/media/test/run_tests_with_atexit_manager.cc index a39f5835fd..97b8f5a4ac 100644 --- a/packager/media/test/run_tests_with_atexit_manager.cc +++ b/packager/media/test/run_tests_with_atexit_manager.cc @@ -14,7 +14,7 @@ int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); // Needed to enable VLOG/DVLOG through --vmodule or --v. - CommandLine::Init(argc, argv); + base::CommandLine::Init(argc, argv); CHECK(logging::InitLogging(logging::LoggingSettings())); base::AtExitManager exit; diff --git a/packager/media/test/test_data_util.cc b/packager/media/test/test_data_util.cc index 9fe4e4ebbd..a47a1cdc40 100644 --- a/packager/media/test/test_data_util.cc +++ b/packager/media/test/test_data_util.cc @@ -4,7 +4,7 @@ #include "packager/media/test/test_data_util.h" -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/logging.h" #include "packager/base/path_service.h" diff --git a/packager/mpd/base/dash_iop_mpd_notifier.h b/packager/mpd/base/dash_iop_mpd_notifier.h index 67f3624735..9a13ddeede 100644 --- a/packager/mpd/base/dash_iop_mpd_notifier.h +++ b/packager/mpd/base/dash_iop_mpd_notifier.h @@ -32,29 +32,27 @@ class DashIopMpdNotifier : public MpdNotifier { const MpdOptions& mpd_options, const std::vector& base_urls, const std::string& output_path); - virtual ~DashIopMpdNotifier() OVERRIDE; + ~DashIopMpdNotifier() override; /// None of the methods write out the MPD file until Flush() is called. /// @name MpdNotifier implemetation overrides. /// @{ - virtual bool Init() OVERRIDE; - virtual bool NotifyNewContainer(const MediaInfo& media_info, - uint32_t* id) OVERRIDE; - virtual bool NotifySampleDuration(uint32_t container_id, - uint32_t sample_duration) OVERRIDE; - virtual bool NotifyNewSegment(uint32_t id, - uint64_t start_time, - uint64_t duration, - uint64_t size) OVERRIDE; - virtual bool NotifyEncryptionUpdate( - uint32_t container_id, - const std::string& drm_uuid, - const std::vector& new_key_id, - const std::vector& new_pssh) OVERRIDE; - virtual bool AddContentProtectionElement( + bool Init() override; + bool NotifyNewContainer(const MediaInfo& media_info, uint32_t* id) override; + bool NotifySampleDuration(uint32_t container_id, + uint32_t sample_duration) override; + bool NotifyNewSegment(uint32_t id, + uint64_t start_time, + uint64_t duration, + uint64_t size) override; + bool NotifyEncryptionUpdate(uint32_t container_id, + const std::string& drm_uuid, + const std::vector& new_key_id, + const std::vector& new_pssh) override; + bool AddContentProtectionElement( uint32_t id, - const ContentProtectionElement& content_protection_element) OVERRIDE; - virtual bool Flush() OVERRIDE; + const ContentProtectionElement& content_protection_element) override; + bool Flush() override; /// @} private: diff --git a/packager/mpd/base/dash_iop_mpd_notifier_unittest.cc b/packager/mpd/base/dash_iop_mpd_notifier_unittest.cc index 727d752a82..2e32338e10 100644 --- a/packager/mpd/base/dash_iop_mpd_notifier_unittest.cc +++ b/packager/mpd/base/dash_iop_mpd_notifier_unittest.cc @@ -7,8 +7,8 @@ #include #include -#include "packager/base/file_util.h" #include "packager/base/files/file_path.h" +#include "packager/base/files/file_util.h" #include "packager/mpd/base/dash_iop_mpd_notifier.h" #include "packager/mpd/base/mock_mpd_builder.h" #include "packager/mpd/base/mpd_builder.h" @@ -101,14 +101,14 @@ class DashIopMpdNotifierTest default_mock_representation_( new MockRepresentation(kDefaultRepresentationId)) {} - virtual void SetUp() OVERRIDE { + void SetUp() override { ASSERT_TRUE(base::CreateTemporaryFile(&temp_file_path_)); output_path_ = temp_file_path_.value(); ON_CALL(*default_mock_adaptation_set_, Group()) .WillByDefault(Return(kDefaultGroupId)); } - virtual void TearDown() OVERRIDE { + void TearDown() override { base::DeleteFile(temp_file_path_, false /* non recursive, just 1 file */); } @@ -175,7 +175,7 @@ TEST_P(DashIopMpdNotifierTest, NotifyNewContainer) { EXPECT_CALL(*mock_mpd_builder, ToString(_)).WillOnce(Return(true)); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &unused_container_id)); EXPECT_TRUE(notifier.Flush()); @@ -296,7 +296,7 @@ TEST_P(DashIopMpdNotifierTest, .WillOnce(Return(hd_representation.get())); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer( ConvertToMediaInfo(kSdProtectedContent), &unused_container_id)); EXPECT_TRUE(notifier.NotifyNewContainer( @@ -399,7 +399,7 @@ TEST_P(DashIopMpdNotifierTest, NotifyNewContainersWithSameProtectedContent) { .WillOnce(Return(hd_representation.get())); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer( ConvertToMediaInfo(kSdProtectedContent), &unused_container_id)); EXPECT_TRUE(notifier.NotifyNewContainer( @@ -419,7 +419,7 @@ TEST_P(DashIopMpdNotifierTest, AddContentProtection) { .WillOnce(Return(default_mock_representation_.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &container_id)); @@ -523,7 +523,7 @@ TEST_P(DashIopMpdNotifierTest, SetGroup) { // This is not very nice but we need it for settings expectations later. MockMpdBuilder* mock_mpd_builder_raw = mock_mpd_builder.get(); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer( ConvertToMediaInfo(kSdProtectedContent), &unused_container_id)); EXPECT_TRUE(notifier.NotifyNewContainer( @@ -664,7 +664,7 @@ TEST_P(DashIopMpdNotifierTest, DoNotSetGroupIfContentTypesDifferent) { .WillOnce(Return(audio_representation.get())); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer( ConvertToMediaInfo(kVideoContent), &unused_container_id)); EXPECT_TRUE(notifier.NotifyNewContainer( @@ -704,7 +704,7 @@ TEST_P(DashIopMpdNotifierTest, UpdateEncryption) { .WillOnce(Return(default_mock_representation_.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kProtectedContent), &container_id)); diff --git a/packager/mpd/base/mock_mpd_builder.h b/packager/mpd/base/mock_mpd_builder.h index 8696c424b8..23c9c7016a 100644 --- a/packager/mpd/base/mock_mpd_builder.h +++ b/packager/mpd/base/mock_mpd_builder.h @@ -20,7 +20,7 @@ class MockMpdBuilder : public MpdBuilder { // |type| indicates whether the MPD should be for VOD or live content (kStatic // for VOD profile, or kDynamic for live profile). explicit MockMpdBuilder(MpdType type); - virtual ~MockMpdBuilder() OVERRIDE; + ~MockMpdBuilder() override; MOCK_METHOD1(AddAdaptationSet, AdaptationSet*(const std::string& lang)); MOCK_METHOD1(ToString, bool(std::string* output)); @@ -30,7 +30,7 @@ class MockAdaptationSet : public AdaptationSet { public: // |adaptation_set_id| is the id for the AdaptationSet. explicit MockAdaptationSet(uint32_t adaptation_set_id); - virtual ~MockAdaptationSet() OVERRIDE; + ~MockAdaptationSet() override; MOCK_METHOD1(AddRepresentation, Representation*(const MediaInfo& media_info)); MOCK_METHOD1(AddContentProtectionElement, @@ -51,7 +51,7 @@ class MockRepresentation : public Representation { public: // |representation_id| is the numeric ID for the . explicit MockRepresentation(uint32_t representation_id); - virtual ~MockRepresentation() OVERRIDE; + ~MockRepresentation() override; MOCK_METHOD1(AddContentProtectionElement, void(const ContentProtectionElement& element)); diff --git a/packager/mpd/base/mpd_builder.cc b/packager/mpd/base/mpd_builder.cc index a8717dfb91..23eff7777d 100644 --- a/packager/mpd/base/mpd_builder.cc +++ b/packager/mpd/base/mpd_builder.cc @@ -353,17 +353,17 @@ class RepresentationStateChangeListenerImpl : representation_id_(representation_id), adaptation_set_(adaptation_set) { DCHECK(adaptation_set_); } - virtual ~RepresentationStateChangeListenerImpl() OVERRIDE {} + ~RepresentationStateChangeListenerImpl() override {} // RepresentationStateChangeListener implementation. - virtual void OnNewSegmentForRepresentation(uint64_t start_time, - uint64_t duration) OVERRIDE { + void OnNewSegmentForRepresentation(uint64_t start_time, + uint64_t duration) override { adaptation_set_->OnNewSegmentForRepresentation(representation_id_, start_time, duration); } - virtual void OnSetFrameRateForRepresentation(uint32_t frame_duration, - uint32_t timescale) OVERRIDE { + void OnSetFrameRateForRepresentation(uint32_t frame_duration, + uint32_t timescale) override { adaptation_set_->OnSetFrameRateForRepresentation(representation_id_, frame_duration, timescale); } diff --git a/packager/mpd/base/mpd_builder_unittest.cc b/packager/mpd/base/mpd_builder_unittest.cc index edaa8d0f29..4296cd6247 100644 --- a/packager/mpd/base/mpd_builder_unittest.cc +++ b/packager/mpd/base/mpd_builder_unittest.cc @@ -9,7 +9,8 @@ #include #include -#include "packager/base/file_util.h" +#include "packager/base/strings/string_piece.h" +#include "packager/base/files/file_util.h" #include "packager/base/logging.h" #include "packager/base/strings/string_number_conversions.h" #include "packager/base/strings/string_piece.h" @@ -97,7 +98,7 @@ template class MpdBuilderTest: public ::testing::Test { public: MpdBuilderTest() : mpd_(type, MpdOptions()), representation_() {} - virtual ~MpdBuilderTest() {} + ~MpdBuilderTest() override {} void CheckMpd(const std::string& expected_output_file) { std::string mpd_doc; @@ -143,11 +144,11 @@ typedef StaticMpdBuilderTest CommonMpdBuilderTest; class DynamicMpdBuilderTest : public MpdBuilderTest { public: - virtual ~DynamicMpdBuilderTest() {} + ~DynamicMpdBuilderTest() override {} // Anchors availabilityStartTime so that the test result doesn't depend on the // current time. - virtual void SetUp() { + void SetUp() override { mpd_.availability_start_time_ = "2011-12-25T12:30:00"; } @@ -180,9 +181,9 @@ class SegmentTemplateTest : public DynamicMpdBuilderTest { public: SegmentTemplateTest() : bandwidth_estimator_(BandwidthEstimator::kUseAllBlocks) {} - virtual ~SegmentTemplateTest() {} + ~SegmentTemplateTest() override {} - virtual void SetUp() { + void SetUp() override { DynamicMpdBuilderTest::SetUp(); ASSERT_NO_FATAL_FAILURE(AddRepresentationWithDefaultMediaInfo()); } @@ -270,12 +271,12 @@ class SegmentTemplateTest : public DynamicMpdBuilderTest { class TimeShiftBufferDepthTest : public SegmentTemplateTest { public: TimeShiftBufferDepthTest() {} - virtual ~TimeShiftBufferDepthTest() {} + ~TimeShiftBufferDepthTest() override {} // This function is tricky. It does not call SegmentTemplateTest::Setup() so // that it does not automatically add a representation, that has $Time$ // template. - virtual void SetUp() { + void SetUp() override { DynamicMpdBuilderTest::SetUp(); // The only diff with current GetDefaultMediaInfo() is that this uses @@ -458,9 +459,9 @@ TEST_F(CommonMpdBuilderTest, new MockRepresentationStateChangeListener()); EXPECT_CALL(*listener, OnNewSegmentForRepresentation(kStartTime, kDuration)); - Representation representation( - ConvertToMediaInfo(kTestMediaInfo), MpdOptions(), kAnyRepresentationId, - listener.PassAs()); + Representation representation(ConvertToMediaInfo(kTestMediaInfo), + MpdOptions(), kAnyRepresentationId, + listener.Pass()); EXPECT_TRUE(representation.Init()); representation.AddNewSegment(kStartTime, kDuration, 10 /* any size */); @@ -489,9 +490,9 @@ TEST_F(CommonMpdBuilderTest, new MockRepresentationStateChangeListener()); EXPECT_CALL(*listener, OnSetFrameRateForRepresentation(kFrameDuration, kTimeScale)); - Representation representation( - ConvertToMediaInfo(kTestMediaInfo), MpdOptions(), kAnyRepresentationId, - listener.PassAs()); + Representation representation(ConvertToMediaInfo(kTestMediaInfo), + MpdOptions(), kAnyRepresentationId, + listener.Pass()); EXPECT_TRUE(representation.Init()); representation.SetSampleDuration(kFrameDuration); diff --git a/packager/mpd/base/mpd_utils.cc b/packager/mpd/base/mpd_utils.cc index 07ebeff1ff..1c70fedc63 100644 --- a/packager/mpd/base/mpd_utils.cc +++ b/packager/mpd/base/mpd_utils.cc @@ -105,7 +105,7 @@ bool HexToUUID(const std::string& data, std::string* uuid_format) { } const std::string hex_encoded = - StringToLowerASCII(base::HexEncode(data.data(), data.size())); + base::StringToLowerASCII(base::HexEncode(data.data(), data.size())); DCHECK_EQ(hex_encoded.size(), kExpectedUUIDSize * 2); base::StringPiece all(hex_encoded); // Note UUID has 5 parts separated with dashes. diff --git a/packager/mpd/base/simple_mpd_notifier.h b/packager/mpd/base/simple_mpd_notifier.h index 1a70d168f1..6eb8575c7e 100644 --- a/packager/mpd/base/simple_mpd_notifier.h +++ b/packager/mpd/base/simple_mpd_notifier.h @@ -34,28 +34,26 @@ class SimpleMpdNotifier : public MpdNotifier { const MpdOptions& mpd_options, const std::vector& base_urls, const std::string& output_path); - virtual ~SimpleMpdNotifier(); + ~SimpleMpdNotifier() override; /// @name MpdNotifier implemetation overrides. /// @{ - virtual bool Init() OVERRIDE; - virtual bool NotifyNewContainer(const MediaInfo& media_info, - uint32_t* id) OVERRIDE; - virtual bool NotifySampleDuration(uint32_t container_id, - uint32_t sample_duration) OVERRIDE; - virtual bool NotifyNewSegment(uint32_t id, - uint64_t start_time, - uint64_t duration, - uint64_t size) OVERRIDE; - virtual bool NotifyEncryptionUpdate( - uint32_t container_id, - const std::string& drm_uuid, - const std::vector& new_key_id, - const std::vector& new_pssh) OVERRIDE; - virtual bool AddContentProtectionElement( + bool Init() override; + bool NotifyNewContainer(const MediaInfo& media_info, uint32_t* id) override; + bool NotifySampleDuration(uint32_t container_id, + uint32_t sample_duration) override; + bool NotifyNewSegment(uint32_t id, + uint64_t start_time, + uint64_t duration, + uint64_t size) override; + bool NotifyEncryptionUpdate(uint32_t container_id, + const std::string& drm_uuid, + const std::vector& new_key_id, + const std::vector& new_pssh) override; + bool AddContentProtectionElement( uint32_t id, - const ContentProtectionElement& content_protection_element) OVERRIDE; - virtual bool Flush() OVERRIDE; + const ContentProtectionElement& content_protection_element) override; + bool Flush() override; /// @} private: diff --git a/packager/mpd/base/simple_mpd_notifier_unittest.cc b/packager/mpd/base/simple_mpd_notifier_unittest.cc index c7289ae522..5a624c2d3d 100644 --- a/packager/mpd/base/simple_mpd_notifier_unittest.cc +++ b/packager/mpd/base/simple_mpd_notifier_unittest.cc @@ -6,8 +6,8 @@ #include -#include "packager/base/file_util.h" #include "packager/base/files/file_path.h" +#include "packager/base/files/file_util.h" #include "packager/mpd/base/mock_mpd_builder.h" #include "packager/mpd/base/mpd_builder.h" #include "packager/mpd/base/mpd_options.h" @@ -42,12 +42,12 @@ class SimpleMpdNotifierTest : default_mock_adaptation_set_( new MockAdaptationSet(kDefaultAdaptationSetId)) {} - virtual void SetUp() OVERRIDE { + void SetUp() override { ASSERT_TRUE(base::CreateTemporaryFile(&temp_file_path_)); output_path_ = temp_file_path_.value(); } - virtual void TearDown() OVERRIDE { + void TearDown() override { base::DeleteFile(temp_file_path_, false /* non recursive, just 1 file */); } @@ -116,7 +116,7 @@ TEST_P(SimpleMpdNotifierTest, NotifyNewContainer) { EXPECT_CALL(*mock_mpd_builder, ToString(_)).WillOnce(Return(true)); uint32_t unused_container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &unused_container_id)); EXPECT_TRUE(notifier.Flush()); @@ -138,7 +138,7 @@ TEST_F(SimpleMpdNotifierTest, LiveNotifySampleDuration) { .WillOnce(Return(mock_representation.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &container_id)); EXPECT_EQ(kRepresentationId, container_id); @@ -169,7 +169,7 @@ TEST_F(SimpleMpdNotifierTest, OnDemandNotifySampleDuration) { .WillOnce(Return(mock_representation.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &container_id)); EXPECT_EQ(kRepresentationId, container_id); @@ -196,7 +196,7 @@ TEST_F(SimpleMpdNotifierTest, LiveNotifyNewSegment) { .WillOnce(Return(mock_representation.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &container_id)); EXPECT_EQ(kRepresentationId, container_id); @@ -227,7 +227,7 @@ TEST_F(SimpleMpdNotifierTest, AddContentProtectionElement) { .WillOnce(Return(mock_representation.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kValidMediaInfo), &container_id)); EXPECT_EQ(kRepresentationId, container_id); @@ -270,7 +270,7 @@ TEST_P(SimpleMpdNotifierTest, UpdateEncryption) { .WillOnce(Return(mock_representation.get())); uint32_t container_id; - SetMpdBuilder(¬ifier, mock_mpd_builder.PassAs()); + SetMpdBuilder(¬ifier, mock_mpd_builder.Pass()); EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kProtectedContent), &container_id)); diff --git a/packager/mpd/base/xml/xml_node.h b/packager/mpd/base/xml/xml_node.h index ff980abddf..59952fcf4e 100644 --- a/packager/mpd/base/xml/xml_node.h +++ b/packager/mpd/base/xml/xml_node.h @@ -95,7 +95,7 @@ class XmlNode { /// AdaptationSet and Representation are subtypes of this. class RepresentationBaseXmlNode : public XmlNode { public: - virtual ~RepresentationBaseXmlNode(); + ~RepresentationBaseXmlNode() override; bool AddContentProtectionElements( const std::list& content_protection_elements); @@ -113,7 +113,7 @@ class RepresentationBaseXmlNode : public XmlNode { class AdaptationSetXmlNode : public RepresentationBaseXmlNode { public: AdaptationSetXmlNode(); - virtual ~AdaptationSetXmlNode(); + ~AdaptationSetXmlNode() override; /// @param scheme_id_uri is content of the schemeIdUri attribute. /// @param value is the content of value attribute. @@ -128,7 +128,7 @@ class AdaptationSetXmlNode : public RepresentationBaseXmlNode { class RepresentationXmlNode : public RepresentationBaseXmlNode { public: RepresentationXmlNode(); - virtual ~RepresentationXmlNode(); + ~RepresentationXmlNode() override; /// Adds video metadata to the MPD. /// @param video_info constains the VideoInfo for a Representation. diff --git a/packager/mpd/base/xml/xml_node_unittest.cc b/packager/mpd/base/xml/xml_node_unittest.cc index bb6a8eb1ef..84c206f7b6 100644 --- a/packager/mpd/base/xml/xml_node_unittest.cc +++ b/packager/mpd/base/xml/xml_node_unittest.cc @@ -55,7 +55,7 @@ ScopedXmlPtr::type MakeDoc(ScopedXmlPtr::type node) { class RepresentationTest : public ::testing::Test { public: RepresentationTest() {} - virtual ~RepresentationTest() {} + ~RepresentationTest() override {} // Ownership transfers, IOW this function will release the resource for // |node|. Returns |node| in string format. diff --git a/packager/mpd/test/mpd_builder_test_helper.cc b/packager/mpd/test/mpd_builder_test_helper.cc index bd5ca5ee57..ebf6160396 100644 --- a/packager/mpd/test/mpd_builder_test_helper.cc +++ b/packager/mpd/test/mpd_builder_test_helper.cc @@ -9,7 +9,7 @@ #include #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/path_service.h" #include "packager/mpd/base/media_info.pb.h" #include "packager/mpd/base/mpd_builder.h" diff --git a/packager/mpd/util/mpd_writer.cc b/packager/mpd/util/mpd_writer.cc index 99b84c465c..a119207faf 100644 --- a/packager/mpd/util/mpd_writer.cc +++ b/packager/mpd/util/mpd_writer.cc @@ -10,8 +10,8 @@ #include #include -#include "packager/base/file_util.h" #include "packager/base/files/file_path.h" +#include "packager/base/files/file_util.h" #include "packager/media/file/file.h" #include "packager/mpd/base/dash_iop_mpd_notifier.h" #include "packager/mpd/base/mpd_builder.h" @@ -35,13 +35,12 @@ namespace { class DashIopMpdNotifierFactory : public MpdNotifierFactory { public: DashIopMpdNotifierFactory() {} - virtual ~DashIopMpdNotifierFactory() OVERRIDE {} + ~DashIopMpdNotifierFactory() override {} - virtual scoped_ptr Create( - DashProfile dash_profile, - const MpdOptions& mpd_options, - const std::vector& base_urls, - const std::string& output_path) OVERRIDE { + scoped_ptr Create(DashProfile dash_profile, + const MpdOptions& mpd_options, + const std::vector& base_urls, + const std::string& output_path) override { return scoped_ptr(new DashIopMpdNotifier( dash_profile, mpd_options, base_urls, output_path)); } @@ -51,13 +50,12 @@ class DashIopMpdNotifierFactory : public MpdNotifierFactory { class SimpleMpdNotifierFactory : public MpdNotifierFactory { public: SimpleMpdNotifierFactory() {} - virtual ~SimpleMpdNotifierFactory() OVERRIDE {} + ~SimpleMpdNotifierFactory() override {} - virtual scoped_ptr Create( - DashProfile dash_profile, - const MpdOptions& mpd_options, - const std::vector& base_urls, - const std::string& output_path) OVERRIDE { + scoped_ptr Create(DashProfile dash_profile, + const MpdOptions& mpd_options, + const std::vector& base_urls, + const std::string& output_path) override { return scoped_ptr(new SimpleMpdNotifier( dash_profile, mpd_options, base_urls, output_path)); } diff --git a/packager/mpd/util/mpd_writer_unittest.cc b/packager/mpd/util/mpd_writer_unittest.cc index d9e32f5faf..bcb3bd0bec 100644 --- a/packager/mpd/util/mpd_writer_unittest.cc +++ b/packager/mpd/util/mpd_writer_unittest.cc @@ -7,7 +7,7 @@ #include #include -#include "packager/base/file_util.h" +#include "packager/base/files/file_util.h" #include "packager/base/path_service.h" #include "packager/mpd/base/dash_iop_mpd_notifier.h" #include "packager/mpd/base/mock_mpd_notifier.h" @@ -26,18 +26,17 @@ namespace { class TestMpdNotifierFactory : public MpdNotifierFactory { public: TestMpdNotifierFactory() {} - virtual ~TestMpdNotifierFactory() OVERRIDE {} + ~TestMpdNotifierFactory() override {} // So sad that this method cannot be mocked (gmock errors at compile time). // Also (probably) this version of gmock does not support returning // scoped_ptr. // For now we only need to return MockMpdNotifier() with these set of // expectations for all the tests. - virtual scoped_ptr Create( - DashProfile dash_profile, - const MpdOptions& mpd_options, - const std::vector& base_urls, - const std::string& output_path) OVERRIDE { + scoped_ptr Create(DashProfile dash_profile, + const MpdOptions& mpd_options, + const std::vector& base_urls, + const std::string& output_path) override { EXPECT_EQ(expected_base_urls_, base_urls); scoped_ptr mock_notifier( @@ -48,7 +47,7 @@ class TestMpdNotifierFactory : public MpdNotifierFactory { .Times(2) .WillRepeatedly(Return(true)); EXPECT_CALL(*mock_notifier, Flush()).WillOnce(Return(true)); - return mock_notifier.PassAs(); + return mock_notifier.Pass(); } void SetExpectedBaseUrls(const std::vector& base_urls) { @@ -64,13 +63,12 @@ class MpdWriterTest : public ::testing::Test { protected: // Note that MpdWriter::SetMpdNotifierFactoryForTest() is not called in SetUp. // Set expectations in the test and call it. - virtual void SetUp() OVERRIDE { + void SetUp() override { notifier_factory_.reset(new TestMpdNotifierFactory()); } void SetMpdNotifierFactoryForTest() { - mpd_writer_.SetMpdNotifierFactoryForTest( - notifier_factory_.PassAs()); + mpd_writer_.SetMpdNotifierFactoryForTest(notifier_factory_.Pass()); } scoped_ptr notifier_factory_;