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