Move all code inside top level namespace
Change-Id: I83bc081f523dbc5071796a79c2d89b7367ed8d27
This commit is contained in:
parent
06654da35a
commit
bbcca29013
|
@ -62,7 +62,7 @@ ExitStatus RunMpdGenerator() {
|
||||||
base::SplitString(FLAGS_base_urls, ',', &base_urls);
|
base::SplitString(FLAGS_base_urls, ',', &base_urls);
|
||||||
}
|
}
|
||||||
|
|
||||||
edash_packager::MpdWriter mpd_writer;
|
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);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,10 @@ DEFINE_bool(use_fake_clock_for_muxer,
|
||||||
"creation time and modification time in outputs are set to 0. "
|
"creation time and modification time in outputs are set to 0. "
|
||||||
"Should only be used for testing.");
|
"Should only be used for testing.");
|
||||||
|
|
||||||
|
namespace edash_packager {
|
||||||
|
namespace media {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const char kUsage[] =
|
const char kUsage[] =
|
||||||
"Packager driver program. Usage:\n\n"
|
"Packager driver program. Usage:\n\n"
|
||||||
"%s [flags] <stream_descriptor> ...\n"
|
"%s [flags] <stream_descriptor> ...\n"
|
||||||
|
@ -89,44 +92,39 @@ enum ExitStatus {
|
||||||
// CreateRemuxJobs() shouldn't treat text as a special case.
|
// CreateRemuxJobs() shouldn't treat text as a special case.
|
||||||
std::string DetermineTextFileFormat(const std::string& file) {
|
std::string DetermineTextFileFormat(const std::string& file) {
|
||||||
std::string content;
|
std::string content;
|
||||||
if (!edash_packager::media::File::ReadFileToString(file.c_str(), &content)) {
|
if (!File::ReadFileToString(file.c_str(), &content)) {
|
||||||
LOG(ERROR) << "Failed to open file " << file
|
LOG(ERROR) << "Failed to open file " << file
|
||||||
<< " to determine file format.";
|
<< " to determine file format.";
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
edash_packager::media::MediaContainerName container_name =
|
MediaContainerName container_name = DetermineContainer(
|
||||||
edash_packager::media::DetermineContainer(
|
|
||||||
reinterpret_cast<const uint8_t*>(content.data()), content.size());
|
reinterpret_cast<const uint8_t*>(content.data()), content.size());
|
||||||
if (container_name == edash_packager::media::CONTAINER_WEBVTT) {
|
if (container_name == CONTAINER_WEBVTT) {
|
||||||
return "vtt";
|
return "vtt";
|
||||||
} else if (container_name == edash_packager::media::CONTAINER_TTML) {
|
} else if (container_name == CONTAINER_TTML) {
|
||||||
return "ttml";
|
return "ttml";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
edash_packager::media::FourCC GetProtectionScheme(
|
FourCC GetProtectionScheme(const std::string& protection_scheme) {
|
||||||
const std::string& protection_scheme) {
|
|
||||||
if (protection_scheme == "cenc") {
|
if (protection_scheme == "cenc") {
|
||||||
return edash_packager::media::FOURCC_cenc;
|
return FOURCC_cenc;
|
||||||
} else if (protection_scheme == "cens") {
|
} else if (protection_scheme == "cens") {
|
||||||
return edash_packager::media::FOURCC_cens;
|
return FOURCC_cens;
|
||||||
} else if (protection_scheme == "cbc1") {
|
} else if (protection_scheme == "cbc1") {
|
||||||
return edash_packager::media::FOURCC_cbc1;
|
return FOURCC_cbc1;
|
||||||
} else if (protection_scheme == "cbcs") {
|
} else if (protection_scheme == "cbcs") {
|
||||||
return edash_packager::media::FOURCC_cbcs;
|
return FOURCC_cbcs;
|
||||||
} else {
|
} else {
|
||||||
LOG(ERROR) << "Unknown protection scheme: " << protection_scheme;
|
LOG(ERROR) << "Unknown protection scheme: " << protection_scheme;
|
||||||
return edash_packager::media::FOURCC_NULL;
|
return FOURCC_NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace edash_packager {
|
|
||||||
namespace media {
|
|
||||||
|
|
||||||
// A fake clock that always return time 0 (epoch). Should only be used for
|
// A fake clock that always return time 0 (epoch). Should only be used for
|
||||||
// testing.
|
// testing.
|
||||||
class FakeClock : public base::Clock {
|
class FakeClock : public base::Clock {
|
||||||
|
@ -473,7 +471,7 @@ int PackagerMain(int argc, char** argv) {
|
||||||
if (!ValidateWidevineCryptoFlags() || !ValidateFixedCryptoFlags())
|
if (!ValidateWidevineCryptoFlags() || !ValidateFixedCryptoFlags())
|
||||||
return kArgumentValidationFailed;
|
return kArgumentValidationFailed;
|
||||||
|
|
||||||
edash_packager::media::LibcryptoThreading libcrypto_threading;
|
LibcryptoThreading libcrypto_threading;
|
||||||
// TODO(tinskip): Make InsertStreamDescriptor a member of
|
// TODO(tinskip): Make InsertStreamDescriptor a member of
|
||||||
// StreamDescriptorList.
|
// StreamDescriptorList.
|
||||||
StreamDescriptorList stream_descriptors;
|
StreamDescriptorList stream_descriptors;
|
||||||
|
|
|
@ -50,7 +50,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(edash_packager::MpdOptions* mpd_options);
|
bool GetMpdOptions(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.
|
||||||
|
|
|
@ -101,7 +101,7 @@ void VodMediaInfoDumpMuxerListener::OnNewSegment(const std::string& file_name,
|
||||||
|
|
||||||
// static
|
// static
|
||||||
bool VodMediaInfoDumpMuxerListener::WriteMediaInfoToFile(
|
bool VodMediaInfoDumpMuxerListener::WriteMediaInfoToFile(
|
||||||
const edash_packager::MediaInfo& media_info,
|
const MediaInfo& media_info,
|
||||||
const std::string& output_file_path) {
|
const std::string& output_file_path) {
|
||||||
std::string output_string;
|
std::string output_string;
|
||||||
if (!google::protobuf::TextFormat::PrintToString(media_info,
|
if (!google::protobuf::TextFormat::PrintToString(media_info,
|
||||||
|
|
|
@ -206,8 +206,7 @@ bool File::Copy(const char* from_file_name, const char* to_file_name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoped_ptr<edash_packager::media::File, edash_packager::media::FileCloser>
|
scoped_ptr<File, FileCloser> output_file(File::Open(to_file_name, "w"));
|
||||||
output_file(edash_packager::media::File::Open(to_file_name, "w"));
|
|
||||||
if (!output_file) {
|
if (!output_file) {
|
||||||
LOG(ERROR) << "Failed to write to " << to_file_name;
|
LOG(ERROR) << "Failed to write to " << to_file_name;
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -93,4 +93,4 @@ TEST(BandwidthEstimatorTest, FirstOneBlock) {
|
||||||
EXPECT_EQ(kExptectedEstimate, be.Estimate());
|
EXPECT_EQ(kExptectedEstimate, be.Estimate());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // edash_packager
|
} // namespace edash_packager
|
||||||
|
|
|
@ -39,8 +39,7 @@ const uint32_t kDefaultAdaptationSetId = 0u;
|
||||||
const uint32_t kDefaultRepresentationId = 1u;
|
const uint32_t kDefaultRepresentationId = 1u;
|
||||||
const int kDefaultGroupId = -1;
|
const int kDefaultGroupId = -1;
|
||||||
|
|
||||||
bool ElementEqual(const edash_packager::Element& lhs,
|
bool ElementEqual(const Element& lhs, const Element& rhs) {
|
||||||
const edash_packager::Element& rhs) {
|
|
||||||
const bool all_equal_except_sublement_check =
|
const bool all_equal_except_sublement_check =
|
||||||
lhs.name == rhs.name && lhs.attributes.size() == rhs.attributes.size() &&
|
lhs.name == rhs.name && lhs.attributes.size() == rhs.attributes.size() &&
|
||||||
std::equal(lhs.attributes.begin(), lhs.attributes.end(),
|
std::equal(lhs.attributes.begin(), lhs.attributes.end(),
|
||||||
|
@ -59,9 +58,8 @@ bool ElementEqual(const edash_packager::Element& lhs,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContentProtectionElementEqual(
|
bool ContentProtectionElementEqual(const ContentProtectionElement& lhs,
|
||||||
const edash_packager::ContentProtectionElement& lhs,
|
const ContentProtectionElement& rhs) {
|
||||||
const edash_packager::ContentProtectionElement& rhs) {
|
|
||||||
const bool all_equal_except_sublement_check =
|
const bool all_equal_except_sublement_check =
|
||||||
lhs.value == rhs.value && lhs.scheme_id_uri == rhs.scheme_id_uri &&
|
lhs.value == rhs.value && lhs.scheme_id_uri == rhs.scheme_id_uri &&
|
||||||
lhs.additional_attributes.size() == rhs.additional_attributes.size() &&
|
lhs.additional_attributes.size() == rhs.additional_attributes.size() &&
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::string TextCodecString(
|
std::string TextCodecString(const MediaInfo& media_info) {
|
||||||
const edash_packager::MediaInfo& media_info) {
|
|
||||||
CHECK(media_info.has_text_info());
|
CHECK(media_info.has_text_info());
|
||||||
const std::string& format = media_info.text_info().format();
|
const std::string& format = media_info.text_info().format();
|
||||||
// DASH IOP mentions that the codec for ttml in mp4 is stpp.
|
// DASH IOP mentions that the codec for ttml in mp4 is stpp.
|
||||||
|
|
|
@ -17,16 +17,12 @@
|
||||||
#include "packager/mpd/base/media_info.pb.h"
|
#include "packager/mpd/base/media_info.pb.h"
|
||||||
#include "packager/mpd/base/segment_info.h"
|
#include "packager/mpd/base/segment_info.h"
|
||||||
|
|
||||||
using edash_packager::xml::XmlNode;
|
|
||||||
|
|
||||||
using edash_packager::MediaInfo;
|
|
||||||
typedef edash_packager::MediaInfo::AudioInfo AudioInfo;
|
|
||||||
typedef edash_packager::MediaInfo::VideoInfo VideoInfo;
|
|
||||||
typedef MediaInfo::ContentProtectionXml ContentProtectionXml;
|
|
||||||
typedef ContentProtectionXml::AttributeNameValuePair AttributeNameValuePair;
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
||||||
|
using xml::XmlNode;
|
||||||
|
typedef MediaInfo::AudioInfo AudioInfo;
|
||||||
|
typedef MediaInfo::VideoInfo VideoInfo;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const char kEC3Codec[] = "ec-3";
|
const char kEC3Codec[] = "ec-3";
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@ DEFINE_bool(generate_dash_if_iop_compliant_mpd,
|
||||||
"and does not guarantee compliance. Off by default until players "
|
"and does not guarantee compliance. Off by default until players "
|
||||||
"support IOP MPDs.");
|
"support IOP MPDs.");
|
||||||
|
|
||||||
using edash_packager::media::File;
|
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -19,12 +19,10 @@
|
||||||
#include "packager/mpd/base/mpd_options.h"
|
#include "packager/mpd/base/mpd_options.h"
|
||||||
|
|
||||||
namespace edash_packager {
|
namespace edash_packager {
|
||||||
|
|
||||||
namespace media {
|
namespace media {
|
||||||
class File;
|
class File;
|
||||||
} // namespace media
|
} // namespace media
|
||||||
} // namespace edash_packager
|
|
||||||
|
|
||||||
namespace edash_packager {
|
|
||||||
|
|
||||||
class MediaInfo;
|
class MediaInfo;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue