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/muxer_options.h"
18 #include "packager/media/base/status.h"
19 #include "packager/media/event/muxer_listener.h"
20 #include "packager/media/event/progress_listener.h"
61 uint32_t max_sd_pixels,
62 uint32_t max_hd_pixels,
63 uint32_t max_uhd1_pixels,
64 double clear_lead_in_seconds,
65 double crypto_period_duration_in_seconds,
66 FourCC protection_scheme);
86 const std::vector<MediaStream*>& streams()
const {
return streams_; }
100 KeySource* encryption_key_source() {
101 return encryption_key_source_;
103 uint32_t max_sd_pixels()
const {
return max_sd_pixels_; }
104 uint32_t max_hd_pixels()
const {
return max_hd_pixels_; }
105 uint32_t max_uhd1_pixels()
const {
return max_uhd1_pixels_; }
106 double clear_lead_in_seconds()
const {
return clear_lead_in_seconds_; }
107 double crypto_period_duration_in_seconds()
const {
108 return crypto_period_duration_in_seconds_;
110 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
111 ProgressListener* progress_listener() {
return progress_listener_.get(); }
112 base::Clock* clock() {
return clock_; }
113 FourCC protection_scheme()
const {
return protection_scheme_; }
116 friend class MediaStream;
119 Status AddSample(
const MediaStream* stream,
120 std::shared_ptr<MediaSample> sample);
123 virtual Status Initialize() = 0;
126 virtual Status Finalize() = 0;
129 virtual Status DoAddSample(
const MediaStream* stream,
130 std::shared_ptr<MediaSample> sample) = 0;
132 MuxerOptions options_;
134 std::vector<MediaStream*> streams_;
135 KeySource* encryption_key_source_;
136 uint32_t max_sd_pixels_;
137 uint32_t max_hd_pixels_;
138 uint32_t max_uhd1_pixels_;
139 double clear_lead_in_seconds_;
140 double crypto_period_duration_in_seconds_;
141 FourCC protection_scheme_;
144 std::unique_ptr<MuxerListener> muxer_listener_;
145 std::unique_ptr<ProgressListener> progress_listener_;
149 DISALLOW_COPY_AND_ASSIGN(Muxer);
155 #endif // MEDIA_BASE_MUXER_H_