diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index 697fbf2f08..91b8aa0a43 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -308,7 +308,7 @@ int PackagerMain(int argc, char** argv) { log_settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; CHECK(logging::InitLogging(log_settings)); - google::SetVersionString(shaka::ShakaPackager::GetLibraryVersion()); + google::SetVersionString(shaka::Packager::GetLibraryVersion()); google::SetUsageMessage(base::StringPrintf(kUsage, argv[0])); google::ParseCommandLineFlags(&argc, &argv, true); if (argc < 2) { @@ -333,7 +333,7 @@ int PackagerMain(int argc, char** argv) { return kArgumentValidationFailed; stream_descriptors.push_back(stream_descriptor.value()); } - ShakaPackager packager; + Packager packager; media::Status status = packager.Initialize(packaging_params.value(), stream_descriptors); if (!status.ok()) { diff --git a/packager/packager.cc b/packager/packager.cc index b3a9b06084..09280e0613 100644 --- a/packager/packager.cc +++ b/packager/packager.cc @@ -557,7 +557,7 @@ std::string EncryptionParams::DefaultStreamLabelFunction( return ""; } -struct ShakaPackager::PackagerInternal { +struct Packager::PackagerInternal { media::FakeClock fake_clock; std::unique_ptr encryption_key_source; std::unique_ptr mpd_notifier; @@ -565,11 +565,11 @@ struct ShakaPackager::PackagerInternal { std::vector> remux_jobs; }; -ShakaPackager::ShakaPackager() {} +Packager::Packager() {} -ShakaPackager::~ShakaPackager() {} +Packager::~Packager() {} -Status ShakaPackager::Initialize( +Status Packager::Initialize( const PackagingParams& packaging_params, const std::vector& stream_descriptors) { // Needed by base::WorkedPool used in ThreadedIoFile. @@ -654,7 +654,7 @@ Status ShakaPackager::Initialize( return Status::OK; } -Status ShakaPackager::Run() { +Status Packager::Run() { if (!internal_) return Status(error::INVALID_ARGUMENT, "Not yet initialized."); Status status = media::RunRemuxJobs(internal_->remux_jobs); @@ -672,7 +672,7 @@ Status ShakaPackager::Run() { return Status::OK; } -void ShakaPackager::Cancel() { +void Packager::Cancel() { if (!internal_) { LOG(INFO) << "Not yet initialized. Return directly."; return; @@ -681,7 +681,7 @@ void ShakaPackager::Cancel() { job->demuxer()->Cancel(); } -std::string ShakaPackager::GetLibraryVersion() { +std::string Packager::GetLibraryVersion() { return GetPackagerVersion(); } diff --git a/packager/packager.h b/packager/packager.h index e0706b7e19..c9a78337e4 100644 --- a/packager/packager.h +++ b/packager/packager.h @@ -432,10 +432,10 @@ struct StreamDescriptor { std::string hls_playlist_name; }; -class SHAKA_EXPORT ShakaPackager { +class SHAKA_EXPORT Packager { public: - ShakaPackager(); - ~ShakaPackager(); + Packager(); + ~Packager(); /// Initialize packaging pipeline. /// @param packaging_params contains the packaging parameters. @@ -457,8 +457,8 @@ class SHAKA_EXPORT ShakaPackager { static std::string GetLibraryVersion(); private: - ShakaPackager(const ShakaPackager&) = delete; - ShakaPackager& operator=(const ShakaPackager&) = delete; + Packager(const Packager&) = delete; + Packager& operator=(const Packager&) = delete; struct PackagerInternal; std::unique_ptr internal_; diff --git a/packager/packager_test.cc b/packager/packager_test.cc index e618f45118..ac727f3331 100644 --- a/packager/packager_test.cc +++ b/packager/packager_test.cc @@ -94,11 +94,11 @@ class PackagerTest : public ::testing::Test { }; TEST_F(PackagerTest, Version) { - EXPECT_FALSE(ShakaPackager::GetLibraryVersion().empty()); + EXPECT_FALSE(Packager::GetLibraryVersion().empty()); } TEST_F(PackagerTest, Success) { - ShakaPackager packager; + Packager packager; ASSERT_TRUE( packager.Initialize(SetupPackagingParams(), SetupStreamDescriptors()) .ok()); @@ -107,7 +107,7 @@ TEST_F(PackagerTest, Success) { TEST_F(PackagerTest, MissingStreamDescriptors) { std::vector stream_descriptors; - ShakaPackager packager; + Packager packager; auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); } @@ -128,7 +128,7 @@ TEST_F(PackagerTest, MixingSegmentTemplateAndSingleSegment) { stream_descriptor.segment_template.clear(); stream_descriptors.push_back(stream_descriptor); - ShakaPackager packager; + Packager packager; auto status = packager.Initialize(SetupPackagingParams(), stream_descriptors); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); } @@ -137,7 +137,7 @@ TEST_F(PackagerTest, SegmentAlignedAndSubsegmentNotAligned) { auto packaging_params = SetupPackagingParams(); packaging_params.chunking_params.segment_sap_aligned = true; packaging_params.chunking_params.subsegment_sap_aligned = false; - ShakaPackager packager; + Packager packager; ASSERT_TRUE( packager.Initialize(packaging_params, SetupStreamDescriptors()).ok()); ASSERT_TRUE(packager.Run().ok()); @@ -147,7 +147,7 @@ TEST_F(PackagerTest, SegmentNotAlignedButSubsegmentAligned) { auto packaging_params = SetupPackagingParams(); packaging_params.chunking_params.segment_sap_aligned = false; packaging_params.chunking_params.subsegment_sap_aligned = true; - ShakaPackager packager; + Packager packager; auto status = packager.Initialize(packaging_params, SetupStreamDescriptors()); ASSERT_EQ(media::error::INVALID_ARGUMENT, status.error_code()); }