9 #ifndef MEDIA_BASE_MUXER_H_
10 #define MEDIA_BASE_MUXER_H_
14 #include "packager/base/memory/ref_counted.h"
15 #include "packager/base/memory/scoped_ptr.h"
16 #include "packager/base/time/clock.h"
17 #include "packager/media/base/fourccs.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"
51 uint32_t max_sd_pixels,
52 double clear_lead_in_seconds,
53 double crypto_period_duration_in_seconds,
54 FourCC protection_scheme);
74 const std::vector<MediaStream*>& streams()
const {
return streams_; }
88 KeySource* encryption_key_source() {
89 return encryption_key_source_;
91 uint32_t max_sd_pixels()
const {
return max_sd_pixels_; }
92 double clear_lead_in_seconds()
const {
return clear_lead_in_seconds_; }
93 double crypto_period_duration_in_seconds()
const {
94 return crypto_period_duration_in_seconds_;
96 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
97 ProgressListener* progress_listener() {
return progress_listener_.get(); }
98 base::Clock* clock() {
return clock_; }
99 FourCC protection_scheme()
const {
return protection_scheme_; }
102 friend class MediaStream;
105 Status AddSample(
const MediaStream* stream,
106 scoped_refptr<MediaSample> sample);
109 virtual Status Initialize() = 0;
112 virtual Status Finalize() = 0;
115 virtual Status DoAddSample(
const MediaStream* stream,
116 scoped_refptr<MediaSample> sample) = 0;
118 MuxerOptions options_;
120 std::vector<MediaStream*> streams_;
121 KeySource* encryption_key_source_;
122 uint32_t max_sd_pixels_;
123 double clear_lead_in_seconds_;
124 double crypto_period_duration_in_seconds_;
125 FourCC protection_scheme_;
128 scoped_ptr<MuxerListener> muxer_listener_;
129 scoped_ptr<ProgressListener> progress_listener_;
133 DISALLOW_COPY_AND_ASSIGN(Muxer);
139 #endif // MEDIA_BASE_MUXER_H_