OLD | NEW |
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 // timestamps that match |start| will be removed. | 286 // timestamps that match |start| will be removed. |
287 // |*deleted_buffers| - Filled with buffers for the current playback position | 287 // |*deleted_buffers| - Filled with buffers for the current playback position |
288 // if the removal range included the current playback position. These buffers | 288 // if the removal range included the current playback position. These buffers |
289 // can be used as candidates for placing in the |track_buffer_|. | 289 // can be used as candidates for placing in the |track_buffer_|. |
290 void RemoveInternal( | 290 void RemoveInternal( |
291 base::TimeDelta start, base::TimeDelta end, bool is_exclusive, | 291 base::TimeDelta start, base::TimeDelta end, bool is_exclusive, |
292 BufferQueue* deleted_buffers); | 292 BufferQueue* deleted_buffers); |
293 | 293 |
294 bool is_video() const { return video_configs_.size() > 0; } | 294 bool is_video() const { return video_configs_.size() > 0; } |
295 | 295 |
| 296 // See GetNextBuffer() for additional details. The internal method hands out |
| 297 // buffers from the |track_buffer_| and |selected_range_| without additional |
| 298 // processing for splice frame buffers; which is handled by GetNextBuffer(). |
| 299 Status GetNextBufferInternal(scoped_refptr<StreamParserBuffer>* out_buffer); |
| 300 |
296 // Callback used to report error strings that can help the web developer | 301 // Callback used to report error strings that can help the web developer |
297 // figure out what is wrong with the content. | 302 // figure out what is wrong with the content. |
298 LogCB log_cb_; | 303 LogCB log_cb_; |
299 | 304 |
300 // List of disjoint buffered ranges, ordered by start time. | 305 // List of disjoint buffered ranges, ordered by start time. |
301 RangeList ranges_; | 306 RangeList ranges_; |
302 | 307 |
303 // Indicates which decoder config is being used by the decoder. | 308 // Indicates which decoder config is being used by the decoder. |
304 // GetNextBuffer() is only allows to return buffers that have a | 309 // GetNextBuffer() is only allows to return buffers that have a |
305 // config ID that matches this index. If there is a mismatch then | 310 // config ID that matches this index. If there is a mismatch then |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 367 |
363 // The maximum amount of data in bytes the stream will keep in memory. | 368 // The maximum amount of data in bytes the stream will keep in memory. |
364 int memory_limit_; | 369 int memory_limit_; |
365 | 370 |
366 // Indicates that a kConfigChanged status has been reported by GetNextBuffer() | 371 // Indicates that a kConfigChanged status has been reported by GetNextBuffer() |
367 // and GetCurrentXXXDecoderConfig() must be called to update the current | 372 // and GetCurrentXXXDecoderConfig() must be called to update the current |
368 // config. GetNextBuffer() must not be called again until | 373 // config. GetNextBuffer() must not be called again until |
369 // GetCurrentXXXDecoderConfig() has been called. | 374 // GetCurrentXXXDecoderConfig() has been called. |
370 bool config_change_pending_; | 375 bool config_change_pending_; |
371 | 376 |
| 377 // Used by GetNextBuffer() when a buffer with fade out is returned from |
| 378 // GetNextBufferInternal(). Will be set to the returned buffer and will be |
| 379 // consumed after the fade out section has been exhausted. |
| 380 scoped_refptr<StreamParserBuffer> fade_in_buffer_; |
| 381 |
| 382 // Indicates which of the fade out preroll buffers in |fade_in_buffer_| should |
| 383 // be handled out next. |
| 384 size_t fade_out_preroll_index_; |
| 385 |
| 386 |
372 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 387 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
373 }; | 388 }; |
374 | 389 |
375 } // namespace media | 390 } // namespace media |
376 | 391 |
377 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 392 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |