7 #ifndef MEDIA_BASE_DEMUXER_H_
8 #define MEDIA_BASE_DEMUXER_H_
14 #include "packager/base/compiler_specific.h"
15 #include "packager/base/memory/ref_counted.h"
16 #include "packager/media/base/container_names.h"
17 #include "packager/media/base/status.h"
37 explicit Demuxer(
const std::string& file_name);
44 void SetKeySource(std::unique_ptr<KeySource> key_source);
68 const std::vector<MediaStream*>&
streams() {
return streams_; }
76 QueuedSample(uint32_t track_id, scoped_refptr<MediaSample> sample);
80 scoped_refptr<MediaSample> sample;
84 void ParserInitEvent(
const std::vector<scoped_refptr<StreamInfo> >&
streams);
88 bool NewSampleEvent(uint32_t track_id,
89 const scoped_refptr<MediaSample>& sample);
91 bool PushSample(uint32_t track_id,
const scoped_refptr<MediaSample>& sample);
93 std::string file_name_;
95 bool init_event_received_;
96 Status init_parsing_status_;
98 std::deque<QueuedSample> queued_samples_;
99 std::unique_ptr<MediaParser> parser_;
100 std::vector<MediaStream*> streams_;
101 MediaContainerName container_name_;
102 std::unique_ptr<uint8_t[]> buffer_;
103 std::unique_ptr<KeySource> key_source_;
106 DISALLOW_COPY_AND_ASSIGN(
Demuxer);
112 #endif // MEDIA_BASE_DEMUXER_H_