Update code to resolve problems due to base updates.
Notably deprecate of OVERRIDE, to be replaced with C++11 override. Bug: 22463130 Bug: 22664127 Change-Id: I12c82e092e9e8eb0870da4363307c3563a3531b7
This commit is contained in:
parent
8cd33d8b21
commit
47c79d08ce
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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.";
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <limits>
|
||||
|
||||
#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"
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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"
|
||||
|
||||
|
|
|
@ -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,
|
||||
Status FetchKeys(const std::string& url,
|
||||
const std::string& request,
|
||||
std::string* response) OVERRIDE;
|
||||
std::string* response) override;
|
||||
|
||||
/// Fetch content using HTTP GET.
|
||||
/// @param url specifies the content URL.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Operation> {
|
||||
public:
|
||||
MultiThreadProducerConsumerQueueStopTest() : queue_(1), event_(true, false) {}
|
||||
virtual ~MultiThreadProducerConsumerQueueStopTest() {}
|
||||
~MultiThreadProducerConsumerQueueStopTest() override {}
|
||||
|
||||
public:
|
||||
void ClosureTask(Operation op) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -20,7 +20,7 @@ class RsaKeyTest : public ::testing::TestWithParam<RsaTestSet> {
|
|||
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<RsaTestSet> {
|
|||
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_;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#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"
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<uint8_t>& content_id,
|
||||
const std::string& policy) OVERRIDE;
|
||||
virtual Status FetchKeys(const std::vector<uint8_t>& pssh_data) OVERRIDE;
|
||||
virtual Status FetchKeys(uint32_t asset_id) OVERRIDE;
|
||||
Status FetchKeys(const std::vector<uint8_t>& content_id,
|
||||
const std::string& policy) override;
|
||||
Status FetchKeys(const std::vector<uint8_t>& 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<uint8_t>& key_id,
|
||||
EncryptionKey* key) OVERRIDE;
|
||||
virtual Status GetCryptoPeriodKey(uint32_t crypto_period_index,
|
||||
Status GetKey(TrackType track_type, EncryptionKey* key) override;
|
||||
Status GetKey(const std::vector<uint8_t>& key_id,
|
||||
EncryptionKey* key) override;
|
||||
Status GetCryptoPeriodKey(uint32_t crypto_period_index,
|
||||
TrackType track_type,
|
||||
EncryptionKey* key) OVERRIDE;
|
||||
virtual std::string UUID() OVERRIDE;
|
||||
EncryptionKey* key) override;
|
||||
std::string UUID() override;
|
||||
/// @}
|
||||
|
||||
/// Set signer for the key source.
|
||||
|
|
|
@ -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<const uint8_t*>(kContentId),
|
||||
reinterpret_cast<const uint8_t*>(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<KeyFetcher>());
|
||||
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<RequestSigner>());
|
||||
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<RequestSigner>());
|
||||
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<RequestSigner>());
|
||||
widevine_key_source_->set_signer(mock_request_signer_.Pass());
|
||||
ASSERT_OK(widevine_key_source_->FetchKeys(content_id_, kPolicy));
|
||||
|
||||
EncryptionKey encryption_key;
|
||||
|
|
|
@ -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,
|
||||
void OnEncryptionInfoReady(bool is_initial_encryption_info,
|
||||
const std::string& content_protection_uuid,
|
||||
const std::string& content_protection_name_version,
|
||||
const std::vector<uint8_t>& key_id,
|
||||
const std::vector<uint8_t>& pssh) OVERRIDE;
|
||||
virtual void OnMediaStart(const MuxerOptions& muxer_options,
|
||||
const std::vector<uint8_t>& pssh) override;
|
||||
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,
|
||||
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;
|
||||
virtual void OnNewSegment(uint64_t start_time,
|
||||
uint64_t file_size) override;
|
||||
void OnNewSegment(uint64_t start_time,
|
||||
uint64_t duration,
|
||||
uint64_t segment_file_size) OVERRIDE;
|
||||
uint64_t segment_file_size) override;
|
||||
/// @}
|
||||
|
||||
private:
|
||||
|
|
|
@ -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,
|
||||
void OnEncryptionInfoReady(bool is_initial_encryption_info,
|
||||
const std::string& content_protection_uuid,
|
||||
const std::string& content_protection_name_version,
|
||||
const std::vector<uint8_t>& default_key_id,
|
||||
const std::vector<uint8_t>& pssh) OVERRIDE;
|
||||
virtual void OnMediaStart(
|
||||
const MuxerOptions& muxer_options,
|
||||
const std::vector<uint8_t>& pssh) override;
|
||||
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,
|
||||
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;
|
||||
virtual void OnNewSegment(uint64_t start_time,
|
||||
uint64_t file_size) override;
|
||||
void OnNewSegment(uint64_t start_time,
|
||||
uint64_t duration,
|
||||
uint64_t segment_file_size) OVERRIDE;
|
||||
uint64_t segment_file_size) override;
|
||||
/// @}
|
||||
|
||||
private:
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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");
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "packager/base/file_util.h"
|
||||
#include "packager/base/files/file_util.h"
|
||||
#include "packager/base/logging.h"
|
||||
|
||||
namespace edash_packager {
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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_));
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,9 @@ namespace mp2t {
|
|||
|
||||
class EsParser {
|
||||
public:
|
||||
typedef base::Callback<void(scoped_refptr<StreamInfo>&)> NewStreamInfoCB;
|
||||
typedef base::Callback<void(uint32_t, scoped_refptr<MediaSample>&)>
|
||||
typedef base::Callback<void(const scoped_refptr<StreamInfo>&)>
|
||||
NewStreamInfoCB;
|
||||
typedef base::Callback<void(uint32_t, const scoped_refptr<MediaSample>&)>
|
||||
EmitSampleCB;
|
||||
|
||||
EsParser(uint32_t pid) : pid_(pid) {}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -125,13 +125,13 @@ class EsParserH264Test : public testing::Test {
|
|||
void LoadStream(const char* filename);
|
||||
void ProcessPesPackets(const std::vector<Packet>& pes_packets);
|
||||
|
||||
void EmitSample(uint32_t pid, scoped_refptr<MediaSample>& sample) {
|
||||
void EmitSample(uint32_t pid, const scoped_refptr<MediaSample>& sample) {
|
||||
sample_count_++;
|
||||
if (sample_count_ == 1)
|
||||
first_frame_is_key_frame_ = sample->is_key_frame();
|
||||
}
|
||||
|
||||
void NewVideoConfig(scoped_refptr<StreamInfo>& config) {
|
||||
void NewVideoConfig(const scoped_refptr<StreamInfo>& config) {
|
||||
DVLOG(1) << config->ToString();
|
||||
stream_map_[config->track_id()] = config;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class PidState {
|
|||
PidType pid_type() const { return pid_type_; }
|
||||
|
||||
scoped_refptr<StreamInfo>& config() { return config_; }
|
||||
void set_config(scoped_refptr<StreamInfo>& config) { config_ = config; }
|
||||
void set_config(const scoped_refptr<StreamInfo>& config) { config_ = config; }
|
||||
|
||||
SampleQueue& sample_queue() { return sample_queue_; }
|
||||
|
||||
|
@ -326,7 +326,7 @@ void Mp2tMediaParser::RegisterPes(int pmt_pid,
|
|||
}
|
||||
|
||||
void Mp2tMediaParser::OnNewStreamInfo(
|
||||
scoped_refptr<StreamInfo>& new_stream_info) {
|
||||
const scoped_refptr<StreamInfo>& 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<MediaSample>& new_sample) {
|
||||
void Mp2tMediaParser::OnEmitSample(
|
||||
uint32_t pes_pid,
|
||||
const scoped_refptr<MediaSample>& new_sample) {
|
||||
DCHECK(new_sample);
|
||||
DVLOG(LOG_LEVEL_ES)
|
||||
<< "OnEmitSample: "
|
||||
|
|
|
@ -30,16 +30,16 @@ typedef std::deque<scoped_refptr<MediaSample> > SampleQueue;
|
|||
class Mp2tMediaParser : public MediaParser {
|
||||
public:
|
||||
Mp2tMediaParser();
|
||||
virtual ~Mp2tMediaParser();
|
||||
~Mp2tMediaParser() override;
|
||||
|
||||
// MediaParser implementation overrides.
|
||||
virtual void Init(const InitCB& init_cb,
|
||||
void Init(const InitCB& init_cb,
|
||||
const NewSampleCB& new_sample_cb,
|
||||
KeySource* decryption_key_source) OVERRIDE;
|
||||
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<int, PidState*> PidMap;
|
||||
|
@ -56,11 +56,12 @@ class Mp2tMediaParser : public MediaParser {
|
|||
|
||||
// Callback invoked each time the audio/video decoder configuration is
|
||||
// changed.
|
||||
void OnNewStreamInfo(scoped_refptr<StreamInfo>& new_stream_info);
|
||||
void OnNewStreamInfo(const scoped_refptr<StreamInfo>& 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<MediaSample>& new_sample);
|
||||
void OnEmitSample(uint32_t pes_pid,
|
||||
const scoped_refptr<MediaSample>& new_sample);
|
||||
|
||||
// Invoke the initialization callback if needed.
|
||||
bool FinishInitializationIfNeeded();
|
||||
|
|
|
@ -19,11 +19,11 @@ class TsSectionPat : public TsSectionPsi {
|
|||
typedef base::Callback<void(int, int)> 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_;
|
||||
|
|
|
@ -21,14 +21,14 @@ class EsParser;
|
|||
class TsSectionPes : public TsSection {
|
||||
public:
|
||||
explicit TsSectionPes(scoped_ptr<EsParser> es_parser);
|
||||
virtual ~TsSectionPes();
|
||||
~TsSectionPes() override;
|
||||
|
||||
// TsSection implementation.
|
||||
virtual bool Parse(bool payload_unit_start_indicator,
|
||||
bool Parse(bool payload_unit_start_indicator,
|
||||
const uint8_t* buf,
|
||||
int size) OVERRIDE;
|
||||
virtual void Flush() OVERRIDE;
|
||||
virtual void Reset() OVERRIDE;
|
||||
int size) override;
|
||||
void Flush() override;
|
||||
void Reset() override;
|
||||
|
||||
private:
|
||||
// Emit a reassembled PES packet.
|
||||
|
|
|
@ -21,11 +21,11 @@ class TsSectionPmt : public TsSectionPsi {
|
|||
typedef base::Callback<void(int, int)> 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_;
|
||||
|
|
|
@ -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,
|
||||
bool Parse(bool payload_unit_start_indicator,
|
||||
const uint8_t* buf,
|
||||
int size) OVERRIDE;
|
||||
virtual void Flush() OVERRIDE;
|
||||
virtual void Reset() OVERRIDE;
|
||||
int size) override;
|
||||
void Flush() override;
|
||||
void Reset() override;
|
||||
|
||||
// Parse the content of the PSI section.
|
||||
virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<MediaSample> sample) OVERRIDE;
|
||||
virtual Status InitializeFragment(int64_t first_sample_dts) OVERRIDE;
|
||||
virtual void FinalizeFragment() OVERRIDE;
|
||||
Status AddSample(scoped_refptr<MediaSample> sample) override;
|
||||
Status InitializeFragment(int64_t first_sample_dts) override;
|
||||
void FinalizeFragment() override;
|
||||
/// @}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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,
|
||||
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;
|
||||
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
|
||||
|
|
|
@ -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<MediaSample> sample) OVERRIDE;
|
||||
Status Initialize() override;
|
||||
Status Finalize() override;
|
||||
Status DoAddSample(const MediaStream* stream,
|
||||
scoped_refptr<MediaSample> sample) override;
|
||||
|
||||
// Generate Audio/Video Track atom.
|
||||
void InitializeTrak(const StreamInfo* info, Track* trak);
|
||||
|
|
|
@ -33,19 +33,19 @@ class MultiSegmentSegmenter : public Segmenter {
|
|||
MultiSegmentSegmenter(const MuxerOptions& options,
|
||||
scoped_ptr<FileType> ftyp,
|
||||
scoped_ptr<Movie> 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();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <openssl/err.h>
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#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"
|
||||
|
|
|
@ -30,19 +30,19 @@ class SingleSegmentSegmenter : public Segmenter {
|
|||
SingleSegmentSegmenter(const MuxerOptions& options,
|
||||
scoped_ptr<FileType> ftyp,
|
||||
scoped_ptr<Movie> 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<SegmentIndex> vod_sidx_;
|
||||
std::string temp_file_name_;
|
||||
|
|
|
@ -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,
|
||||
void Init(const InitCB& init_cb,
|
||||
const NewSampleCB& new_sample_cb,
|
||||
KeySource* decryption_key_source) OVERRIDE;
|
||||
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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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<MediaStream*>& 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<const char*> {
|
||||
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<const char*> {
|
|||
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<size_t>(bytes_written));
|
||||
EXPECT_TRUE(base::AppendToFile(output_path, segment_content.data(),
|
||||
segment_content.size()));
|
||||
|
||||
++segment_index;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -32,29 +32,27 @@ class DashIopMpdNotifier : public MpdNotifier {
|
|||
const MpdOptions& mpd_options,
|
||||
const std::vector<std::string>& 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,
|
||||
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;
|
||||
virtual bool NotifyEncryptionUpdate(
|
||||
uint32_t container_id,
|
||||
uint64_t size) override;
|
||||
bool NotifyEncryptionUpdate(uint32_t container_id,
|
||||
const std::string& drm_uuid,
|
||||
const std::vector<uint8_t>& new_key_id,
|
||||
const std::vector<uint8_t>& new_pssh) OVERRIDE;
|
||||
virtual bool AddContentProtectionElement(
|
||||
const std::vector<uint8_t>& 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:
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
SetMpdBuilder(¬ifier, mock_mpd_builder.Pass());
|
||||
EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kProtectedContent),
|
||||
&container_id));
|
||||
|
||||
|
|
|
@ -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 <Representation>.
|
||||
explicit MockRepresentation(uint32_t representation_id);
|
||||
virtual ~MockRepresentation() OVERRIDE;
|
||||
~MockRepresentation() override;
|
||||
|
||||
MOCK_METHOD1(AddContentProtectionElement,
|
||||
void(const ContentProtectionElement& element));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
#include <inttypes.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
|
||||
#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 <MpdBuilder::MpdType type>
|
|||
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<MpdBuilder::kDynamic> {
|
||||
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<RepresentationStateChangeListener>());
|
||||
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<RepresentationStateChangeListener>());
|
||||
Representation representation(ConvertToMediaInfo(kTestMediaInfo),
|
||||
MpdOptions(), kAnyRepresentationId,
|
||||
listener.Pass());
|
||||
EXPECT_TRUE(representation.Init());
|
||||
|
||||
representation.SetSampleDuration(kFrameDuration);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -34,28 +34,26 @@ class SimpleMpdNotifier : public MpdNotifier {
|
|||
const MpdOptions& mpd_options,
|
||||
const std::vector<std::string>& 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,
|
||||
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;
|
||||
virtual bool NotifyEncryptionUpdate(
|
||||
uint32_t container_id,
|
||||
uint64_t size) override;
|
||||
bool NotifyEncryptionUpdate(uint32_t container_id,
|
||||
const std::string& drm_uuid,
|
||||
const std::vector<uint8_t>& new_key_id,
|
||||
const std::vector<uint8_t>& new_pssh) OVERRIDE;
|
||||
virtual bool AddContentProtectionElement(
|
||||
const std::vector<uint8_t>& 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:
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
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<MpdBuilder>());
|
||||
SetMpdBuilder(¬ifier, mock_mpd_builder.Pass());
|
||||
EXPECT_TRUE(notifier.NotifyNewContainer(ConvertToMediaInfo(kProtectedContent),
|
||||
&container_id));
|
||||
|
||||
|
|
|
@ -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<ContentProtectionElement>& 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.
|
||||
|
|
|
@ -55,7 +55,7 @@ ScopedXmlPtr<xmlDoc>::type MakeDoc(ScopedXmlPtr<xmlNode>::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.
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <google/protobuf/text_format.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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"
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include <google/protobuf/text_format.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#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<MpdNotifier> Create(
|
||||
DashProfile dash_profile,
|
||||
scoped_ptr<MpdNotifier> Create(DashProfile dash_profile,
|
||||
const MpdOptions& mpd_options,
|
||||
const std::vector<std::string>& base_urls,
|
||||
const std::string& output_path) OVERRIDE {
|
||||
const std::string& output_path) override {
|
||||
return scoped_ptr<MpdNotifier>(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<MpdNotifier> Create(
|
||||
DashProfile dash_profile,
|
||||
scoped_ptr<MpdNotifier> Create(DashProfile dash_profile,
|
||||
const MpdOptions& mpd_options,
|
||||
const std::vector<std::string>& base_urls,
|
||||
const std::string& output_path) OVERRIDE {
|
||||
const std::string& output_path) override {
|
||||
return scoped_ptr<MpdNotifier>(new SimpleMpdNotifier(
|
||||
dash_profile, mpd_options, base_urls, output_path));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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<MpdNotifier> Create(
|
||||
DashProfile dash_profile,
|
||||
scoped_ptr<MpdNotifier> Create(DashProfile dash_profile,
|
||||
const MpdOptions& mpd_options,
|
||||
const std::vector<std::string>& base_urls,
|
||||
const std::string& output_path) OVERRIDE {
|
||||
const std::string& output_path) override {
|
||||
EXPECT_EQ(expected_base_urls_, base_urls);
|
||||
|
||||
scoped_ptr<MockMpdNotifier> 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<MpdNotifier>();
|
||||
return mock_notifier.Pass();
|
||||
}
|
||||
|
||||
void SetExpectedBaseUrls(const std::vector<std::string>& 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<MpdNotifierFactory>());
|
||||
mpd_writer_.SetMpdNotifierFactoryForTest(notifier_factory_.Pass());
|
||||
}
|
||||
|
||||
scoped_ptr<TestMpdNotifierFactory> notifier_factory_;
|
||||
|
|
Loading…
Reference in New Issue