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

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

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: incorporate aaron's comments (10/16) Created 7 years, 2 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 // SourceBufferStream is a data structure that stores media Buffers in ranges. 5 // SourceBufferStream is a data structure that stores media Buffers in ranges.
6 // Buffers can be appended out of presentation order. Buffers are retrieved by 6 // Buffers can be appended out of presentation order. Buffers are retrieved by
7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are 7 // seeking to the desired start point and calling GetNextBuffer(). Buffers are
8 // returned in sequential presentation order. 8 // returned in sequential presentation order.
9 9
10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ 10 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 kSuccess, 42 kSuccess,
43 kNeedBuffer, 43 kNeedBuffer,
44 kConfigChange, 44 kConfigChange,
45 kEndOfStream 45 kEndOfStream
46 }; 46 };
47 47
48 SourceBufferStream(const AudioDecoderConfig& audio_config, 48 SourceBufferStream(const AudioDecoderConfig& audio_config,
49 const LogCB& log_cb); 49 const LogCB& log_cb);
50 SourceBufferStream(const VideoDecoderConfig& video_config, 50 SourceBufferStream(const VideoDecoderConfig& video_config,
51 const LogCB& log_cb); 51 const LogCB& log_cb);
52 SourceBufferStream(const TextTrackConfig& text_config,
53 const LogCB& log_cb);
52 54
53 ~SourceBufferStream(); 55 ~SourceBufferStream();
54 56
55 // Signals that the next buffers appended are part of a new media segment 57 // Signals that the next buffers appended are part of a new media segment
56 // starting at |media_segment_start_time|. 58 // starting at |media_segment_start_time|.
57 void OnNewMediaSegment(base::TimeDelta media_segment_start_time); 59 void OnNewMediaSegment(base::TimeDelta media_segment_start_time);
58 60
59 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are 61 // Add the |buffers| to the SourceBufferStream. Buffers within the queue are
60 // expected to be in order, but multiple calls to Append() may add buffers out 62 // expected to be in order, but multiple calls to Append() may add buffers out
61 // of order or overlapping. Assumes all buffers within |buffers| are in 63 // of order or overlapping. Assumes all buffers within |buffers| are in
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 Ranges<base::TimeDelta> GetBufferedTime() const; 102 Ranges<base::TimeDelta> GetBufferedTime() const;
101 103
102 // Notifies this object that end of stream has been signalled. 104 // Notifies this object that end of stream has been signalled.
103 void MarkEndOfStream(); 105 void MarkEndOfStream();
104 106
105 // Clear the end of stream state set by MarkEndOfStream(). 107 // Clear the end of stream state set by MarkEndOfStream().
106 void UnmarkEndOfStream(); 108 void UnmarkEndOfStream();
107 109
108 const AudioDecoderConfig& GetCurrentAudioDecoderConfig(); 110 const AudioDecoderConfig& GetCurrentAudioDecoderConfig();
109 const VideoDecoderConfig& GetCurrentVideoDecoderConfig(); 111 const VideoDecoderConfig& GetCurrentVideoDecoderConfig();
112 const TextTrackConfig& GetCurrentTextTrackConfig();
110 113
111 // Notifies this object that the audio config has changed and buffers in 114 // Notifies this object that the audio config has changed and buffers in
112 // future Append() calls should be associated with this new config. 115 // future Append() calls should be associated with this new config.
113 bool UpdateAudioConfig(const AudioDecoderConfig& config); 116 bool UpdateAudioConfig(const AudioDecoderConfig& config);
114 117
115 // Notifies this object that the video config has changed and buffers in 118 // Notifies this object that the video config has changed and buffers in
116 // future Append() calls should be associated with this new config. 119 // future Append() calls should be associated with this new config.
117 bool UpdateVideoConfig(const VideoDecoderConfig& config); 120 bool UpdateVideoConfig(const VideoDecoderConfig& config);
118 121
119 // Returns the largest distance between two adjacent buffers in this stream, 122 // Returns the largest distance between two adjacent buffers in this stream,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // Indicates which decoder config to associate with new buffers 310 // Indicates which decoder config to associate with new buffers
308 // being appended. Each new buffer appended has its config ID set 311 // being appended. Each new buffer appended has its config ID set
309 // to the value of this field. 312 // to the value of this field.
310 int append_config_index_; 313 int append_config_index_;
311 314
312 // Holds the audio/video configs for this stream. |current_config_index_| 315 // Holds the audio/video configs for this stream. |current_config_index_|
313 // and |append_config_index_| represent indexes into one of these vectors. 316 // and |append_config_index_| represent indexes into one of these vectors.
314 std::vector<AudioDecoderConfig> audio_configs_; 317 std::vector<AudioDecoderConfig> audio_configs_;
315 std::vector<VideoDecoderConfig> video_configs_; 318 std::vector<VideoDecoderConfig> video_configs_;
316 319
320 // TODO(matthewjheaney): does this need to be a vector?
acolwell GONE FROM CHROMIUM 2013/10/21 20:10:40 no. since we don't allow config changes on text tr
Matthew Heaney (Chromium) 2013/10/23 05:09:01 Done.
321 TextTrackConfig text_track_config_;
322
317 // True if more data needs to be appended before the Seek() can complete, 323 // True if more data needs to be appended before the Seek() can complete,
318 // false if no Seek() has been requested or the Seek() is completed. 324 // false if no Seek() has been requested or the Seek() is completed.
319 bool seek_pending_; 325 bool seek_pending_;
320 326
321 // True if the end of the stream has been signalled. 327 // True if the end of the stream has been signalled.
322 bool end_of_stream_; 328 bool end_of_stream_;
323 329
324 // Timestamp of the last request to Seek(). 330 // Timestamp of the last request to Seek().
325 base::TimeDelta seek_buffer_timestamp_; 331 base::TimeDelta seek_buffer_timestamp_;
326 332
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // config. GetNextBuffer() must not be called again until 369 // config. GetNextBuffer() must not be called again until
364 // GetCurrentXXXDecoderConfig() has been called. 370 // GetCurrentXXXDecoderConfig() has been called.
365 bool config_change_pending_; 371 bool config_change_pending_;
366 372
367 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); 373 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream);
368 }; 374 };
369 375
370 } // namespace media 376 } // namespace media
371 377
372 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ 378 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698