9 #ifndef MEDIA_BASE_MUXER_H_
10 #define MEDIA_BASE_MUXER_H_
15 #include "packager/base/time/clock.h"
16 #include "packager/media/base/media_handler.h"
17 #include "packager/media/base/muxer_options.h"
18 #include "packager/media/event/muxer_listener.h"
19 #include "packager/media/event/progress_listener.h"
20 #include "packager/status.h"
47 const std::vector<std::shared_ptr<const StreamInfo>>& streams()
const {
65 Status Process(std::unique_ptr<StreamData> stream_data)
override;
70 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
71 ProgressListener* progress_listener() {
return progress_listener_.get(); }
72 base::Clock* clock() {
return clock_; }
76 virtual Status InitializeMuxer() = 0;
79 virtual Status Finalize() = 0;
82 virtual Status AddSample(
84 const MediaSample& sample) = 0;
87 virtual Status FinalizeSegment(
89 const SegmentInfo& segment_info) = 0;
91 MuxerOptions options_;
92 std::vector<std::shared_ptr<const StreamInfo>> streams_;
93 std::vector<uint8_t> current_key_id_;
94 bool encryption_started_ =
false;
97 std::unique_ptr<MuxerListener> muxer_listener_;
98 std::unique_ptr<ProgressListener> progress_listener_;
102 DISALLOW_COPY_AND_ASSIGN(Muxer);
108 #endif // MEDIA_BASE_MUXER_H_