Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: media/filters/source_buffer_range.h

Issue 1008463002: Fix MSE GC, make it less aggressive, more spec-compliant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added new test case: GarbageCollection_SaveDataAtPlaybackPosition Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Gets the range of GOP to secure at least |bytes_to_free| from 117 // Gets the range of GOP to secure at least |bytes_to_free| from
118 // [|start_timestamp|, |end_timestamp|). 118 // [|start_timestamp|, |end_timestamp|).
119 // Returns the size of the buffers to secure if the buffers of 119 // Returns the size of the buffers to secure if the buffers of
120 // [|start_timestamp|, |end_removal_timestamp|) is removed. 120 // [|start_timestamp|, |end_removal_timestamp|) is removed.
121 // Will not update |end_removal_timestamp| if the returned size is 0. 121 // Will not update |end_removal_timestamp| if the returned size is 0.
122 int GetRemovalGOP( 122 int GetRemovalGOP(
123 DecodeTimestamp start_timestamp, DecodeTimestamp end_timestamp, 123 DecodeTimestamp start_timestamp, DecodeTimestamp end_timestamp,
124 int bytes_to_free, DecodeTimestamp* end_removal_timestamp); 124 int bytes_to_free, DecodeTimestamp* end_removal_timestamp);
125 125
126 bool FirstGOPEarlierThanMediaTime(DecodeTimestamp media_time) const;
127
126 // Indicates whether the GOP at the beginning or end of the range contains the 128 // Indicates whether the GOP at the beginning or end of the range contains the
127 // next buffer position. 129 // next buffer position.
128 bool FirstGOPContainsNextBufferPosition() const; 130 bool FirstGOPContainsNextBufferPosition() const;
129 bool LastGOPContainsNextBufferPosition() const; 131 bool LastGOPContainsNextBufferPosition() const;
130 132
131 // Updates |out_buffer| with the next buffer in presentation order. Seek() 133 // Updates |out_buffer| with the next buffer in presentation order. Seek()
132 // must be called before calls to GetNextBuffer(), and buffers are returned 134 // must be called before calls to GetNextBuffer(), and buffers are returned
133 // in order from the last call to Seek(). Returns true if |out_buffer| is 135 // in order from the last call to Seek(). Returns true if |out_buffer| is
134 // filled with a valid buffer, false if there is not enough data to fulfill 136 // filled with a valid buffer, false if there is not enough data to fulfill
135 // the request. 137 // the request.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 287
286 // Stores the amount of memory taken up by the data in |buffers_|. 288 // Stores the amount of memory taken up by the data in |buffers_|.
287 int size_in_bytes_; 289 int size_in_bytes_;
288 290
289 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange); 291 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange);
290 }; 292 };
291 293
292 } // namespace media 294 } // namespace media
293 295
294 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ 296 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698