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/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"
22 namespace edash_packager {
48 uint32_t max_sd_pixels,
49 double clear_lead_in_seconds,
50 double crypto_period_duration_in_seconds);
70 const std::vector<MediaStream*>& streams()
const {
return streams_; }
84 KeySource* encryption_key_source() {
85 return encryption_key_source_;
87 uint32_t max_sd_pixels()
const {
return max_sd_pixels_; }
88 double clear_lead_in_seconds()
const {
return clear_lead_in_seconds_; }
89 double crypto_period_duration_in_seconds()
const {
90 return crypto_period_duration_in_seconds_;
92 MuxerListener* muxer_listener() {
return muxer_listener_.get(); }
93 ProgressListener* progress_listener() {
return progress_listener_.get(); }
94 base::Clock* clock() {
return clock_; }
97 friend class MediaStream;
100 Status AddSample(
const MediaStream* stream,
101 scoped_refptr<MediaSample> sample);
104 virtual Status Initialize() = 0;
107 virtual Status Finalize() = 0;
110 virtual Status DoAddSample(
const MediaStream* stream,
111 scoped_refptr<MediaSample> sample) = 0;
113 MuxerOptions options_;
115 std::vector<MediaStream*> streams_;
116 KeySource* encryption_key_source_;
117 uint32_t max_sd_pixels_;
118 double clear_lead_in_seconds_;
119 double crypto_period_duration_in_seconds_;
122 scoped_ptr<MuxerListener> muxer_listener_;
123 scoped_ptr<ProgressListener> progress_listener_;
127 DISALLOW_COPY_AND_ASSIGN(Muxer);
133 #endif // MEDIA_BASE_MUXER_H_