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<std::unique_ptr<MediaStream>>&
streams() {
78 QueuedSample(uint32_t track_id, scoped_refptr<MediaSample> sample);
82 scoped_refptr<MediaSample> sample;
86 void ParserInitEvent(
const std::vector<scoped_refptr<StreamInfo> >&
streams);
90 bool NewSampleEvent(uint32_t track_id,
91 const scoped_refptr<MediaSample>& sample);
93 bool PushSample(uint32_t track_id,
const scoped_refptr<MediaSample>& sample);
95 std::string file_name_;
97 bool init_event_received_;
98 Status init_parsing_status_;
100 std::deque<QueuedSample> queued_samples_;
101 std::unique_ptr<MediaParser> parser_;
102 std::vector<std::unique_ptr<MediaStream>> streams_;
103 MediaContainerName container_name_;
104 std::unique_ptr<uint8_t[]> buffer_;
105 std::unique_ptr<KeySource> key_source_;
108 DISALLOW_COPY_AND_ASSIGN(
Demuxer);
114 #endif // MEDIA_BASE_DEMUXER_H_