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"
namespace edash_packager {
namespace media {
LibcryptoThreading::LibcryptoThreading() {}
@ -19,3 +20,4 @@ bool LibcryptoThreading::Initialize() {
}
} // namespace media
} // namespace edash_packager

View File

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

View File

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

View File

@ -58,7 +58,7 @@ ExitStatus RunMpdGenerator() {
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)
mpd_writer.AddBaseUrl(*it);

View File

@ -51,14 +51,9 @@ const char kUsage[] =
"If not specified, its value may be estimated.\n";
} // namespace
namespace edash_packager {
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::MuxerListener;
using event::VodMediaInfoDumpMuxerListener;
@ -287,6 +282,7 @@ bool RunPackager(const StreamDescriptorList& stream_descriptors) {
}
} // namespace media
} // namespace edash_packager
int main(int argc, char** argv) {
google::SetUsageMessage(base::StringPrintf(kUsage, argv[0]));
@ -295,17 +291,17 @@ int main(int argc, char** argv) {
google::ShowUsageWithFlags(argv[0]);
return 1;
}
media::LibcryptoThreading libcrypto_threading;
edash_packager::media::LibcryptoThreading libcrypto_threading;
if (!libcrypto_threading.Initialize()) {
LOG(ERROR) << "Could not initialize libcrypto threading.";
return 1;
}
// TODO(tinskip): Make InsertStreamDescriptor a member of
// StreamDescriptorList.
media::StreamDescriptorList stream_descriptors;
edash_packager::media::StreamDescriptorList stream_descriptors;
for (int i = 1; i < argc; ++i) {
if (!InsertStreamDescriptor(argv[i], &stream_descriptors))
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.");
using dash_packager::MpdOptions;
namespace edash_packager {
namespace media {
void DumpStreamInfo(const std::vector<MediaStream*>& streams) {
@ -203,3 +202,4 @@ bool AddStreamToMuxer(const std::vector<MediaStream*>& streams,
}
} // namespace media
} // namespace edash_packager

View File

@ -17,9 +17,9 @@
DECLARE_bool(dump_stream_info);
namespace dash_packager {
namespace edash_packager {
struct MpdOptions;
}
namespace media {
@ -51,7 +51,7 @@ bool AssignFlagsFromProfile();
bool GetMuxerOptions(MuxerOptions* muxer_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.
/// @param streams contains the set of MediaStreams from which to select.
@ -65,5 +65,6 @@ bool AddStreamToMuxer(const std::vector<MediaStream*>& streams,
Muxer* muxer);
} // namespace media
} // namespace edash_packager
#endif // APP_PACKAGER_UTIL_H_

View File

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

View File

@ -12,6 +12,7 @@
#include "base/basictypes.h"
namespace edash_packager {
namespace media {
/// 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);
} // namespace media
} // namespace edash_packager
#endif // APP_STREAM_DESCRIPTOR_H_

View File

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

View File

@ -18,6 +18,7 @@
struct aes_key_st;
typedef struct aes_key_st AES_KEY;
namespace edash_packager {
namespace media {
class AesCtrEncryptor {
@ -168,5 +169,6 @@ class AesCbcDecryptor {
};
} // namespace media
} // namespace edash_packager
#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 edash_packager {
namespace media {
class AesCtrEncryptorTest : public testing::Test {
@ -440,3 +441,4 @@ TEST_F(AesCbcEncryptorTest, CipherTextNotMultipleOfBlockSize) {
}
} // namespace media
} // namespace edash_packager

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,6 +12,7 @@
#include "base/stl_util.h"
#include "media/base/status.h"
namespace edash_packager {
namespace media {
class File;
@ -74,5 +75,6 @@ class BufferWriter {
};
} // namespace media
} // namespace edash_packager
#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};
} // namespace
namespace edash_packager {
namespace media {
class BufferWriterTest : public testing::Test {
@ -187,3 +188,4 @@ TEST_F(BufferWriterTest, WriteToFile) {
}
} // namespace media
} // namespace edash_packager

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,6 +7,7 @@
#include "base/basictypes.h"
namespace edash_packager {
namespace media {
/// 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);
} // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_CONTAINER_NAMES_H_

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,6 +9,7 @@
#ifndef MEDIA_BASE_FAKE_PRNG_H
#define MEDIA_BASE_FAKE_PRNG_H
namespace edash_packager {
namespace media {
namespace fake_prng {
@ -21,5 +22,6 @@ void StopFakePrng();
} // namespace fake_prng
} // namespace media
} // namespace edash_packager
#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 edash_packager {
namespace media {
HttpFetcher::HttpFetcher() {}
@ -110,3 +111,4 @@ Status SimpleHttpFetcher::FetchInternal(HttpMethod method,
}
} // namespace media
} // namespace edash_packager

View File

@ -10,6 +10,7 @@
#include "base/compiler_specific.h"
#include "media/base/status.h"
namespace edash_packager {
namespace media {
/// Defines a generic http fetcher interface.
@ -77,6 +78,7 @@ class SimpleHttpFetcher : public HttpFetcher {
};
} // namespace media
} // namespace edash_packager
#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.
} // namespace
namespace edash_packager {
namespace media {
static void CheckHttpGet(const std::string& url,
@ -85,4 +86,5 @@ TEST(DISABLED_HttpFetcherTest, BigTimeout) {
}
} // namespace media
} // namespace edash_packager

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,6 +11,7 @@
#include "base/logging.h"
namespace edash_packager {
namespace media {
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))
} // namespace media
} // namespace edash_packager
#endif // MEDIA_BASE_STATUS_H_

View File

@ -11,7 +11,13 @@
#include "media/base/status.h"
#define EXPECT_OK(val) EXPECT_EQ(media::Status::OK, (val))
#define ASSERT_OK(val) ASSERT_EQ(media::Status::OK, (val))
namespace edash_packager {
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_

View File

@ -8,21 +8,26 @@
#include "media/base/status_test_util.h"
namespace edash_packager {
namespace media {
TEST(StatusTestUtil, ExpectOkSuccess) {
EXPECT_OK(media::Status::OK);
EXPECT_OK(Status::OK);
}
TEST(StatusTestUtil, AssertOkSuccess) {
ASSERT_OK(media::Status::OK);
ASSERT_OK(Status::OK);
}
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");
}
TEST(StatusTestUtil, AssertOkFailure) {
EXPECT_FATAL_FAILURE(
ASSERT_OK(media::Status(media::error::UNKNOWN, "Status Unknown")),
"Status Unknown");
EXPECT_FATAL_FAILURE(ASSERT_OK(Status(error::UNKNOWN, "Status Unknown")),
"Status Unknown");
}
} // namespace media
} // namespace edash_packager

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,9 +13,9 @@
#include "base/basictypes.h"
#include "media/event/muxer_listener.h"
namespace dash_packager {
namespace edash_packager {
class MediaInfo;
} // namespace dash_packager
namespace media {
@ -31,7 +31,7 @@ bool GenerateMediaInfo(const MuxerOptions& muxer_options,
const std::vector<StreamInfo*>& stream_infos,
uint32 reference_time_scale_,
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.
/// @return true on success, false otherwise.
@ -43,7 +43,7 @@ bool SetVodInformation(bool has_init_range,
uint64 index_range_end,
float duration_seconds,
uint64 file_size,
dash_packager::MediaInfo* media_info);
MediaInfo* media_info);
/// @param container_type specifies container type. A default ContentProtection
/// 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.
bool AddContentProtectionElements(MuxerListener::ContainerType container_type,
const std::string& user_scheme_id_uri,
dash_packager::MediaInfo* media_info);
MediaInfo* media_info);
} // namespace internal
} // namespace event
} // namespace media
} // namespace edash_packager
#endif // MEDIA_EVENT_MUXER_LISTENER_INTERNAL_H_

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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