9 #ifndef MEDIA_BASE_MUXER_H_
10 #define MEDIA_BASE_MUXER_H_
15 #include "packager/base/time/clock.h"
16 #include "packager/media/base/fourccs.h"
17 #include "packager/media/base/media_handler.h"
18 #include "packager/media/base/muxer_options.h"
19 #include "packager/media/base/status.h"
20 #include "packager/media/event/muxer_listener.h"
21 #include "packager/media/event/progress_listener.h"
62 uint32_t max_sd_pixels,
63 uint32_t max_hd_pixels,
64 uint32_t max_uhd1_pixels,
65 double clear_lead_in_seconds,
66 double crypto_period_duration_in_seconds,
67 FourCC protection_scheme);
81 const std::vector<std::shared_ptr<StreamInfo>>& streams()
const {
99 Status Process(std::unique_ptr<StreamData> stream_data)
override;
103 const MuxerOptions& options()
const {
return options_; }
104 KeySource* encryption_key_source() {
105 return encryption_key_source_;
107 uint32_t max_sd_pixels()
const {
return max_sd_pixels_; }
108 uint32_t max_hd_pixels()
const {
return max_hd_pixels_; }
109 uint32_t max_uhd1_pixels()
const {
return max_uhd1_pixels_; }
110 double clear_lead_in_seconds()
const {
return clear_lead_in_seconds_; }
111 double crypto_period_duration_in_seconds()
const {
112 return crypto_period_duration_in_seconds_;
114 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
115 ProgressListener* progress_listener() {
return progress_listener_.get(); }
116 base::Clock* clock() {
return clock_; }
117 FourCC protection_scheme()
const {
return protection_scheme_; }
121 virtual Status InitializeMuxer() = 0;
124 virtual Status Finalize() = 0;
127 virtual Status DoAddSample(std::shared_ptr<MediaSample> sample) = 0;
129 MuxerOptions options_;
130 std::vector<std::shared_ptr<StreamInfo>> streams_;
131 KeySource* encryption_key_source_;
132 uint32_t max_sd_pixels_;
133 uint32_t max_hd_pixels_;
134 uint32_t max_uhd1_pixels_;
135 double clear_lead_in_seconds_;
136 double crypto_period_duration_in_seconds_;
137 FourCC protection_scheme_;
140 std::unique_ptr<MuxerListener> muxer_listener_;
141 std::unique_ptr<ProgressListener> progress_listener_;
145 DISALLOW_COPY_AND_ASSIGN(Muxer);
151 #endif // MEDIA_BASE_MUXER_H_