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 | |
162 // Returns true if the timestamps of |buffers| are monotonically increasing | 158 // Returns true if the timestamps of |buffers| are monotonically increasing |
163 // since the previous append to the media segment, false otherwise. | 159 // since the previous append to the media segment, false otherwise. |
164 bool IsMonotonicallyIncreasing(const BufferQueue& buffers); | 160 bool IsMonotonicallyIncreasing(const BufferQueue& buffers); |
165 | 161 |
166 // Returns true if |selected_range_| is the only range in |ranges_| that | |
167 // HasNextBufferPosition(). | |
168 bool OnlySelectedRangeIsSeeked() const; | |
169 | |
170 // Measures the distances between buffer timestamps and tracks the max. | 162 // Measures the distances between buffer timestamps and tracks the max. |
171 void UpdateMaxInterbufferDistance(const BufferQueue& buffers); | 163 void UpdateMaxInterbufferDistance(const BufferQueue& buffers); |
172 | 164 |
173 // List of disjoint buffered ranges, ordered by start time. | 165 // List of disjoint buffered ranges, ordered by start time. |
174 RangeList ranges_; | 166 RangeList ranges_; |
175 | 167 |
176 AudioDecoderConfig audio_config_; | 168 AudioDecoderConfig audio_config_; |
177 VideoDecoderConfig video_config_; | 169 VideoDecoderConfig video_config_; |
178 | 170 |
179 // True if more data needs to be appended before the Seek() can complete, | 171 // 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... |
211 | 203 |
212 // Stores the largest distance between two adjacent buffers in this stream. | 204 // Stores the largest distance between two adjacent buffers in this stream. |
213 base::TimeDelta max_interbuffer_distance_; | 205 base::TimeDelta max_interbuffer_distance_; |
214 | 206 |
215 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 207 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
216 }; | 208 }; |
217 | 209 |
218 } // namespace media | 210 } // namespace media |
219 | 211 |
220 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 212 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |