OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RANGE_H_ | 5 #ifndef MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ |
6 #define MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ | 6 #define MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // Returns true if this range's buffered timespan completely overlaps the | 188 // Returns true if this range's buffered timespan completely overlaps the |
189 // buffered timespan of |range|. | 189 // buffered timespan of |range|. |
190 bool CompletelyOverlaps(const SourceBufferRange& range) const; | 190 bool CompletelyOverlaps(const SourceBufferRange& range) const; |
191 | 191 |
192 // Returns true if the end of this range contains buffers that overlaps with | 192 // Returns true if the end of this range contains buffers that overlaps with |
193 // the beginning of |range|. | 193 // the beginning of |range|. |
194 bool EndOverlaps(const SourceBufferRange& range) const; | 194 bool EndOverlaps(const SourceBufferRange& range) const; |
195 | 195 |
196 // Returns true if |timestamp| is the timestamp of the next buffer in | 196 // Returns true if |timestamp| is the timestamp of the next buffer in |
197 // sequence after |buffers_.back()|, false otherwise. | 197 // sequence after |buffers_.back()|, false otherwise. |
198 bool IsNextInSequence(DecodeTimestamp timestamp, bool is_keyframe) const; | 198 bool IsNextInSequence(DecodeTimestamp timestamp, bool is_key_frame) const; |
199 | 199 |
200 // Adds all buffers which overlap [start, end) to the end of |buffers|. If | 200 // Adds all buffers which overlap [start, end) to the end of |buffers|. If |
201 // no buffers exist in the range returns false, true otherwise. | 201 // no buffers exist in the range returns false, true otherwise. |
202 bool GetBuffersInRange(DecodeTimestamp start, DecodeTimestamp end, | 202 bool GetBuffersInRange(DecodeTimestamp start, DecodeTimestamp end, |
203 BufferQueue* buffers); | 203 BufferQueue* buffers); |
204 | 204 |
205 int size_in_bytes() const { return size_in_bytes_; } | 205 int size_in_bytes() const { return size_in_bytes_; } |
206 | 206 |
207 private: | 207 private: |
208 typedef std::map<DecodeTimestamp, int> KeyframeMap; | 208 typedef std::map<DecodeTimestamp, int> KeyframeMap; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 // Stores the amount of memory taken up by the data in |buffers_|. | 281 // Stores the amount of memory taken up by the data in |buffers_|. |
282 int size_in_bytes_; | 282 int size_in_bytes_; |
283 | 283 |
284 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange); | 284 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange); |
285 }; | 285 }; |
286 | 286 |
287 } // namespace media | 287 } // namespace media |
288 | 288 |
289 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ | 289 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ |
OLD | NEW |