Chromium Code Reviews

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/22) Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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...)
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...)
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 193 matching lines...)
313 // Indicates which decoder config to associate with new buffers 316 // Indicates which decoder config to associate with new buffers
314 // being appended. Each new buffer appended has its config ID set 317 // being appended. Each new buffer appended has its config ID set
315 // to the value of this field. 318 // to the value of this field.
316 int append_config_index_; 319 int append_config_index_;
317 320
318 // Holds the audio/video configs for this stream. |current_config_index_| 321 // Holds the audio/video configs for this stream. |current_config_index_|
319 // and |append_config_index_| represent indexes into one of these vectors. 322 // and |append_config_index_| represent indexes into one of these vectors.
320 std::vector<AudioDecoderConfig> audio_configs_; 323 std::vector<AudioDecoderConfig> audio_configs_;
321 std::vector<VideoDecoderConfig> video_configs_; 324 std::vector<VideoDecoderConfig> video_configs_;
322 325
326 // Holds the text config for this stream.
327 TextTrackConfig text_track_config_;
328
323 // True if more data needs to be appended before the Seek() can complete, 329 // True if more data needs to be appended before the Seek() can complete,
324 // false if no Seek() has been requested or the Seek() is completed. 330 // false if no Seek() has been requested or the Seek() is completed.
325 bool seek_pending_; 331 bool seek_pending_;
326 332
327 // True if the end of the stream has been signalled. 333 // True if the end of the stream has been signalled.
328 bool end_of_stream_; 334 bool end_of_stream_;
329 335
330 // Timestamp of the last request to Seek(). 336 // Timestamp of the last request to Seek().
331 base::TimeDelta seek_buffer_timestamp_; 337 base::TimeDelta seek_buffer_timestamp_;
332 338
(...skipping 36 matching lines...)
369 // config. GetNextBuffer() must not be called again until 375 // config. GetNextBuffer() must not be called again until
370 // GetCurrentXXXDecoderConfig() has been called. 376 // GetCurrentXXXDecoderConfig() has been called.
371 bool config_change_pending_; 377 bool config_change_pending_;
372 378
373 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); 379 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream);
374 }; 380 };
375 381
376 } // namespace media 382 } // namespace media
377 383
378 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ 384 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_
OLDNEW

Powered by Google App Engine