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

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

Issue 1171263004: Allow setting memory limits on media::DemuxerStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include logging.h for NOTIMPLEMENTED definition 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 (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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698