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

Side by Side Diff: media/filters/chunk_demuxer.h

Issue 13419002: Media Source dispatches inband text tracks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 18 matching lines...) Expand all
29 enum Status { 29 enum Status {
30 kOk, // ID added w/o error. 30 kOk, // ID added w/o error.
31 kNotSupported, // Type specified is not supported. 31 kNotSupported, // Type specified is not supported.
32 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs. 32 kReachedIdLimit, // Reached ID limit. We can't handle any more IDs.
33 }; 33 };
34 34
35 typedef base::Callback<void(const std::string& type, 35 typedef base::Callback<void(const std::string& type,
36 scoped_array<uint8> init_data, 36 scoped_array<uint8> init_data,
37 int init_data_size)> NeedKeyCB; 37 int init_data_size)> NeedKeyCB;
38 38
39 // TODO(matthewjheaney): temp hack to test cue rendering
fgalligan1 2013/04/02 19:38:32 What is the TODO? Remove temp hack to test cue ren
Matthew Heaney (Chromium) 2013/04/04 04:01:52 Augmented the comment.
40 typedef base::Callback<void(const base::TimeDelta& time)> TextCB;
41
39 // |open_cb| Run when Initialize() is called to signal that the demuxer 42 // |open_cb| Run when Initialize() is called to signal that the demuxer
40 // is ready to receive media data via AppenData(). 43 // is ready to receive media data via AppenData().
41 // |need_key_cb| Run when the demuxer determines that an encryption key is 44 // |need_key_cb| Run when the demuxer determines that an encryption key is
42 // needed to decrypt the content. 45 // needed to decrypt the content.
43 // |log_cb| Run when parsing error messages need to be logged to the error 46 // |log_cb| Run when parsing error messages need to be logged to the error
44 // console. 47 // console.
45 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb, 48 ChunkDemuxer(const base::Closure& open_cb, const NeedKeyCB& need_key_cb,
49 const TextTrackCB& text_track_cb,
50 // TODO(matthewjheaney): temp hack to text cue rendering
51 const TextCB& text_cb,
46 const LogCB& log_cb); 52 const LogCB& log_cb);
47 53
48 // Demuxer implementation. 54 // Demuxer implementation.
49 virtual void Initialize(DemuxerHost* host, 55 virtual void Initialize(DemuxerHost* host,
50 const PipelineStatusCB& cb) OVERRIDE; 56 const PipelineStatusCB& cb) OVERRIDE;
51 virtual void Stop(const base::Closure& callback) OVERRIDE; 57 virtual void Stop(const base::Closure& callback) OVERRIDE;
52 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; 58 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE;
53 virtual void OnAudioRendererDisabled() OVERRIDE; 59 virtual void OnAudioRendererDisabled() OVERRIDE;
54 virtual scoped_refptr<DemuxerStream> GetStream( 60 virtual scoped_refptr<DemuxerStream> GetStream(
55 DemuxerStream::Type type) OVERRIDE; 61 DemuxerStream::Type type) OVERRIDE;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // StreamParser callbacks. 138 // StreamParser callbacks.
133 void OnStreamParserInitDone(bool success, base::TimeDelta duration); 139 void OnStreamParserInitDone(bool success, base::TimeDelta duration);
134 bool OnNewConfigs(bool has_audio, bool has_video, 140 bool OnNewConfigs(bool has_audio, bool has_video,
135 const AudioDecoderConfig& audio_config, 141 const AudioDecoderConfig& audio_config,
136 const VideoDecoderConfig& video_config); 142 const VideoDecoderConfig& video_config);
137 bool OnAudioBuffers(const StreamParser::BufferQueue& buffers); 143 bool OnAudioBuffers(const StreamParser::BufferQueue& buffers);
138 bool OnVideoBuffers(const StreamParser::BufferQueue& buffers); 144 bool OnVideoBuffers(const StreamParser::BufferQueue& buffers);
139 bool OnNeedKey(const std::string& type, 145 bool OnNeedKey(const std::string& type,
140 scoped_array<uint8> init_data, 146 scoped_array<uint8> init_data,
141 int init_data_size); 147 int init_data_size);
148 bool OnTextBuffers(const StreamParser::BufferQueue& buffers);
142 void OnNewMediaSegment(const std::string& source_id, 149 void OnNewMediaSegment(const std::string& source_id,
143 base::TimeDelta start_timestamp); 150 base::TimeDelta start_timestamp);
144 void OnEndOfMediaSegment(const std::string& source_id); 151 void OnEndOfMediaSegment(const std::string& source_id);
145 152
146 // Computes the intersection between the video & audio 153 // Computes the intersection between the video & audio
147 // buffered ranges. 154 // buffered ranges.
148 Ranges<base::TimeDelta> ComputeIntersection() const; 155 Ranges<base::TimeDelta> ComputeIntersection() const;
149 156
150 // Applies |time_offset| to the timestamps of |buffers|. 157 // Applies |time_offset| to the timestamps of |buffers|.
151 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers, 158 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers,
(...skipping 19 matching lines...) Expand all
171 178
172 // Returns the ranges representing the buffered data in the demuxer. 179 // Returns the ranges representing the buffered data in the demuxer.
173 Ranges<base::TimeDelta> GetBufferedRanges() const; 180 Ranges<base::TimeDelta> GetBufferedRanges() const;
174 181
175 mutable base::Lock lock_; 182 mutable base::Lock lock_;
176 State state_; 183 State state_;
177 184
178 DemuxerHost* host_; 185 DemuxerHost* host_;
179 base::Closure open_cb_; 186 base::Closure open_cb_;
180 NeedKeyCB need_key_cb_; 187 NeedKeyCB need_key_cb_;
188 TextTrackCB text_track_cb_;
189 TextCB text_cb_; // TODO(matthewjheaney): temp hack to test cue rendering
181 // Callback used to report error strings that can help the web developer 190 // Callback used to report error strings that can help the web developer
182 // figure out what is wrong with the content. 191 // figure out what is wrong with the content.
183 LogCB log_cb_; 192 LogCB log_cb_;
184 193
185 PipelineStatusCB init_cb_; 194 PipelineStatusCB init_cb_;
186 PipelineStatusCB seek_cb_; 195 PipelineStatusCB seek_cb_;
187 196
188 scoped_refptr<ChunkDemuxerStream> audio_; 197 scoped_refptr<ChunkDemuxerStream> audio_;
189 scoped_refptr<ChunkDemuxerStream> video_; 198 scoped_refptr<ChunkDemuxerStream> video_;
190 199
(...skipping 22 matching lines...) Expand all
213 // removed with RemoveID() but can not be re-added (yet). 222 // removed with RemoveID() but can not be re-added (yet).
214 std::string source_id_audio_; 223 std::string source_id_audio_;
215 std::string source_id_video_; 224 std::string source_id_video_;
216 225
217 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 226 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
218 }; 227 };
219 228
220 } // namespace media 229 } // namespace media
221 230
222 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 231 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698