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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 // Notifies this object that the video config has changed and buffers in | 136 // Notifies this object that the video config has changed and buffers in |
137 // future Append() calls should be associated with this new config. | 137 // future Append() calls should be associated with this new config. |
138 bool UpdateVideoConfig(const VideoDecoderConfig& config); | 138 bool UpdateVideoConfig(const VideoDecoderConfig& config); |
139 | 139 |
140 // Returns the largest distance between two adjacent buffers in this stream, | 140 // Returns the largest distance between two adjacent buffers in this stream, |
141 // or an estimate if no two adjacent buffers have been appended to the stream | 141 // or an estimate if no two adjacent buffers have been appended to the stream |
142 // yet. | 142 // yet. |
143 base::TimeDelta GetMaxInterbufferDistance() const; | 143 base::TimeDelta GetMaxInterbufferDistance() const; |
144 | 144 |
145 void set_memory_limit(int memory_limit) { | 145 int GetMemoryLimit() const { |
| 146 return memory_limit_; |
| 147 } |
| 148 |
| 149 void SetMemoryLimit(int memory_limit) { |
146 memory_limit_ = memory_limit; | 150 memory_limit_ = memory_limit; |
147 } | 151 } |
148 | 152 |
149 private: | 153 private: |
150 friend class SourceBufferStreamTest; | 154 friend class SourceBufferStreamTest; |
151 | 155 |
152 // Frees up space if the SourceBufferStream is taking up too much memory. | 156 // Frees up space if the SourceBufferStream is taking up too much memory. |
153 void GarbageCollectIfNeeded(); | 157 void GarbageCollectIfNeeded(); |
154 | 158 |
155 // Attempts to delete approximately |total_bytes_to_free| amount of data | 159 // Attempts to delete approximately |total_bytes_to_free| amount of data |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 422 |
419 // Indicates that splice frame generation is enabled. | 423 // Indicates that splice frame generation is enabled. |
420 const bool splice_frames_enabled_; | 424 const bool splice_frames_enabled_; |
421 | 425 |
422 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); | 426 DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
423 }; | 427 }; |
424 | 428 |
425 } // namespace media | 429 } // namespace media |
426 | 430 |
427 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ | 431 #endif // MEDIA_FILTERS_SOURCE_BUFFER_STREAM_H_ |
OLD | NEW |