Add namespace edash_packager to packager codes

For mpd codes, rename dash_packager to edash_packager; for media codes,
add namespace edash_packager.

Change-Id: I1120e6110c734cd02bdbe15f1cf7abddcdfdd7ea
This commit is contained in:
KongQun Yang 2014-09-19 13:41:13 -07:00
parent 5b869fb4fb
commit 3114ee945d
220 changed files with 493 additions and 132 deletions

View File

@ -6,6 +6,7 @@
#include "app/libcrypto_threading.h" #include "app/libcrypto_threading.h"
namespace edash_packager {
namespace media { namespace media {
LibcryptoThreading::LibcryptoThreading() {} LibcryptoThreading::LibcryptoThreading() {}
@ -19,3 +20,4 @@ bool LibcryptoThreading::Initialize() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -9,6 +9,7 @@
#include "base/macros.h" #include "base/macros.h"
namespace edash_packager {
namespace media { namespace media {
/// Enable thread safety for OpenSSL libcrypto. /// Enable thread safety for OpenSSL libcrypto.
@ -34,5 +35,6 @@ class LibcryptoThreading {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // APP_LIBCRYPTO_THREADING_H_ #endif // APP_LIBCRYPTO_THREADING_H_

View File

@ -28,6 +28,7 @@ unsigned long ThreadIdFunction() {
} // anonymous namespace } // anonymous namespace
namespace edash_packager {
namespace media { namespace media {
bool InitLibcryptoThreading() { bool InitLibcryptoThreading() {
@ -50,3 +51,4 @@ bool TerminateLibcryptoThreading() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -58,7 +58,7 @@ ExitStatus RunMpdGenerator() {
base::SplitString(FLAGS_base_urls, ',', &base_urls); base::SplitString(FLAGS_base_urls, ',', &base_urls);
} }
dash_packager::MpdWriter mpd_writer; edash_packager::MpdWriter mpd_writer;
for (Iterator it = base_urls.begin(); it != base_urls.end(); ++it) for (Iterator it = base_urls.begin(); it != base_urls.end(); ++it)
mpd_writer.AddBaseUrl(*it); mpd_writer.AddBaseUrl(*it);

View File

@ -51,14 +51,9 @@ const char kUsage[] =
"If not specified, its value may be estimated.\n"; "If not specified, its value may be estimated.\n";
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
using dash_packager::DashProfile;
using dash_packager::kOnDemandProfile;
using dash_packager::kLiveProfile;
using dash_packager::MpdNotifier;
using dash_packager::MpdOptions;
using dash_packager::SimpleMpdNotifier;
using event::MpdNotifyMuxerListener; using event::MpdNotifyMuxerListener;
using event::MuxerListener; using event::MuxerListener;
using event::VodMediaInfoDumpMuxerListener; using event::VodMediaInfoDumpMuxerListener;
@ -287,6 +282,7 @@ bool RunPackager(const StreamDescriptorList& stream_descriptors) {
} }
} // namespace media } // namespace media
} // namespace edash_packager
int main(int argc, char** argv) { int main(int argc, char** argv) {
google::SetUsageMessage(base::StringPrintf(kUsage, argv[0])); google::SetUsageMessage(base::StringPrintf(kUsage, argv[0]));
@ -295,17 +291,17 @@ int main(int argc, char** argv) {
google::ShowUsageWithFlags(argv[0]); google::ShowUsageWithFlags(argv[0]);
return 1; return 1;
} }
media::LibcryptoThreading libcrypto_threading; edash_packager::media::LibcryptoThreading libcrypto_threading;
if (!libcrypto_threading.Initialize()) { if (!libcrypto_threading.Initialize()) {
LOG(ERROR) << "Could not initialize libcrypto threading."; LOG(ERROR) << "Could not initialize libcrypto threading.";
return 1; return 1;
} }
// TODO(tinskip): Make InsertStreamDescriptor a member of // TODO(tinskip): Make InsertStreamDescriptor a member of
// StreamDescriptorList. // StreamDescriptorList.
media::StreamDescriptorList stream_descriptors; edash_packager::media::StreamDescriptorList stream_descriptors;
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {
if (!InsertStreamDescriptor(argv[i], &stream_descriptors)) if (!InsertStreamDescriptor(argv[i], &stream_descriptors))
return 1; return 1;
} }
return media::RunPackager(stream_descriptors) ? 0 : 1; return edash_packager::media::RunPackager(stream_descriptors) ? 0 : 1;
} }

View File

@ -24,8 +24,7 @@
DEFINE_bool(dump_stream_info, false, "Dump demuxed stream info."); DEFINE_bool(dump_stream_info, false, "Dump demuxed stream info.");
using dash_packager::MpdOptions; namespace edash_packager {
namespace media { namespace media {
void DumpStreamInfo(const std::vector<MediaStream*>& streams) { void DumpStreamInfo(const std::vector<MediaStream*>& streams) {
@ -203,3 +202,4 @@ bool AddStreamToMuxer(const std::vector<MediaStream*>& streams,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -17,9 +17,9 @@
DECLARE_bool(dump_stream_info); DECLARE_bool(dump_stream_info);
namespace dash_packager { namespace edash_packager {
struct MpdOptions; struct MpdOptions;
}
namespace media { namespace media {
@ -51,7 +51,7 @@ bool AssignFlagsFromProfile();
bool GetMuxerOptions(MuxerOptions* muxer_options); bool GetMuxerOptions(MuxerOptions* muxer_options);
/// Fill MpdOptions members using provided command line options. /// Fill MpdOptions members using provided command line options.
bool GetMpdOptions(dash_packager::MpdOptions* mpd_options); bool GetMpdOptions(edash_packager::MpdOptions* mpd_options);
/// Select and add a stream from a provided set to a muxer. /// Select and add a stream from a provided set to a muxer.
/// @param streams contains the set of MediaStreams from which to select. /// @param streams contains the set of MediaStreams from which to select.
@ -65,5 +65,6 @@ bool AddStreamToMuxer(const std::vector<MediaStream*>& streams,
Muxer* muxer); Muxer* muxer);
} // namespace media } // namespace media
} // namespace edash_packager
#endif // APP_PACKAGER_UTIL_H_ #endif // APP_PACKAGER_UTIL_H_

View File

@ -11,6 +11,7 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
namespace edash_packager {
namespace media { namespace media {
namespace { namespace {
@ -120,3 +121,4 @@ bool InsertStreamDescriptor(const std::string& descriptor_string,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
/// Defines a single input/output stream, it's input source, output destination, /// Defines a single input/output stream, it's input source, output destination,
@ -49,5 +50,6 @@ bool InsertStreamDescriptor(const std::string& descriptor_string,
StreamDescriptorList* descriptor_list); StreamDescriptorList* descriptor_list);
} // namespace media } // namespace media
} // namespace edash_packager
#endif // APP_STREAM_DESCRIPTOR_H_ #endif // APP_STREAM_DESCRIPTOR_H_

View File

@ -38,6 +38,7 @@ const uint32 kCencKeySize = 16;
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
AesCtrEncryptor::AesCtrEncryptor() AesCtrEncryptor::AesCtrEncryptor()
@ -256,3 +257,4 @@ bool AesCbcDecryptor::SetIv(const std::vector<uint8>& iv) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -18,6 +18,7 @@
struct aes_key_st; struct aes_key_st;
typedef struct aes_key_st AES_KEY; typedef struct aes_key_st AES_KEY;
namespace edash_packager {
namespace media { namespace media {
class AesCtrEncryptor { class AesCtrEncryptor {
@ -168,5 +169,6 @@ class AesCbcDecryptor {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_AES_ENCRYPTOR_H_ #endif // MEDIA_BASE_AES_ENCRYPTOR_H_

View File

@ -130,6 +130,7 @@ const uint8 kInvalidIv[] = {0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
class AesCtrEncryptorTest : public testing::Test { class AesCtrEncryptorTest : public testing::Test {
@ -440,3 +441,4 @@ TEST_F(AesCbcEncryptorTest, CipherTextNotMultipleOfBlockSize) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "media/base/limits.h" #include "media/base/limits.h"
namespace edash_packager {
namespace media { namespace media {
namespace { namespace {
@ -112,3 +113,4 @@ std::string AudioStreamInfo::GetCodecString(AudioCodec codec,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "media/base/stream_info.h" #include "media/base/stream_info.h"
namespace edash_packager {
namespace media { namespace media {
enum AudioCodec { enum AudioCodec {
@ -87,5 +88,6 @@ class AudioStreamInfo : public StreamInfo {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_AUDIO_STREAM_INFO_H_ #endif // MEDIA_BASE_AUDIO_STREAM_INFO_H_

View File

@ -7,6 +7,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "media/base/timestamp.h" #include "media/base/timestamp.h"
namespace edash_packager {
namespace media { namespace media {
AudioTimestampHelper::AudioTimestampHelper(uint32 timescale, AudioTimestampHelper::AudioTimestampHelper(uint32 timescale,
@ -74,3 +75,4 @@ int64 AudioTimestampHelper::ComputeTimestamp(
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -7,6 +7,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
// Generates timestamps for a sequence of audio sample frames. This class should // Generates timestamps for a sequence of audio sample frames. This class should
@ -67,5 +68,6 @@ class AudioTimestampHelper {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif #endif

View File

@ -7,6 +7,7 @@
#include "media/base/audio_timestamp_helper.h" #include "media/base/audio_timestamp_helper.h"
#include "media/base/timestamp.h" #include "media/base/timestamp.h"
namespace edash_packager {
namespace media { namespace media {
static const uint32 kDefaultSampleRate = 44100; static const uint32 kDefaultSampleRate = 44100;
@ -121,3 +122,4 @@ TEST_F(AudioTimestampHelperTest, GetFramesToTarget) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -4,6 +4,7 @@
#include "media/base/bit_reader.h" #include "media/base/bit_reader.h"
namespace edash_packager {
namespace media { namespace media {
BitReader::BitReader(const uint8* data, off_t size) BitReader::BitReader(const uint8* data, off_t size)
@ -79,3 +80,4 @@ void BitReader::UpdateCurrByte() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -10,6 +10,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
/// A class to read bit streams. /// A class to read bit streams.
@ -76,5 +77,6 @@ class BitReader {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_BIT_READER_H_ #endif // MEDIA_BASE_BIT_READER_H_

View File

@ -6,6 +6,7 @@
#include "media/base/bit_reader.h" #include "media/base/bit_reader.h"
namespace edash_packager {
namespace media { namespace media {
TEST(BitReaderTest, NormalOperationTest) { TEST(BitReaderTest, NormalOperationTest) {
@ -65,3 +66,4 @@ TEST(BitReaderTest, SkipBitsTest) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -8,6 +8,7 @@
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
bool BufferReader::Read1(uint8* v) { bool BufferReader::Read1(uint8* v) {
@ -77,3 +78,4 @@ bool BufferReader::ReadNBytes(T* v, size_t num_bytes) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
namespace edash_packager {
namespace media { namespace media {
/// A simple buffer reader implementation, which reads data of various types /// A simple buffer reader implementation, which reads data of various types
@ -75,5 +76,6 @@ class BufferReader {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_BUFFER_READER_H_ #endif // MEDIA_BASE_BUFFER_READER_H_

View File

@ -9,6 +9,7 @@
#include "base/sys_byteorder.h" #include "base/sys_byteorder.h"
#include "media/file/file.h" #include "media/file/file.h"
namespace edash_packager {
namespace media { namespace media {
BufferWriter::BufferWriter() { BufferWriter::BufferWriter() {
@ -71,3 +72,4 @@ void BufferWriter::AppendInternal(T v) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
class File; class File;
@ -74,5 +75,6 @@ class BufferWriter {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_BUFFER_WRITER_H_ #endif // MEDIA_BASE_BUFFER_WRITER_H_

View File

@ -32,6 +32,7 @@ const int64 kint64 = -10000000000LL;
const uint8 kuint8Array[] = {10, 1, 100, 5, 3, 60}; const uint8 kuint8Array[] = {10, 1, 100, 5, 3, 60};
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
class BufferWriterTest : public testing::Test { class BufferWriterTest : public testing::Test {
@ -187,3 +188,4 @@ TEST_F(BufferWriterTest, WriteToFile) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -6,6 +6,7 @@
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
// Default starting size for the queue. // Default starting size for the queue.
@ -82,3 +83,4 @@ void ByteQueue::Pop(int count) {
uint8* ByteQueue::front() const { return buffer_.get() + offset_; } uint8* ByteQueue::front() const { return buffer_.get() + offset_; }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -8,6 +8,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
namespace edash_packager {
namespace media { namespace media {
/// Represents a queue of bytes. /// Represents a queue of bytes.
@ -53,5 +54,6 @@ class ByteQueue {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_BYTE_QUEUE_H_ #endif // MEDIA_BASE_BYTE_QUEUE_H_

View File

@ -6,6 +6,7 @@
#include "media/base/closure_thread.h" #include "media/base/closure_thread.h"
namespace edash_packager {
namespace media { namespace media {
ClosureThread::ClosureThread( ClosureThread::ClosureThread(
@ -21,3 +22,4 @@ ClosureThread::~ClosureThread() {
void ClosureThread::Run() { task_.Run(); } void ClosureThread::Run() { task_.Run(); }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -10,6 +10,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/threading/simple_thread.h" #include "base/threading/simple_thread.h"
namespace edash_packager {
namespace media { namespace media {
/// Class for creating a thread which invokes a closure. /// Class for creating a thread which invokes a closure.
@ -43,5 +44,6 @@ class ClosureThread : public base::SimpleThread {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_CLOSURE_THREAD_H_ #endif // MEDIA_BASE_CLOSURE_THREAD_H_

View File

@ -28,6 +28,7 @@ class MockOperation {
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
class ClosureThreadTest : public ::testing::Test { class ClosureThreadTest : public ::testing::Test {
@ -118,3 +119,4 @@ TEST_F(ClosureThreadTest, NotStarted) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "media/base/bit_reader.h" #include "media/base/bit_reader.h"
namespace edash_packager {
namespace media { namespace media {
#define TAG(a, b, c, d) \ #define TAG(a, b, c, d) \
@ -1669,3 +1670,4 @@ MediaContainerName DetermineContainer(const uint8* buffer, int buffer_size) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -7,6 +7,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
/// Container formats supported by this utility function. New formats should be /// Container formats supported by this utility function. New formats should be
@ -57,5 +58,6 @@ enum MediaContainerName {
MediaContainerName DetermineContainer(const uint8* buffer, int buffer_size); MediaContainerName DetermineContainer(const uint8* buffer, int buffer_size);
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_CONTAINER_NAMES_H_ #endif // MEDIA_BASE_CONTAINER_NAMES_H_

View File

@ -8,6 +8,7 @@
#include "media/base/container_names.h" #include "media/base/container_names.h"
#include "media/test/test_data_util.h" #include "media/test/test_data_util.h"
namespace edash_packager {
namespace media { namespace media {
// Using a macros to simplify tests. Since EXPECT_EQ outputs the second argument // Using a macros to simplify tests. Since EXPECT_EQ outputs the second argument
@ -215,3 +216,4 @@ TEST(ContainerNamesTest, FileCheckUNKNOWN) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -6,6 +6,7 @@
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
DecryptConfig::DecryptConfig(const std::vector<uint8>& key_id, DecryptConfig::DecryptConfig(const std::vector<uint8>& key_id,
@ -23,3 +24,4 @@ DecryptConfig::DecryptConfig(const std::vector<uint8>& key_id,
DecryptConfig::~DecryptConfig() {} DecryptConfig::~DecryptConfig() {}
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
namespace edash_packager {
namespace media { namespace media {
/// The Common Encryption spec provides for subsample encryption, where portions /// The Common Encryption spec provides for subsample encryption, where portions
@ -71,5 +72,6 @@ class DecryptConfig {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_DECRYPT_CONFIG_H_ #endif // MEDIA_BASE_DECRYPT_CONFIG_H_

View File

@ -11,6 +11,7 @@
#include "media/base/container_names.h" #include "media/base/container_names.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
/// DecryptorSource is responsible for decryption key acquisition. /// DecryptorSource is responsible for decryption key acquisition.
@ -32,5 +33,6 @@ class DecryptorSource {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_DECRYPTOR_SOURCE_H_ #endif // MEDIA_BASE_DECRYPTOR_SOURCE_H_

View File

@ -24,6 +24,7 @@ namespace {
const size_t kBufSize = 0x40000; // 256KB. const size_t kBufSize = 0x40000; // 256KB.
} }
namespace edash_packager {
namespace media { namespace media {
Demuxer::Demuxer(const std::string& file_name) Demuxer::Demuxer(const std::string& file_name)
@ -161,3 +162,4 @@ Status Demuxer::Parse() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -14,6 +14,7 @@
#include "media/base/container_names.h" #include "media/base/container_names.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
class Decryptor; class Decryptor;
@ -78,5 +79,6 @@ class Demuxer {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_DEMUXER_H_ #endif // MEDIA_BASE_DEMUXER_H_

View File

@ -39,6 +39,7 @@ const RAND_METHOD kFakeRandMethod = {NULL, // RAND_seed function.
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
namespace fake_prng { namespace fake_prng {
@ -71,3 +72,4 @@ void StopFakePrng() {
} // namespace fake_prng } // namespace fake_prng
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -9,6 +9,7 @@
#ifndef MEDIA_BASE_FAKE_PRNG_H #ifndef MEDIA_BASE_FAKE_PRNG_H
#define MEDIA_BASE_FAKE_PRNG_H #define MEDIA_BASE_FAKE_PRNG_H
namespace edash_packager {
namespace media { namespace media {
namespace fake_prng { namespace fake_prng {
@ -21,5 +22,6 @@ void StopFakePrng();
} // namespace fake_prng } // namespace fake_prng
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_FAKE_PRNG_H #endif // MEDIA_BASE_FAKE_PRNG_H

View File

@ -37,6 +37,7 @@ size_t AppendToString(char* ptr, size_t size, size_t nmemb, std::string* respons
} }
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
HttpFetcher::HttpFetcher() {} HttpFetcher::HttpFetcher() {}
@ -110,3 +111,4 @@ Status SimpleHttpFetcher::FetchInternal(HttpMethod method,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -10,6 +10,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
/// Defines a generic http fetcher interface. /// Defines a generic http fetcher interface.
@ -77,6 +78,7 @@ class SimpleHttpFetcher : public HttpFetcher {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_HTTP_FETCHER_H_ #endif // MEDIA_BASE_HTTP_FETCHER_H_

View File

@ -24,6 +24,7 @@ const char kExpectedPostResponse[] =
const char kDelayTwoSecs[] = "delay=2"; // This causes host to delay 2 seconds. const char kDelayTwoSecs[] = "delay=2"; // This causes host to delay 2 seconds.
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
static void CheckHttpGet(const std::string& url, static void CheckHttpGet(const std::string& url,
@ -85,4 +86,5 @@ TEST(DISABLED_HttpFetcherTest, BigTimeout) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -16,6 +16,7 @@ const uint8 kWidevineSystemId[] = {0xed, 0xef, 0x8b, 0xa9, 0x79, 0xd6,
0xd5, 0x1d, 0x21, 0xed}; 0xd5, 0x1d, 0x21, 0xed};
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
EncryptionKey::EncryptionKey() {} EncryptionKey::EncryptionKey() {}
@ -150,3 +151,4 @@ KeySource::KeySource(scoped_ptr<EncryptionKey> encryption_key)
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
struct EncryptionKey { struct EncryptionKey {
@ -112,5 +113,6 @@ class KeySource {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_KEY_SOURCE_H_ #endif // MEDIA_BASE_KEY_SOURCE_H_

View File

@ -9,6 +9,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
namespace limits { namespace limits {
@ -47,5 +48,6 @@ enum {
} // namespace limits } // namespace limits
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_LIMITS_H_ #endif // MEDIA_BASE_LIMITS_H_

View File

@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "media/base/container_names.h" #include "media/base/container_names.h"
namespace edash_packager {
namespace media { namespace media {
class KeySource; class KeySource;
@ -65,5 +66,6 @@ class MediaParser {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MEDIA_PARSER_H_ #endif // MEDIA_BASE_MEDIA_PARSER_H_

View File

@ -11,6 +11,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
namespace edash_packager {
namespace media { namespace media {
MediaSample::MediaSample(const uint8* data, MediaSample::MediaSample(const uint8* data,
@ -84,3 +85,4 @@ std::string MediaSample::ToString() const {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
namespace edash_packager {
namespace media { namespace media {
/// Class to hold a media sample. /// Class to hold a media sample.
@ -159,5 +160,6 @@ class MediaSample : public base::RefCountedThreadSafe<MediaSample> {
typedef std::deque<scoped_refptr<MediaSample> > BufferQueue; typedef std::deque<scoped_refptr<MediaSample> > BufferQueue;
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MEDIA_SAMPLE_H_ #endif // MEDIA_BASE_MEDIA_SAMPLE_H_

View File

@ -13,6 +13,7 @@
#include "media/base/muxer.h" #include "media/base/muxer.h"
#include "media/base/stream_info.h" #include "media/base/stream_info.h"
namespace edash_packager {
namespace media { namespace media {
MediaStream::MediaStream(scoped_refptr<StreamInfo> info, Demuxer* demuxer) MediaStream::MediaStream(scoped_refptr<StreamInfo> info, Demuxer* demuxer)
@ -105,3 +106,4 @@ std::string MediaStream::ToString() const {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,6 +13,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
class Demuxer; class Demuxer;
@ -74,5 +75,6 @@ class MediaStream {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MEDIA_STREAM_H_ #endif // MEDIA_BASE_MEDIA_STREAM_H_

View File

@ -9,6 +9,7 @@
#include "media/base/media_sample.h" #include "media/base/media_sample.h"
#include "media/base/media_stream.h" #include "media/base/media_stream.h"
namespace edash_packager {
namespace media { namespace media {
Muxer::Muxer(const MuxerOptions& options) Muxer::Muxer(const MuxerOptions& options)
@ -95,3 +96,4 @@ Status Muxer::AddSample(const MediaStream* stream,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -20,6 +20,7 @@ namespace base {
class Clock; class Clock;
} }
namespace edash_packager {
namespace media { namespace media {
class KeySource; class KeySource;
@ -121,5 +122,6 @@ class Muxer {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MUXER_H_ #endif // MEDIA_BASE_MUXER_H_

View File

@ -6,6 +6,7 @@
#include "media/base/muxer_options.h" #include "media/base/muxer_options.h"
namespace edash_packager {
namespace media { namespace media {
MuxerOptions::MuxerOptions() MuxerOptions::MuxerOptions()
@ -19,3 +20,4 @@ MuxerOptions::MuxerOptions()
MuxerOptions::~MuxerOptions() {} MuxerOptions::~MuxerOptions() {}
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,6 +13,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
/// This structure contains the list of configuration options for Muxer. /// This structure contains the list of configuration options for Muxer.
@ -70,5 +71,6 @@ struct MuxerOptions {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MUXER_OPTIONS_H_ #endif // MEDIA_BASE_MUXER_OPTIONS_H_

View File

@ -32,6 +32,7 @@ bool ValidateFormatTag(const std::string& format_tag) {
} }
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
bool ValidateSegmentTemplate(const std::string& segment_template) { bool ValidateSegmentTemplate(const std::string& segment_template) {
@ -152,4 +153,5 @@ std::string GetSegmentName(const std::string& segment_template,
return segment_name; return segment_name;
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,6 +13,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
/// Validates the segment template against segment URL construction rule /// Validates the segment template against segment URL construction rule
@ -35,5 +36,6 @@ std::string GetSegmentName(const std::string& segment_template,
uint32 bandwidth); uint32 bandwidth);
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_MUXER_UTIL_H_ #endif // MEDIA_BASE_MUXER_UTIL_H_

View File

@ -8,6 +8,7 @@
#include "media/base/muxer_util.h" #include "media/base/muxer_util.h"
namespace edash_packager {
namespace media { namespace media {
TEST(MuxerUtilTest, ValidateSegmentTemplate) { TEST(MuxerUtilTest, ValidateSegmentTemplate) {
@ -153,3 +154,4 @@ TEST(MuxerUtilTest, GetSegmentNameLargeTime) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -4,6 +4,7 @@
#include "media/base/network_util.h" #include "media/base/network_util.h"
namespace edash_packager {
namespace media { namespace media {
uint32 uint32
@ -27,4 +28,5 @@ ntohllFromBuffer( const unsigned char * buf ) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -8,6 +8,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
uint32 ntohlFromBuffer(const unsigned char * buf); uint32 ntohlFromBuffer(const unsigned char * buf);
@ -15,5 +16,6 @@ uint16 ntohsFromBuffer(const unsigned char * buf);
uint64 ntohllFromBuffer(const unsigned char * buf); uint64 ntohllFromBuffer(const unsigned char * buf);
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_NETWORK_UTIL_H_ #endif // MEDIA_BASE_NETWORK_UTIL_H_

View File

@ -7,6 +7,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
OffsetByteQueue::OffsetByteQueue() : buf_(NULL), size_(0), head_(0) {} OffsetByteQueue::OffsetByteQueue() : buf_(NULL), size_(0), head_(0) {}
@ -62,3 +63,4 @@ void OffsetByteQueue::Sync() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -8,6 +8,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "media/base/byte_queue.h" #include "media/base/byte_queue.h"
namespace edash_packager {
namespace media { namespace media {
/// Wrapper around ByteQueue, which encapsulates the notion of a /// Wrapper around ByteQueue, which encapsulates the notion of a
@ -65,5 +66,6 @@ class OffsetByteQueue {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_OFFSET_BYTE_QUEUE_H_ #endif // MEDIA_BASE_OFFSET_BYTE_QUEUE_H_

View File

@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "media/base/offset_byte_queue.h" #include "media/base/offset_byte_queue.h"
namespace edash_packager {
namespace media { namespace media {
class OffsetByteQueueTest : public testing::Test { class OffsetByteQueueTest : public testing::Test {
@ -90,3 +91,4 @@ TEST_F(OffsetByteQueueTest, Trim) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -15,6 +15,7 @@
#include "base/timer/elapsed_timer.h" #include "base/timer/elapsed_timer.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
static const size_t kUnlimitedCapacity = 0u; static const size_t kUnlimitedCapacity = 0u;
@ -314,5 +315,6 @@ void ProducerConsumerQueue<T>::SlideHeadOnCenter(size_t pos) {
} }
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_PRODUCER_CONSUMER_QUEUE_H_ #endif // MEDIA_BASE_PRODUCER_CONSUMER_QUEUE_H_

View File

@ -26,6 +26,7 @@ bool CheckTimeApproxEqual(int64 time_in_milliseconds,
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
TEST(ProducerConsumerQueueTest, CheckEmpty) { TEST(ProducerConsumerQueueTest, CheckEmpty) {
@ -364,3 +365,4 @@ INSTANTIATE_TEST_CASE_P(Operations,
::testing::Values(kPush, kPop, kPeek)); ::testing::Values(kPush, kPop, kPeek));
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "media/base/aes_encryptor.h" #include "media/base/aes_encryptor.h"
#include "media/base/rsa_key.h" #include "media/base/rsa_key.h"
namespace edash_packager {
namespace media { namespace media {
RequestSigner::RequestSigner(const std::string& signer_name) RequestSigner::RequestSigner(const std::string& signer_name)
@ -73,3 +74,4 @@ bool RsaRequestSigner::GenerateSignature(const std::string& message,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
namespace edash_packager {
namespace media { namespace media {
class AesCbcEncryptor; class AesCbcEncryptor;
@ -87,5 +88,6 @@ class RsaRequestSigner : public RequestSigner {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_REQUEST_SIGNER_H_ #endif // MEDIA_BASE_REQUEST_SIGNER_H_

View File

@ -83,6 +83,7 @@ RSA* DeserializeRsaPublicKey(const std::string& serialized_key) {
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
RsaPrivateKey::RsaPrivateKey(RSA* rsa_key) : rsa_key_(rsa_key) { RsaPrivateKey::RsaPrivateKey(RSA* rsa_key) : rsa_key_(rsa_key) {
@ -246,3 +247,4 @@ bool RsaPublicKey::VerifySignature(const std::string& message,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -17,6 +17,7 @@
struct rsa_st; struct rsa_st;
typedef struct rsa_st RSA; typedef struct rsa_st RSA;
namespace edash_packager {
namespace media { namespace media {
/// Rsa private key, used for message signing and decryption. /// Rsa private key, used for message signing and decryption.
@ -78,5 +79,6 @@ class RsaPublicKey {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_RSA_KEY_H_ #endif // MEDIA_BASE_RSA_KEY_H_

View File

@ -13,6 +13,7 @@
#include "media/base/rsa_key.h" #include "media/base/rsa_key.h"
#include "media/base/rsa_test_data.h" #include "media/base/rsa_test_data.h"
namespace edash_packager {
namespace media { namespace media {
class RsaKeyTest : public ::testing::TestWithParam<RsaTestSet> { class RsaKeyTest : public ::testing::TestWithParam<RsaTestSet> {
@ -146,3 +147,4 @@ INSTANTIATE_TEST_CASE_P(RsaTestKeys,
RsaTestData().test_set_2048_bits())); RsaTestData().test_set_2048_bits()));
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -443,6 +443,7 @@ const uint8 kTestSignature_2048[] = {
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
RsaTestSet::RsaTestSet() {} RsaTestSet::RsaTestSet() {}
@ -478,3 +479,4 @@ RsaTestData::RsaTestData() {
RsaTestData::~RsaTestData() {} RsaTestData::~RsaTestData() {}
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,6 +13,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
/// Self generated test vector to verify algorithm stability. /// Self generated test vector to verify algorithm stability.
@ -44,5 +45,6 @@ class RsaTestData {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_RSA_TEST_DATA_H_ #endif // MEDIA_BASE_RSA_TEST_DATA_H_

View File

@ -8,6 +8,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
namespace edash_packager {
namespace media { namespace media {
namespace error { namespace error {
@ -71,3 +72,4 @@ std::ostream& operator<<(std::ostream& os, const Status& x) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
namespace error { namespace error {
@ -166,5 +167,6 @@ extern std::ostream& operator<<(std::ostream& os, const Status& x);
#define DCHECK_OK(val) DCHECK_EQ(Status::OK, (val)) #define DCHECK_OK(val) DCHECK_EQ(Status::OK, (val))
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_STATUS_H_ #endif // MEDIA_BASE_STATUS_H_

View File

@ -11,7 +11,13 @@
#include "media/base/status.h" #include "media/base/status.h"
#define EXPECT_OK(val) EXPECT_EQ(media::Status::OK, (val)) namespace edash_packager {
#define ASSERT_OK(val) ASSERT_EQ(media::Status::OK, (val)) namespace media {
#define EXPECT_OK(val) EXPECT_EQ(Status::OK, (val))
#define ASSERT_OK(val) ASSERT_EQ(Status::OK, (val))
} // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_STATUS_TEST_UTIL_H_ #endif // MEDIA_BASE_STATUS_TEST_UTIL_H_

View File

@ -8,21 +8,26 @@
#include "media/base/status_test_util.h" #include "media/base/status_test_util.h"
namespace edash_packager {
namespace media {
TEST(StatusTestUtil, ExpectOkSuccess) { TEST(StatusTestUtil, ExpectOkSuccess) {
EXPECT_OK(media::Status::OK); EXPECT_OK(Status::OK);
} }
TEST(StatusTestUtil, AssertOkSuccess) { TEST(StatusTestUtil, AssertOkSuccess) {
ASSERT_OK(media::Status::OK); ASSERT_OK(Status::OK);
} }
TEST(StatusTestUtil, ExpectOkFailure) { TEST(StatusTestUtil, ExpectOkFailure) {
media::Status status(media::error::UNKNOWN, "Status Unknown"); Status status(error::UNKNOWN, "Status Unknown");
EXPECT_NONFATAL_FAILURE(EXPECT_OK(status), "Status Unknown"); EXPECT_NONFATAL_FAILURE(EXPECT_OK(status), "Status Unknown");
} }
TEST(StatusTestUtil, AssertOkFailure) { TEST(StatusTestUtil, AssertOkFailure) {
EXPECT_FATAL_FAILURE( EXPECT_FATAL_FAILURE(ASSERT_OK(Status(error::UNKNOWN, "Status Unknown")),
ASSERT_OK(media::Status(media::error::UNKNOWN, "Status Unknown")), "Status Unknown");
"Status Unknown");
} }
} // namespace media
} // namespace edash_packager

View File

@ -10,6 +10,7 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "media/base/status.h" #include "media/base/status.h"
namespace edash_packager {
namespace media { namespace media {
static void CheckStatus(const Status& s, static void CheckStatus(const Status& s,
@ -176,3 +177,4 @@ TEST(Status, EqualsDifferentMessage) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
namespace edash_packager {
namespace media { namespace media {
StreamInfo::StreamInfo(StreamType stream_type, StreamInfo::StreamInfo(StreamType stream_type,
@ -51,3 +52,4 @@ std::string StreamInfo::ToString() const {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
namespace edash_packager {
namespace media { namespace media {
enum StreamType { enum StreamType {
@ -87,5 +88,6 @@ class StreamInfo : public base::RefCountedThreadSafe<StreamInfo> {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_STREAM_INFO_H_ #endif // MEDIA_BASE_STREAM_INFO_H_

View File

@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "base/time/time.h" #include "base/time/time.h"
namespace edash_packager {
namespace media { namespace media {
/// Specifies the varieties of text tracks. /// Specifies the varieties of text tracks.
@ -38,5 +39,6 @@ typedef base::Callback<scoped_ptr<TextTrack>
const std::string& language)> AddTextTrackCB; const std::string& language)> AddTextTrackCB;
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_TEXT_TRACK_H_ #endif // MEDIA_BASE_TEXT_TRACK_H_

View File

@ -10,11 +10,13 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
const int64 kNoTimestamp = kint64min; const int64 kNoTimestamp = kint64min;
const int64 kInfiniteDuration = kint64max; const int64 kInfiniteDuration = kint64max;
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_TIMESTAMP_H_ #endif // MEDIA_BASE_TIMESTAMP_H_

View File

@ -11,6 +11,7 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "media/base/limits.h" #include "media/base/limits.h"
namespace edash_packager {
namespace media { namespace media {
namespace { namespace {
@ -103,3 +104,4 @@ std::string VideoStreamInfo::GetCodecString(VideoCodec codec,
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -9,6 +9,7 @@
#include "media/base/stream_info.h" #include "media/base/stream_info.h"
namespace edash_packager {
namespace media { namespace media {
enum VideoCodec { enum VideoCodec {
@ -76,5 +77,6 @@ class VideoStreamInfo : public StreamInfo {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_VIDEO_STREAM_INFO_H_ #endif // MEDIA_BASE_VIDEO_STREAM_INFO_H_

View File

@ -110,6 +110,7 @@ bool GetPsshDataFromTrack(const base::DictionaryValue& track_dict,
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
// A ref counted wrapper for EncryptionKeyMap. // A ref counted wrapper for EncryptionKeyMap.
@ -548,3 +549,4 @@ bool WidevineKeySource::PushToKeyPool(
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -15,6 +15,7 @@
#include "media/base/closure_thread.h" #include "media/base/closure_thread.h"
#include "media/base/key_source.h" #include "media/base/key_source.h"
namespace edash_packager {
namespace media { namespace media {
class HttpFetcher; class HttpFetcher;
class RequestSigner; class RequestSigner;
@ -116,5 +117,6 @@ class WidevineKeySource : public KeySource {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_WIDEVINE_KEY_SOURCE_H_ #endif // MEDIA_BASE_WIDEVINE_KEY_SOURCE_H_

View File

@ -112,6 +112,7 @@ using ::testing::InSequence;
using ::testing::Return; using ::testing::Return;
using ::testing::SetArgPointee; using ::testing::SetArgPointee;
namespace edash_packager {
namespace media { namespace media {
class MockRequestSigner : public RequestSigner { class MockRequestSigner : public RequestSigner {
@ -457,3 +458,4 @@ TEST_F(WidevineKeySourceTest, KeyRotationTest) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -15,18 +15,15 @@
#include "mpd/base/media_info.pb.h" #include "mpd/base/media_info.pb.h"
#include "mpd/base/mpd_notifier.h" #include "mpd/base/mpd_notifier.h"
using dash_packager::MediaInfo; namespace edash_packager {
namespace media { namespace media {
namespace event { namespace event {
MpdNotifyMuxerListener::MpdNotifyMuxerListener( MpdNotifyMuxerListener::MpdNotifyMuxerListener(MpdNotifier* mpd_notifier)
dash_packager::MpdNotifier* mpd_notifier) : mpd_notifier_(mpd_notifier), notification_id_(0) {
: mpd_notifier_(mpd_notifier),
notification_id_(0) {
DCHECK(mpd_notifier); DCHECK(mpd_notifier);
DCHECK(mpd_notifier->dash_profile() == dash_packager::kOnDemandProfile || DCHECK(mpd_notifier->dash_profile() == kOnDemandProfile ||
mpd_notifier->dash_profile() == dash_packager::kLiveProfile); mpd_notifier->dash_profile() == kLiveProfile);
} }
MpdNotifyMuxerListener::~MpdNotifyMuxerListener() {} MpdNotifyMuxerListener::~MpdNotifyMuxerListener() {}
@ -60,7 +57,7 @@ void MpdNotifyMuxerListener::OnMediaStart(
} }
} }
if (mpd_notifier_->dash_profile() == dash_packager::kLiveProfile) { if (mpd_notifier_->dash_profile() == kLiveProfile) {
// TODO(kqyang): Check return result. // TODO(kqyang): Check return result.
mpd_notifier_->NotifyNewContainer(*media_info, &notification_id_); mpd_notifier_->NotifyNewContainer(*media_info, &notification_id_);
} else { } else {
@ -76,8 +73,7 @@ void MpdNotifyMuxerListener::OnMediaEnd(bool has_init_range,
uint64 index_range_end, uint64 index_range_end,
float duration_seconds, float duration_seconds,
uint64 file_size) { uint64 file_size) {
if (mpd_notifier_->dash_profile() == dash_packager::kLiveProfile) if (mpd_notifier_->dash_profile() == kLiveProfile) return;
return;
DCHECK(media_info_); DCHECK(media_info_);
if (!internal::SetVodInformation(has_init_range, if (!internal::SetVodInformation(has_init_range,
@ -101,8 +97,7 @@ void MpdNotifyMuxerListener::OnMediaEnd(bool has_init_range,
void MpdNotifyMuxerListener::OnNewSegment(uint64 start_time, void MpdNotifyMuxerListener::OnNewSegment(uint64 start_time,
uint64 duration, uint64 duration,
uint64 segment_file_size) { uint64 segment_file_size) {
if (mpd_notifier_->dash_profile() != dash_packager::kLiveProfile) if (mpd_notifier_->dash_profile() != kLiveProfile) return;
return;
// TODO(kqyang): Check return result. // TODO(kqyang): Check return result.
mpd_notifier_->NotifyNewSegment( mpd_notifier_->NotifyNewSegment(
notification_id_, start_time, duration, segment_file_size); notification_id_, start_time, duration, segment_file_size);
@ -110,3 +105,4 @@ void MpdNotifyMuxerListener::OnNewSegment(uint64 start_time,
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -16,10 +16,10 @@
#include "media/base/muxer_options.h" #include "media/base/muxer_options.h"
#include "media/event/muxer_listener.h" #include "media/event/muxer_listener.h"
namespace dash_packager { namespace edash_packager {
class MediaInfo; class MediaInfo;
class MpdNotifier; class MpdNotifier;
} // namespace dash_packager
namespace media { namespace media {
namespace event { namespace event {
@ -28,7 +28,7 @@ class MpdNotifyMuxerListener : public MuxerListener {
public: public:
/// @param mpd_notifier must be initialized, i.e mpd_notifier->Init() must be /// @param mpd_notifier must be initialized, i.e mpd_notifier->Init() must be
/// called. /// called.
MpdNotifyMuxerListener(dash_packager::MpdNotifier* mpd_notifier); MpdNotifyMuxerListener(MpdNotifier* mpd_notifier);
virtual ~MpdNotifyMuxerListener(); virtual ~MpdNotifyMuxerListener();
/// If the stream is encrypted use this as 'schemeIdUri' attribute for /// If the stream is encrypted use this as 'schemeIdUri' attribute for
@ -58,9 +58,9 @@ class MpdNotifyMuxerListener : public MuxerListener {
/// @} /// @}
private: private:
dash_packager::MpdNotifier* const mpd_notifier_; MpdNotifier* const mpd_notifier_;
uint32 notification_id_; uint32 notification_id_;
scoped_ptr<dash_packager::MediaInfo> media_info_; scoped_ptr<MediaInfo> media_info_;
std::string scheme_id_uri_; std::string scheme_id_uri_;
DISALLOW_COPY_AND_ASSIGN(MpdNotifyMuxerListener); DISALLOW_COPY_AND_ASSIGN(MpdNotifyMuxerListener);
@ -68,5 +68,6 @@ class MpdNotifyMuxerListener : public MuxerListener {
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_EVENT_MPD_NOTIFY_MUXER_LISTENER_H_ #endif // MEDIA_EVENT_MPD_NOTIFY_MUXER_LISTENER_H_

View File

@ -13,6 +13,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
class StreamInfo; class StreamInfo;
@ -75,5 +76,6 @@ class MuxerListener {
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_EVENT_MUXER_LISTENER_H_ #endif // MEDIA_EVENT_MUXER_LISTENER_H_

View File

@ -14,15 +14,11 @@
#include "media/base/video_stream_info.h" #include "media/base/video_stream_info.h"
#include "mpd/base/media_info.pb.h" #include "mpd/base/media_info.pb.h"
namespace edash_packager {
namespace media { namespace media {
namespace event { namespace event {
namespace internal { namespace internal {
using dash_packager::MediaInfo;
using dash_packager::MediaInfo_AudioInfo;
using dash_packager::MediaInfo_VideoInfo;
using dash_packager::Range;
namespace { namespace {
// This will return a positive value, given that |file_size| and // This will return a positive value, given that |file_size| and
@ -248,3 +244,4 @@ bool AddContentProtectionElements(MuxerListener::ContainerType container_type,
} // namespace internal } // namespace internal
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,9 +13,9 @@
#include "base/basictypes.h" #include "base/basictypes.h"
#include "media/event/muxer_listener.h" #include "media/event/muxer_listener.h"
namespace dash_packager { namespace edash_packager {
class MediaInfo; class MediaInfo;
} // namespace dash_packager
namespace media { namespace media {
@ -31,7 +31,7 @@ bool GenerateMediaInfo(const MuxerOptions& muxer_options,
const std::vector<StreamInfo*>& stream_infos, const std::vector<StreamInfo*>& stream_infos,
uint32 reference_time_scale_, uint32 reference_time_scale_,
MuxerListener::ContainerType container_type, MuxerListener::ContainerType container_type,
dash_packager::MediaInfo* media_info); MediaInfo* media_info);
/// @param[in,out] media_info points to the MediaInfo object to be filled. /// @param[in,out] media_info points to the MediaInfo object to be filled.
/// @return true on success, false otherwise. /// @return true on success, false otherwise.
@ -43,7 +43,7 @@ bool SetVodInformation(bool has_init_range,
uint64 index_range_end, uint64 index_range_end,
float duration_seconds, float duration_seconds,
uint64 file_size, uint64 file_size,
dash_packager::MediaInfo* media_info); MediaInfo* media_info);
/// @param container_type specifies container type. A default ContentProtection /// @param container_type specifies container type. A default ContentProtection
/// element will be added if the container is MP4. /// element will be added if the container is MP4.
@ -52,9 +52,10 @@ bool SetVodInformation(bool has_init_range,
/// @return true if a ContentProtectionXml is added, false otherwise. /// @return true if a ContentProtectionXml is added, false otherwise.
bool AddContentProtectionElements(MuxerListener::ContainerType container_type, bool AddContentProtectionElements(MuxerListener::ContainerType container_type,
const std::string& user_scheme_id_uri, const std::string& user_scheme_id_uri,
dash_packager::MediaInfo* media_info); MediaInfo* media_info);
} // namespace internal } // namespace internal
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_ #endif // MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_

View File

@ -15,11 +15,10 @@
#include "media/file/file.h" #include "media/file/file.h"
#include "mpd/base/media_info.pb.h" #include "mpd/base/media_info.pb.h"
namespace edash_packager {
namespace media { namespace media {
namespace event { namespace event {
using dash_packager::MediaInfo;
VodMediaInfoDumpMuxerListener::VodMediaInfoDumpMuxerListener( VodMediaInfoDumpMuxerListener::VodMediaInfoDumpMuxerListener(
const std::string& output_file_name) const std::string& output_file_name)
: output_file_name_(output_file_name) {} : output_file_name_(output_file_name) {}
@ -114,3 +113,4 @@ bool VodMediaInfoDumpMuxerListener::SerializeMediaInfoToFile() {
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -19,9 +19,9 @@
#include "media/base/muxer_options.h" #include "media/base/muxer_options.h"
#include "media/event/muxer_listener.h" #include "media/event/muxer_listener.h"
namespace dash_packager { namespace edash_packager {
class MediaInfo; class MediaInfo;
} // namespace dash_packager
namespace media { namespace media {
namespace event { namespace event {
@ -63,12 +63,13 @@ class VodMediaInfoDumpMuxerListener : public MuxerListener {
std::string output_file_name_; std::string output_file_name_;
std::string scheme_id_uri_; std::string scheme_id_uri_;
scoped_ptr<dash_packager::MediaInfo> media_info_; scoped_ptr<MediaInfo> media_info_;
DISALLOW_COPY_AND_ASSIGN(VodMediaInfoDumpMuxerListener); DISALLOW_COPY_AND_ASSIGN(VodMediaInfoDumpMuxerListener);
}; };
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_EVENT_VOD_MEDIA_INFO_DUMP_MUXER_LISTENER_H_ #endif // MEDIA_EVENT_VOD_MEDIA_INFO_DUMP_MUXER_LISTENER_H_

View File

@ -18,12 +18,11 @@
#include "media/base/video_stream_info.h" #include "media/base/video_stream_info.h"
#include "mpd/base/media_info.pb.h" #include "mpd/base/media_info.pb.h"
using dash_packager::MediaInfo;
namespace { namespace {
const bool kEnableEncryption = true; const bool kEnableEncryption = true;
} // namespace } // namespace
namespace edash_packager {
namespace media { namespace media {
namespace event { namespace event {
@ -288,3 +287,4 @@ TEST_F(VodMediaInfoDumpMuxerListenerTest, EncryptedStream_Normal) {
} // namespace event } // namespace event
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -12,6 +12,7 @@
#include "media/file/udp_file.h" #include "media/file/udp_file.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
namespace edash_packager {
namespace media { namespace media {
const char* kLocalFilePrefix = "file://"; const char* kLocalFilePrefix = "file://";
@ -93,3 +94,4 @@ bool File::ReadFileToString(const char* file_name, std::string* contents) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -11,6 +11,7 @@
#include "base/basictypes.h" #include "base/basictypes.h"
namespace edash_packager {
namespace media { namespace media {
extern const char* kLocalFilePrefix; extern const char* kLocalFilePrefix;
@ -97,5 +98,6 @@ class File {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // PACKAGER_FILE_FILE_H_ #endif // PACKAGER_FILE_FILE_H_

View File

@ -10,6 +10,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "media/file/file.h" #include "media/file/file.h"
namespace edash_packager {
namespace media { namespace media {
/// Used by scoped_ptr to automatically close the file when it goes out of /// Used by scoped_ptr to automatically close the file when it goes out of
@ -24,5 +25,6 @@ struct FileCloser {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // MEDIA_FILE_FILE_CLOSER_H_ #endif // MEDIA_FILE_FILE_CLOSER_H_

View File

@ -14,6 +14,7 @@ const int kDataSize = 1024;
const char* kTestLocalFileName = "/tmp/local_file_test"; const char* kTestLocalFileName = "/tmp/local_file_test";
} }
namespace edash_packager {
namespace media { namespace media {
class LocalFileTest : public testing::Test { class LocalFileTest : public testing::Test {
@ -118,3 +119,4 @@ TEST_F(LocalFileTest, WriteRead) {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -9,6 +9,7 @@
#include "base/file_util.h" #include "base/file_util.h"
#include "base/logging.h" #include "base/logging.h"
namespace edash_packager {
namespace media { namespace media {
LocalFile::LocalFile(const char* file_name, const char* mode) LocalFile::LocalFile(const char* file_name, const char* mode)
@ -72,3 +73,4 @@ bool LocalFile::Open() {
} }
} // namespace media } // namespace media
} // namespace edash_packager

View File

@ -13,6 +13,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "media/file/file.h" #include "media/file/file.h"
namespace edash_packager {
namespace media { namespace media {
/// Implement LocalFile which deals with local storage. /// Implement LocalFile which deals with local storage.
@ -46,6 +47,7 @@ class LocalFile : public File {
}; };
} // namespace media } // namespace media
} // namespace edash_packager
#endif // PACKAGER_FILE_LOCAL_FILE_H_ #endif // PACKAGER_FILE_LOCAL_FILE_H_

Some files were not shown because too many files have changed in this diff Show More