| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // Removes buffers between |start| and |end| according to the steps | 82 // Removes buffers between |start| and |end| according to the steps |
| 83 // in the "Coded Frame Removal Algorithm" in the Media Source | 83 // in the "Coded Frame Removal Algorithm" in the Media Source |
| 84 // Extensions Spec. | 84 // Extensions Spec. |
| 85 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc
e.html#sourcebuffer-coded-frame-removal | 85 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sourc
e.html#sourcebuffer-coded-frame-removal |
| 86 // | 86 // |
| 87 // |duration| is the current duration of the presentation. It is | 87 // |duration| is the current duration of the presentation. It is |
| 88 // required by the computation outlined in the spec. | 88 // required by the computation outlined in the spec. |
| 89 void Remove(base::TimeDelta start, base::TimeDelta end, | 89 void Remove(base::TimeDelta start, base::TimeDelta end, |
| 90 base::TimeDelta duration); | 90 base::TimeDelta duration); |
| 91 | 91 |
| 92 void NotifyMediaTimeUpdate(DecodeTimestamp media_time); |
| 93 |
| 92 // Changes the SourceBufferStream's state so that it will start returning | 94 // Changes the SourceBufferStream's state so that it will start returning |
| 93 // buffers starting from the closest keyframe before |timestamp|. | 95 // buffers starting from the closest keyframe before |timestamp|. |
| 94 void Seek(base::TimeDelta timestamp); | 96 void Seek(base::TimeDelta timestamp); |
| 95 | 97 |
| 96 // Returns true if the SourceBufferStream has seeked to a time without | 98 // Returns true if the SourceBufferStream has seeked to a time without |
| 97 // buffered data and is waiting for more data to be appended. | 99 // buffered data and is waiting for more data to be appended. |
| 98 bool IsSeekPending() const; | 100 bool IsSeekPending() const; |
| 99 | 101 |
| 100 // Notifies the SourceBufferStream that the media duration has been changed to | 102 // Notifies the SourceBufferStream that the media duration has been changed to |
| 101 // |duration| so it should drop any data past that point. | 103 // |duration| so it should drop any data past that point. |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 bool end_of_stream_; | 360 bool end_of_stream_; |
| 359 | 361 |
| 360 // Timestamp of the last request to Seek(). | 362 // Timestamp of the last request to Seek(). |
| 361 base::TimeDelta seek_buffer_timestamp_; | 363 base::TimeDelta seek_buffer_timestamp_; |
| 362 | 364 |
| 363 // Pointer to the seeked-to Range. This is the range from which | 365 // Pointer to the seeked-to Range. This is the range from which |
| 364 // GetNextBuffer() calls are fulfilled after the |track_buffer_| has been | 366 // GetNextBuffer() calls are fulfilled after the |track_buffer_| has been |
| 365 // emptied. | 367 // emptied. |
| 366 SourceBufferRange* selected_range_; | 368 SourceBufferRange* selected_range_; |
| 367 | 369 |
| 370 // Current media time. |
| 371 // If not exact, the media time must be a lower bound of the media time. |
| 372 DecodeTimestamp current_media_time_; |
| 373 |
| 368 // Queue of the next buffers to be returned from calls to GetNextBuffer(). If | 374 // Queue of the next buffers to be returned from calls to GetNextBuffer(). If |
| 369 // |track_buffer_| is empty, return buffers from |selected_range_|. | 375 // |track_buffer_| is empty, return buffers from |selected_range_|. |
| 370 BufferQueue track_buffer_; | 376 BufferQueue track_buffer_; |
| 371 | 377 |
| 372 // The start time of the current media segment being appended. | 378 // The start time of the current media segment being appended. |
| 373 DecodeTimestamp media_segment_start_time_; | 379 DecodeTimestamp media_segment_start_time_; |
| 374 | 380 |
| 375 // Points to the range containing the current media segment being appended. | 381 // Points to the range containing the current media segment being appended. |
| 376 RangeList::iterator range_for_next_append_; | 382 RangeList::iterator range_for_next_append_; |
| 377 | 383 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 420 |
| 415 // Indicates that splice frame generation is enabled. | 421 // Indicates that splice frame generation is enabled. |
| 416 const bool splice_frames_enabled_; | 422 const bool splice_frames_enabled_; |
| 417 | 423 |
| 418 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 424 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
| 419 }; | 425 }; |
| 420 | 426 |
| 421 } // namespace media | 427 } // namespace media |
| 422 | 428 |
| 423 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 429 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
| OLD | NEW |