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

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

Issue 220113002: MSE: Pick frame processor in ChunkDemuxer::AddId; prepare unit tests to pick processor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes patch set 2 nit Created 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/webmediasource_impl.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // StartWaitingForSeek() call. This method also arranges for the next Seek() 179 // StartWaitingForSeek() call. This method also arranges for the next Seek()
180 // call received before a StartWaitingForSeek() call to immediately call its 180 // call received before a StartWaitingForSeek() call to immediately call its
181 // callback without waiting for any data. 181 // callback without waiting for any data.
182 // |seek_time| - The presentation timestamp for the seek request that 182 // |seek_time| - The presentation timestamp for the seek request that
183 // triggered this call. It represents the most recent position the caller is 183 // triggered this call. It represents the most recent position the caller is
184 // trying to seek to. 184 // trying to seek to.
185 void CancelPendingSeek(base::TimeDelta seek_time); 185 void CancelPendingSeek(base::TimeDelta seek_time);
186 186
187 // Registers a new |id| to use for AppendData() calls. |type| indicates 187 // Registers a new |id| to use for AppendData() calls. |type| indicates
188 // the MIME type for the data that we intend to append for this ID. 188 // the MIME type for the data that we intend to append for this ID.
189 // |use_legacy_frame_processor| determines which of LegacyFrameProcessor or
190 // a (not yet implemented) more compliant frame processor to use to process
191 // parsed frames from AppendData() calls.
192 // TODO(wolenetz): Enable usage of new frame processor based on this flag.
193 // See http://crbug.com/249422.
189 // kOk is returned if the demuxer has enough resources to support another ID 194 // kOk is returned if the demuxer has enough resources to support another ID
190 // and supports the format indicated by |type|. 195 // and supports the format indicated by |type|.
191 // kNotSupported is returned if |type| is not a supported format. 196 // kNotSupported is returned if |type| is not a supported format.
192 // kReachedIdLimit is returned if the demuxer cannot handle another ID right 197 // kReachedIdLimit is returned if the demuxer cannot handle another ID right
193 // now. 198 // now.
194 Status AddId(const std::string& id, const std::string& type, 199 Status AddId(const std::string& id, const std::string& type,
195 std::vector<std::string>& codecs); 200 std::vector<std::string>& codecs,
201 const bool use_legacy_frame_processor);
196 202
197 // Removed an ID & associated resources that were previously added with 203 // Removed an ID & associated resources that were previously added with
198 // AddId(). 204 // AddId().
199 void RemoveId(const std::string& id); 205 void RemoveId(const std::string& id);
200 206
201 // Gets the currently buffered ranges for the specified ID. 207 // Gets the currently buffered ranges for the specified ID.
202 Ranges<base::TimeDelta> GetBufferedRanges(const std::string& id) const; 208 Ranges<base::TimeDelta> GetBufferedRanges(const std::string& id) const;
203 209
204 // Appends media data to the source buffer associated with |id|, applying 210 // Appends media data to the source buffer associated with |id|, applying
205 // and possibly updating |*timestamp_offset| during coded frame processing. 211 // and possibly updating |*timestamp_offset| during coded frame processing.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 // SourceState callbacks. 288 // SourceState callbacks.
283 void OnSourceInitDone(bool success, base::TimeDelta duration); 289 void OnSourceInitDone(bool success, base::TimeDelta duration);
284 290
285 // Creates a DemuxerStream for the specified |type|. 291 // Creates a DemuxerStream for the specified |type|.
286 // Returns a new ChunkDemuxerStream instance if a stream of this type 292 // Returns a new ChunkDemuxerStream instance if a stream of this type
287 // has not been created before. Returns NULL otherwise. 293 // has not been created before. Returns NULL otherwise.
288 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type); 294 ChunkDemuxerStream* CreateDemuxerStream(DemuxerStream::Type type);
289 295
290 void OnNewTextTrack(ChunkDemuxerStream* text_stream, 296 void OnNewTextTrack(ChunkDemuxerStream* text_stream,
291 const TextTrackConfig& config); 297 const TextTrackConfig& config);
292 void OnNewMediaSegment(const std::string& source_id,
293 base::TimeDelta start_timestamp);
294 298
295 // Returns true if |source_id| is valid, false otherwise. 299 // Returns true if |source_id| is valid, false otherwise.
296 bool IsValidId(const std::string& source_id) const; 300 bool IsValidId(const std::string& source_id) const;
297 301
298 // Increases |duration_| to |new_duration|, if |new_duration| is higher. 302 // Increases |duration_| to |new_duration|, if |new_duration| is higher.
299 void IncreaseDurationIfNecessary(base::TimeDelta new_duration); 303 void IncreaseDurationIfNecessary(base::TimeDelta new_duration);
300 304
301 // Decreases |duration_| if the buffered region is less than |duration_| when 305 // Decreases |duration_| if the buffered region is less than |duration_| when
302 // EndOfStream() is called. 306 // EndOfStream() is called.
303 void DecreaseDurationIfNecessary(); 307 void DecreaseDurationIfNecessary();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 374
371 // Indicates that splice frame generation is enabled. 375 // Indicates that splice frame generation is enabled.
372 const bool splice_frames_enabled_; 376 const bool splice_frames_enabled_;
373 377
374 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 378 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
375 }; 379 };
376 380
377 } // namespace media 381 } // namespace media
378 382
379 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 383 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webmediasource_impl.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698