| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // timestamps that match |start| will be removed. | 295 // timestamps that match |start| will be removed. |
| 296 // |*deleted_buffers| - Filled with buffers for the current playback position | 296 // |*deleted_buffers| - Filled with buffers for the current playback position |
| 297 // if the removal range included the current playback position. These buffers | 297 // if the removal range included the current playback position. These buffers |
| 298 // can be used as candidates for placing in the |track_buffer_|. | 298 // can be used as candidates for placing in the |track_buffer_|. |
| 299 void RemoveInternal( | 299 void RemoveInternal( |
| 300 base::TimeDelta start, base::TimeDelta end, bool is_exclusive, | 300 base::TimeDelta start, base::TimeDelta end, bool is_exclusive, |
| 301 BufferQueue* deleted_buffers); | 301 BufferQueue* deleted_buffers); |
| 302 | 302 |
| 303 Type GetType() const; | 303 Type GetType() const; |
| 304 | 304 |
| 305 // See GetNextBuffer() for additional details. This method handles splice |
| 306 // frame processing. |
| 307 Status HandleNextBufferWithSplice( |
| 308 scoped_refptr<StreamParserBuffer>* out_buffer); |
| 309 |
| 310 // See GetNextBuffer() for additional details. This method handles preroll |
| 311 // frame processing. |
| 312 Status HandleNextBufferWithPreroll( |
| 313 scoped_refptr<StreamParserBuffer>* out_buffer); |
| 314 |
| 305 // See GetNextBuffer() for additional details. The internal method hands out | 315 // See GetNextBuffer() for additional details. The internal method hands out |
| 306 // buffers from the |track_buffer_| and |selected_range_| without additional | 316 // single buffers from the |track_buffer_| and |selected_range_| without |
| 307 // processing for splice frame buffers; which is handled by GetNextBuffer(). | 317 // additional processing for splice frame or preroll buffers. |
| 308 Status GetNextBufferInternal(scoped_refptr<StreamParserBuffer>* out_buffer); | 318 Status GetNextBufferInternal(scoped_refptr<StreamParserBuffer>* out_buffer); |
| 309 | 319 |
| 310 // Called by PrepareRangesForNextAppend() before pruning overlapped buffers to | 320 // Called by PrepareRangesForNextAppend() before pruning overlapped buffers to |
| 311 // generate a splice frame with a small portion of the overlapped buffers. If | 321 // generate a splice frame with a small portion of the overlapped buffers. If |
| 312 // a splice frame is generated, the first buffer in |new_buffers| will have | 322 // a splice frame is generated, the first buffer in |new_buffers| will have |
| 313 // its timestamps, duration, and fade out preroll updated. | 323 // its timestamps, duration, and fade out preroll updated. |
| 314 void GenerateSpliceFrame(const BufferQueue& new_buffers); | 324 void GenerateSpliceFrame(const BufferQueue& new_buffers); |
| 315 | 325 |
| 316 // Callback used to report error strings that can help the web developer | 326 // Callback used to report error strings that can help the web developer |
| 317 // figure out what is wrong with the content. | 327 // figure out what is wrong with the content. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 392 |
| 383 // The maximum amount of data in bytes the stream will keep in memory. | 393 // The maximum amount of data in bytes the stream will keep in memory. |
| 384 int memory_limit_; | 394 int memory_limit_; |
| 385 | 395 |
| 386 // Indicates that a kConfigChanged status has been reported by GetNextBuffer() | 396 // Indicates that a kConfigChanged status has been reported by GetNextBuffer() |
| 387 // and GetCurrentXXXDecoderConfig() must be called to update the current | 397 // and GetCurrentXXXDecoderConfig() must be called to update the current |
| 388 // config. GetNextBuffer() must not be called again until | 398 // config. GetNextBuffer() must not be called again until |
| 389 // GetCurrentXXXDecoderConfig() has been called. | 399 // GetCurrentXXXDecoderConfig() has been called. |
| 390 bool config_change_pending_; | 400 bool config_change_pending_; |
| 391 | 401 |
| 392 // Used by GetNextBuffer() when a buffer with fade out is returned from | 402 // Used by HandleNextBufferWithSplice() or HandleNextBufferWithPreroll() when |
| 393 // GetNextBufferInternal(). Will be set to the returned buffer and will be | 403 // a splice frame buffer or buffer with preroll is returned from |
| 394 // destroyed after the splice_buffers() section has been exhausted. | 404 // GetNextBufferInternal(). |
| 395 scoped_refptr<StreamParserBuffer> splice_buffer_; | 405 scoped_refptr<StreamParserBuffer> pending_buffer_; |
| 396 | 406 |
| 397 // Indicates which of the splice buffers in |splice_buffer_| should be | 407 // Indicates which of the splice buffers in |splice_buffer_| should be |
| 398 // handled out next. | 408 // handled out next. |
| 399 size_t splice_buffers_index_; | 409 size_t splice_buffers_index_; |
| 400 | 410 |
| 401 // Indicates that all pre splice buffers have been handed out. | 411 // Indicates that all buffers before |pending_buffer_| have been handed out. |
| 402 bool pre_splice_complete_; | 412 bool pending_buffers_complete_; |
| 403 | 413 |
| 404 // Indicates that splice frame generation is enabled. | 414 // Indicates that splice frame generation is enabled. |
| 405 const bool splice_frames_enabled_; | 415 const bool splice_frames_enabled_; |
| 406 | 416 |
| 407 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 417 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
| 408 }; | 418 }; |
| 409 | 419 |
| 410 } // namespace media | 420 } // namespace media |
| 411 | 421 |
| 412 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 422 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| OLD | NEW |