| Index: media/filters/chunk_demuxer.h
|
| diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h
|
| index cd01b1ee9091eeb47079c053fbb8c04ea9a3b6e0..251713966bad32ea2a4077ddf00d85a3996aa588 100644
|
| --- a/media/filters/chunk_demuxer.h
|
| +++ b/media/filters/chunk_demuxer.h
|
| @@ -23,6 +23,46 @@ namespace media {
|
| class FFmpegURLProtocol;
|
| class SourceState;
|
|
|
| +template <class ConfigType>
|
| +class TrackInfo {
|
| + public:
|
| + TrackInfo(StreamParser::TrackId track_id, const ConfigType& config) :
|
| + track_id_(track_id),
|
| + config_(config) {
|
| + }
|
| +
|
| + StreamParser::TrackId track_id() const { return track_id_; }
|
| + const ConfigType& config() const { return config_; }
|
| +
|
| + private:
|
| + StreamParser::TrackId track_id_;
|
| + ConfigType config_;
|
| +};
|
| +
|
| +typedef TrackInfo<AudioDecoderConfig> AudioTrackInfo;
|
| +typedef TrackInfo<VideoDecoderConfig> VideoTrackInfo;
|
| +typedef TrackInfo<TextTrackConfig> TextTrackInfo;
|
| +
|
| +struct InitSegment {
|
| + static InitSegment Create(
|
| + const AudioDecoderConfig& audio_config,
|
| + const VideoDecoderConfig& video_config,
|
| + const StreamParser::TextTrackConfigMap& text_configs);
|
| +
|
| + ~InitSegment();
|
| +
|
| + bool HasTracks() const;
|
| +
|
| + const std::vector<AudioTrackInfo> audio_tracks;
|
| + const std::vector<VideoTrackInfo> video_tracks;
|
| + const std::vector<TextTrackInfo> text_tracks;
|
| +
|
| + private:
|
| + InitSegment(const std::vector<AudioTrackInfo>& audio_tracks,
|
| + const std::vector<VideoTrackInfo>& video_tracks,
|
| + const std::vector<TextTrackInfo>& text_tracks);
|
| +};
|
| +
|
| class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream {
|
| public:
|
| typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;
|
| @@ -131,6 +171,8 @@ class MEDIA_EXPORT ChunkDemuxerStream : public DemuxerStream {
|
| // from JavaScript to the media stack.
|
| class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
|
| public:
|
| + typedef base::Callback<void(const InitSegment&)> NewInitSegmentCB;
|
| +
|
| enum Status {
|
| kOk, // ID added w/o error.
|
| kNotSupported, // Type specified is not supported.
|
| @@ -191,13 +233,15 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
|
|
|
| // Registers a new |id| to use for AppendData() calls. |type| indicates
|
| // the MIME type for the data that we intend to append for this ID.
|
| + // BIG TODO(wolenetz): document |new_init_segment_cb| once it's hooked up.
|
| // kOk is returned if the demuxer has enough resources to support another ID
|
| // and supports the format indicated by |type|.
|
| // kNotSupported is returned if |type| is not a supported format.
|
| // kReachedIdLimit is returned if the demuxer cannot handle another ID right
|
| // now.
|
| Status AddId(const std::string& id, const std::string& type,
|
| - std::vector<std::string>& codecs);
|
| + std::vector<std::string>& codecs,
|
| + const NewInitSegmentCB& new_init_segment_cb);
|
|
|
| // Removed an ID & associated resources that were previously added with
|
| // AddId().
|
|
|