Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: media/filters/chunk_demuxer.h

Issue 361023003: WIP fixing/extending acolwell's init-segment-received patch Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Lots of further work needed (BIG TODOs, nits-to-self, etc) Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/websourcebuffer_impl.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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().
« no previous file with comments | « content/renderer/media/websourcebuffer_impl.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698