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/encryption_modes.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"
23 namespace edash_packager {
49 uint32_t max_sd_pixels,
50 double clear_lead_in_seconds,
51 double crypto_period_duration_in_seconds,
52 EncryptionMode encryption_mode);
72 const std::vector<MediaStream*>& streams()
const {
return streams_; }
86 KeySource* encryption_key_source() {
87 return encryption_key_source_;
89 uint32_t max_sd_pixels()
const {
return max_sd_pixels_; }
90 double clear_lead_in_seconds()
const {
return clear_lead_in_seconds_; }
91 double crypto_period_duration_in_seconds()
const {
92 return crypto_period_duration_in_seconds_;
94 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
95 ProgressListener* progress_listener() {
return progress_listener_.get(); }
96 base::Clock* clock() {
return clock_; }
97 EncryptionMode encryption_mode()
const {
return encryption_mode_; }
100 friend class MediaStream;
103 Status AddSample(
const MediaStream* stream,
104 scoped_refptr<MediaSample> sample);
107 virtual Status Initialize() = 0;
110 virtual Status Finalize() = 0;
113 virtual Status DoAddSample(
const MediaStream* stream,
114 scoped_refptr<MediaSample> sample) = 0;
116 MuxerOptions options_;
118 std::vector<MediaStream*> streams_;
119 KeySource* encryption_key_source_;
120 uint32_t max_sd_pixels_;
121 double clear_lead_in_seconds_;
122 double crypto_period_duration_in_seconds_;
123 EncryptionMode encryption_mode_;
126 scoped_ptr<MuxerListener> muxer_listener_;
127 scoped_ptr<ProgressListener> progress_listener_;
131 DISALLOW_COPY_AND_ASSIGN(Muxer);
137 #endif // MEDIA_BASE_MUXER_H_