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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 RangeList::iterator AddToRanges(SourceBufferRange* new_range); | 167 RangeList::iterator AddToRanges(SourceBufferRange* new_range); |
168 | 168 |
169 // Returns an iterator that points to the place in |ranges_| where | 169 // Returns an iterator that points to the place in |ranges_| where |
170 // |selected_range_| lives. | 170 // |selected_range_| lives. |
171 RangeList::iterator GetSelectedRangeItr(); | 171 RangeList::iterator GetSelectedRangeItr(); |
172 | 172 |
173 // Sets the |selected_range_| to |range| and resets the next buffer position | 173 // Sets the |selected_range_| to |range| and resets the next buffer position |
174 // for the previous |selected_range_|. | 174 // for the previous |selected_range_|. |
175 void SetSelectedRange(SourceBufferRange* range); | 175 void SetSelectedRange(SourceBufferRange* range); |
176 | 176 |
177 // Returns true if |timestamp| occurs before the start timestamp of the first | 177 // Returns true if |seek_timestamp| refers to the beginning of the first range |
178 // range in |ranges_|, false otherwise or if |ranges_| is empty. | 178 // in |ranges_|, false otherwise or if |ranges_| is empty. |
179 bool IsBeforeFirstRange(base::TimeDelta timestamp) const; | 179 bool ShouldSeekToStartOfBuffered(base::TimeDelta seek_timestamp) const; |
180 | 180 |
181 // Returns true if the timestamps of |buffers| are monotonically increasing | 181 // Returns true if the timestamps of |buffers| are monotonically increasing |
182 // since the previous append to the media segment, false otherwise. | 182 // since the previous append to the media segment, false otherwise. |
183 bool IsMonotonicallyIncreasing(const BufferQueue& buffers) const; | 183 bool IsMonotonicallyIncreasing(const BufferQueue& buffers) const; |
184 | 184 |
185 // Returns true if |selected_range_| is the only range in |ranges_| that | 185 // Returns true if |selected_range_| is the only range in |ranges_| that |
186 // HasNextBufferPosition(). | 186 // HasNextBufferPosition(). |
187 bool OnlySelectedRangeIsSeeked() const; | 187 bool OnlySelectedRangeIsSeeked() const; |
188 | 188 |
189 // Measures the distances between buffer timestamps and tracks the max. | 189 // Measures the distances between buffer timestamps and tracks the max. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 // Stores the largest distance between two adjacent buffers in this stream. | 252 // Stores the largest distance between two adjacent buffers in this stream. |
253 base::TimeDelta max_interbuffer_distance_; | 253 base::TimeDelta max_interbuffer_distance_; |
254 | 254 |
255 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 255 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
256 }; | 256 }; |
257 | 257 |
258 } // namespace media | 258 } // namespace media |
259 | 259 |
260 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 260 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |