7 #ifndef MEDIA_BASE_DEMUXER_H_
8 #define MEDIA_BASE_DEMUXER_H_
14 #include "packager/base/compiler_specific.h"
15 #include "packager/media/base/container_names.h"
16 #include "packager/media/base/status.h"
36 explicit Demuxer(
const std::string& file_name);
43 void SetKeySource(std::unique_ptr<KeySource> key_source);
67 const std::vector<std::unique_ptr<MediaStream>>&
streams() {
80 QueuedSample(uint32_t track_id, std::shared_ptr<MediaSample> sample);
84 std::shared_ptr<MediaSample> sample;
88 void ParserInitEvent(
const std::vector<std::shared_ptr<StreamInfo>>&
streams);
92 bool NewSampleEvent(uint32_t track_id,
93 const std::shared_ptr<MediaSample>& sample);
95 bool PushSample(uint32_t track_id,
96 const std::shared_ptr<MediaSample>& sample);
98 std::string file_name_;
100 bool init_event_received_;
101 Status init_parsing_status_;
103 std::deque<QueuedSample> queued_samples_;
104 std::unique_ptr<MediaParser> parser_;
105 std::vector<std::unique_ptr<MediaStream>> streams_;
106 MediaContainerName container_name_;
107 std::unique_ptr<uint8_t[]> buffer_;
108 std::unique_ptr<KeySource> key_source_;
115 #endif // MEDIA_BASE_DEMUXER_H_