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

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

Issue 1692403002: MSE - Fix crash caused by incorrect GC of GOP with next buffer position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Stick with DCHECKs for this to ease merging. +unit test Created 4 years, 10 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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Returns true if everything in the range was deleted. Otherwise 107 // Returns true if everything in the range was deleted. Otherwise
108 // returns false. 108 // returns false.
109 bool TruncateAt(DecodeTimestamp timestamp, 109 bool TruncateAt(DecodeTimestamp timestamp,
110 BufferQueue* deleted_buffers, bool is_exclusive); 110 BufferQueue* deleted_buffers, bool is_exclusive);
111 // Deletes all buffers in range. 111 // Deletes all buffers in range.
112 void DeleteAll(BufferQueue* deleted_buffers); 112 void DeleteAll(BufferQueue* deleted_buffers);
113 113
114 // Deletes a GOP from the front or back of the range and moves these 114 // Deletes a GOP from the front or back of the range and moves these
115 // buffers into |deleted_buffers|. Returns the number of bytes deleted from 115 // buffers into |deleted_buffers|. Returns the number of bytes deleted from
116 // the range (i.e. the size in bytes of |deleted_buffers|). 116 // the range (i.e. the size in bytes of |deleted_buffers|).
117 // This range must NOT be empty when these methods are called.
118 // The GOP being deleted must NOT contain the next buffer position.
117 size_t DeleteGOPFromFront(BufferQueue* deleted_buffers); 119 size_t DeleteGOPFromFront(BufferQueue* deleted_buffers);
118 size_t DeleteGOPFromBack(BufferQueue* deleted_buffers); 120 size_t DeleteGOPFromBack(BufferQueue* deleted_buffers);
119 121
120 // Gets the range of GOP to secure at least |bytes_to_free| from 122 // Gets the range of GOP to secure at least |bytes_to_free| from
121 // [|start_timestamp|, |end_timestamp|). 123 // [|start_timestamp|, |end_timestamp|).
122 // Returns the size of the buffers to secure if the buffers of 124 // Returns the size of the buffers to secure if the buffers of
123 // [|start_timestamp|, |end_removal_timestamp|) is removed. 125 // [|start_timestamp|, |end_removal_timestamp|) is removed.
124 // Will not update |end_removal_timestamp| if the returned size is 0. 126 // Will not update |end_removal_timestamp| if the returned size is 0.
125 size_t GetRemovalGOP( 127 size_t GetRemovalGOP(
126 DecodeTimestamp start_timestamp, DecodeTimestamp end_timestamp, 128 DecodeTimestamp start_timestamp, DecodeTimestamp end_timestamp,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 292
291 // Stores the amount of memory taken up by the data in |buffers_|. 293 // Stores the amount of memory taken up by the data in |buffers_|.
292 size_t size_in_bytes_; 294 size_t size_in_bytes_;
293 295
294 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange); 296 DISALLOW_COPY_AND_ASSIGN(SourceBufferRange);
295 }; 297 };
296 298
297 } // namespace media 299 } // namespace media
298 300
299 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_ 301 #endif // MEDIA_FILTERS_SOURCE_BUFFER_RANGE_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/source_buffer_range.cc » ('j') | media/filters/source_buffer_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698