7 #ifndef PACKAGER_MEDIA_FORMATS_MP2T_TS_MUXER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP2T_TS_MUXER_H_
10 #include <packager/macros/classes.h>
11 #include <packager/media/base/muxer.h>
12 #include <packager/media/formats/mp2t/ts_segmenter.h>
27 Status InitializeMuxer()
override;
28 Status Finalize()
override;
29 Status AddMediaSample(
size_t stream_id,
const MediaSample& sample)
override;
30 Status FinalizeSegment(
size_t stream_id,
33 Status WriteSegment(
const std::string& segment_path,
35 Status CloseFile(std::unique_ptr<File, FileCloser> file);
37 void FireOnMediaStartEvent();
38 void FireOnMediaEndEvent();
40 std::unique_ptr<TsSegmenter> segmenter_;
41 int64_t sample_durations_[2] = {0, 0};
42 size_t num_samples_ = 0;
45 std::unique_ptr<File, FileCloser> output_file_;
50 uint64_t total_duration_ = 0;
52 DISALLOW_COPY_AND_ASSIGN(
TsMuxer);
All the methods that are virtual are virtual for mocking.