Rename shaka::ShakaPackager to shaka::Packager

Change-Id: I493d3a6cf4c27615d1515de7c43dc3c5b8e3224e
This commit is contained in:
KongQun Yang 2017-06-13 15:16:08 -07:00
parent 26d39db0e7
commit 096c22ee63
4 changed files with 20 additions and 20 deletions

View File

@ -308,7 +308,7 @@ int PackagerMain(int argc, char** argv) {
log_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; log_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
CHECK(logging::InitLogging(log_settings)); CHECK(logging::InitLogging(log_settings));
google::SetVersionString(shaka::ShakaPackager::GetLibraryVersion()); google::SetVersionString(shaka::Packager::GetLibraryVersion());
google::SetUsageMessage(base::StringPrintf(kUsage, argv[0])); google::SetUsageMessage(base::StringPrintf(kUsage, argv[0]));
google::ParseCommandLineFlags(&argc, &argv, true); google::ParseCommandLineFlags(&argc, &argv, true);
if (argc < 2) { if (argc < 2) {
@ -333,7 +333,7 @@ int PackagerMain(int argc, char** argv) {
return kArgumentValidationFailed; return kArgumentValidationFailed;
stream_descriptors.push_back(stream_descriptor.value()); stream_descriptors.push_back(stream_descriptor.value());
} }
ShakaPackager packager; Packager packager;
media::Status status = media::Status status =
packager.Initialize(packaging_params.value(), stream_descriptors); packager.Initialize(packaging_params.value(), stream_descriptors);
if (!status.ok()) { if (!status.ok()) {

View File

@ -557,7 +557,7 @@ std::string EncryptionParams::DefaultStreamLabelFunction(
return ""; return "";
} }
struct ShakaPackager::PackagerInternal { struct Packager::PackagerInternal {
media::FakeClock fake_clock; media::FakeClock fake_clock;
std::unique_ptr<KeySource> encryption_key_source; std::unique_ptr<KeySource> encryption_key_source;
std::unique_ptr<MpdNotifier> mpd_notifier; std::unique_ptr<MpdNotifier> mpd_notifier;
@ -565,11 +565,11 @@ struct ShakaPackager::PackagerInternal {
std::vector<std::unique_ptr<media::RemuxJob>> remux_jobs; std::vector<std::unique_ptr<media::RemuxJob>> remux_jobs;
}; };
ShakaPackager::ShakaPackager() {} Packager::Packager() {}
ShakaPackager::~ShakaPackager() {} Packager::~Packager() {}
Status ShakaPackager::Initialize( Status Packager::Initialize(
const PackagingParams& packaging_params, const PackagingParams& packaging_params,
const std::vector<StreamDescriptor>& stream_descriptors) { const std::vector<StreamDescriptor>& stream_descriptors) {
// Needed by base::WorkedPool used in ThreadedIoFile. // Needed by base::WorkedPool used in ThreadedIoFile.
@ -654,7 +654,7 @@ Status ShakaPackager::Initialize(
return Status::OK; return Status::OK;
} }
Status ShakaPackager::Run() { Status Packager::Run() {
if (!internal_) if (!internal_)
return Status(error::INVALID_ARGUMENT, "Not yet initialized."); return Status(error::INVALID_ARGUMENT, "Not yet initialized.");
Status status = media::RunRemuxJobs(internal_->remux_jobs); Status status = media::RunRemuxJobs(internal_->remux_jobs);
@ -672,7 +672,7 @@ Status ShakaPackager::Run() {
return Status::OK; return Status::OK;
} }
void ShakaPackager::Cancel() { void Packager::Cancel() {
if (!internal_) { if (!internal_) {
LOG(INFO) << "Not yet initialized. Return directly."; LOG(INFO) << "Not yet initialized. Return directly.";
return; return;
@ -681,7 +681,7 @@ void ShakaPackager::Cancel() {
job->demuxer()->Cancel(); job->demuxer()->Cancel();
} }
std::string ShakaPackager::GetLibraryVersion() { std::string Packager::GetLibraryVersion() {
return GetPackagerVersion(); return GetPackagerVersion();
} }

View File

@ -432,10 +432,10 @@ struct StreamDescriptor {
std::string hls_playlist_name; std::string hls_playlist_name;
}; };
class SHAKA_EXPORT ShakaPackager { class SHAKA_EXPORT Packager {
public: public:
ShakaPackager(); Packager();
~ShakaPackager(); ~Packager();
/// Initialize packaging pipeline. /// Initialize packaging pipeline.
/// @param packaging_params contains the packaging parameters. /// @param packaging_params contains the packaging parameters.
@ -457,8 +457,8 @@ class SHAKA_EXPORT ShakaPackager {
static std::string GetLibraryVersion(); static std::string GetLibraryVersion();
private: private:
ShakaPackager(const ShakaPackager&) = delete; Packager(const Packager&) = delete;
ShakaPackager& operator=(const ShakaPackager&) = delete; Packager& operator=(const Packager&) = delete;
struct PackagerInternal; struct PackagerInternal;
std::unique_ptr<PackagerInternal> internal_; std::unique_ptr<PackagerInternal> internal_;

View File

@ -94,11 +94,11 @@ class PackagerTest : public ::testing::Test {
}; };
TEST_F(PackagerTest, Version) { TEST_F(PackagerTest, Version) {
EXPECT_FALSE(ShakaPackager::GetLibraryVersion().empty()); EXPECT_FALSE(Packager::GetLibraryVersion().empty());
} }
TEST_F(PackagerTest, Success) { TEST_F(PackagerTest, Success) {
ShakaPackager packager; Packager packager;
ASSERT_TRUE( ASSERT_TRUE(
packager.Initialize(SetupPackagingParams(), SetupStreamDescriptors()) packager.Initialize(SetupPackagingParams(), SetupStreamDescriptors())
.ok()); .ok());
@ -107,7 +107,7 @@ TEST_F(PackagerTest, Success) {
TEST_F(PackagerTest, MissingStreamDescriptors) { TEST_F(PackagerTest, MissingStreamDescriptors) {
std::vector<StreamDescriptor> stream_descriptors; std::vector<StreamDescriptor> stream_descriptors;
ShakaPackager packager; Packager packager;
auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors); auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors);
ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code());
} }
@ -128,7 +128,7 @@ TEST_F(PackagerTest, MixingSegmentTemplateAndSingleSegment) {
stream_descriptor.segment_template.clear(); stream_descriptor.segment_template.clear();
stream_descriptors.push_back(stream_descriptor); stream_descriptors.push_back(stream_descriptor);
ShakaPackager packager; Packager packager;
auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors); auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors);
ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code());
} }
@ -137,7 +137,7 @@ TEST_F(PackagerTest, SegmentAlignedAndSubsegmentNotAligned) {
auto packaging_params = SetupPackagingParams(); auto packaging_params = SetupPackagingParams();
packaging_params.chunking_params.segment_sap_aligned = true; packaging_params.chunking_params.segment_sap_aligned = true;
packaging_params.chunking_params.subsegment_sap_aligned = false; packaging_params.chunking_params.subsegment_sap_aligned = false;
ShakaPackager packager; Packager packager;
ASSERT_TRUE( ASSERT_TRUE(
packager.Initialize(packaging_params, SetupStreamDescriptors()).ok()); packager.Initialize(packaging_params, SetupStreamDescriptors()).ok());
ASSERT_TRUE(packager.Run().ok()); ASSERT_TRUE(packager.Run().ok());
@ -147,7 +147,7 @@ TEST_F(PackagerTest, SegmentNotAlignedButSubsegmentAligned) {
auto packaging_params = SetupPackagingParams(); auto packaging_params = SetupPackagingParams();
packaging_params.chunking_params.segment_sap_aligned = false; packaging_params.chunking_params.segment_sap_aligned = false;
packaging_params.chunking_params.subsegment_sap_aligned = true; packaging_params.chunking_params.subsegment_sap_aligned = true;
ShakaPackager packager; Packager packager;
auto status = packager.Initialize(packaging_params, SetupStreamDescriptors()); auto status = packager.Initialize(packaging_params, SetupStreamDescriptors());
ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code());
} }