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/ttml/ttml_muxer.h"
16 #include "packager/media/formats/webm/webm_muxer.h"
17 #include "packager/media/formats/webvtt/webvtt_muxer.h"
18 #include "packager/packager.h"
23 MuxerFactory::MuxerFactory(
const PackagingParams& packaging_params)
24 : mp4_params_(packaging_params.mp4_output_params),
25 temp_dir_(packaging_params.temp_dir),
26 transport_stream_timestamp_offset_ms_(
27 packaging_params.transport_stream_timestamp_offset_ms) {}
30 MediaContainerName output_format,
34 options.transport_stream_timestamp_offset_ms =
35 transport_stream_timestamp_offset_ms_;
41 std::shared_ptr<Muxer> muxer;
43 switch (output_format) {
48 muxer = std::make_shared<PackedAudioWriter>(options);
51 muxer = std::make_shared<webm::WebMMuxer>(options);
54 muxer = std::make_shared<ttml::TtmlMuxer>(options);
56 case CONTAINER_WEBVTT:
57 muxer = std::make_shared<webvtt::WebVttMuxer>(options);
59 case CONTAINER_MPEG2TS:
60 muxer = std::make_shared<mp2t::TsMuxer>(options);
63 muxer = std::make_shared<mp4::MP4Muxer>(options);
66 LOG(ERROR) <<
"Cannot support muxing to " << output_format;
77 muxer->set_clock(clock_);