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 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 5 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
6 #define MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 6 #define MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <utility> | 10 #include <utility> |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 RangeList::iterator FindExistingRangeFor(base::TimeDelta start_timestamp); | 148 RangeList::iterator FindExistingRangeFor(base::TimeDelta start_timestamp); |
149 | 149 |
150 // Inserts |new_range| into |ranges_| preserving sorted order. Returns an | 150 // Inserts |new_range| into |ranges_| preserving sorted order. Returns an |
151 // iterator in |ranges_| that points to |new_range|. | 151 // iterator in |ranges_| that points to |new_range|. |
152 RangeList::iterator AddToRanges(SourceBufferRange* new_range); | 152 RangeList::iterator AddToRanges(SourceBufferRange* new_range); |
153 | 153 |
154 // Returns an iterator that points to the place in |ranges_| where | 154 // Returns an iterator that points to the place in |ranges_| where |
155 // |selected_range_| lives. | 155 // |selected_range_| lives. |
156 RangeList::iterator GetSelectedRangeItr(); | 156 RangeList::iterator GetSelectedRangeItr(); |
157 | 157 |
| 158 // Sets the |selected_range_| to |range| and resets the next buffer position |
| 159 // for the previous |selected_range_|. |
| 160 void SetSelectedRange(SourceBufferRange* range); |
| 161 |
158 // Returns true if the timestamps of |buffers| are monotonically increasing | 162 // Returns true if the timestamps of |buffers| are monotonically increasing |
159 // since the previous append to the media segment, false otherwise. | 163 // since the previous append to the media segment, false otherwise. |
160 bool IsMonotonicallyIncreasing(const BufferQueue& buffers); | 164 bool IsMonotonicallyIncreasing(const BufferQueue& buffers); |
161 | 165 |
| 166 // Returns true if |selected_range_| is the only range in |ranges_| that |
| 167 // HasNextBufferPosition(). |
| 168 bool OnlySelectedRangeIsSeeked() const; |
| 169 |
162 // Measures the distances between buffer timestamps and tracks the max. | 170 // Measures the distances between buffer timestamps and tracks the max. |
163 void UpdateMaxInterbufferDistance(const BufferQueue& buffers); | 171 void UpdateMaxInterbufferDistance(const BufferQueue& buffers); |
164 | 172 |
165 // List of disjoint buffered ranges, ordered by start time. | 173 // List of disjoint buffered ranges, ordered by start time. |
166 RangeList ranges_; | 174 RangeList ranges_; |
167 | 175 |
168 AudioDecoderConfig audio_config_; | 176 AudioDecoderConfig audio_config_; |
169 VideoDecoderConfig video_config_; | 177 VideoDecoderConfig video_config_; |
170 | 178 |
171 // True if more data needs to be appended before the Seek() can complete, | 179 // True if more data needs to be appended before the Seek() can complete, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 211 |
204 // Stores the largest distance between two adjacent buffers in this stream. | 212 // Stores the largest distance between two adjacent buffers in this stream. |
205 base::TimeDelta max_interbuffer_distance_; | 213 base::TimeDelta max_interbuffer_distance_; |
206 | 214 |
207 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 215 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
208 }; | 216 }; |
209 | 217 |
210 } // namespace media | 218 } // namespace media |
211 | 219 |
212 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 220 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |