7 #include "packager/app/muxer_factory.h" 9 #include "packager/base/time/clock.h" 10 #include "packager/media/base/muxer.h" 11 #include "packager/media/base/muxer_options.h" 12 #include "packager/media/formats/mp2t/ts_muxer.h" 13 #include "packager/media/formats/mp4/mp4_muxer.h" 14 #include "packager/media/formats/packed_audio/packed_audio_writer.h" 15 #include "packager/media/formats/webm/webm_muxer.h" 16 #include "packager/packager.h" 21 MuxerFactory::MuxerFactory(
const PackagingParams& packaging_params)
22 : mp4_params_(packaging_params.mp4_output_params),
23 temp_dir_(packaging_params.temp_dir) {}
26 MediaContainerName output_format,
35 std::shared_ptr<Muxer> muxer;
37 switch (output_format) {
41 muxer = std::make_shared<PackedAudioWriter>(options);
44 muxer = std::make_shared<webm::WebMMuxer>(options);
46 case CONTAINER_MPEG2TS:
47 muxer = std::make_shared<mp2t::TsMuxer>(options);
50 muxer = std::make_shared<mp4::MP4Muxer>(options);
53 LOG(ERROR) <<
"Cannot support muxing to " << output_format;
64 muxer->set_clock(clock_);
Defines a single input/output stream.
std::string segment_template
Specifies segment template. Can be empty.
All the methods that are virtual are virtual for mocking.