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

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

Issue 563773002: Allow setting different memory limits for different stream types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 virtual AudioDecoderConfig audio_decoder_config() OVERRIDE; 85 virtual AudioDecoderConfig audio_decoder_config() OVERRIDE;
86 virtual VideoDecoderConfig video_decoder_config() OVERRIDE; 86 virtual VideoDecoderConfig video_decoder_config() OVERRIDE;
87 virtual bool SupportsConfigChanges() OVERRIDE; 87 virtual bool SupportsConfigChanges() OVERRIDE;
88 virtual VideoRotation video_rotation() OVERRIDE; 88 virtual VideoRotation video_rotation() OVERRIDE;
89 89
90 // Returns the text track configuration. It is an error to call this method 90 // Returns the text track configuration. It is an error to call this method
91 // if type() != TEXT. 91 // if type() != TEXT.
92 TextTrackConfig text_track_config(); 92 TextTrackConfig text_track_config();
93 93
94 // Sets the memory limit, in bytes, on the SourceBufferStream. 94 // Sets the memory limit, in bytes, on the SourceBufferStream.
95 void set_memory_limit_for_testing(int memory_limit) { 95 void set_memory_limit(int memory_limit) {
96 stream_->set_memory_limit_for_testing(memory_limit); 96 stream_->set_memory_limit(memory_limit);
97 } 97 }
98 98
99 bool supports_partial_append_window_trimming() const { 99 bool supports_partial_append_window_trimming() const {
100 return partial_append_window_trimming_enabled_; 100 return partial_append_window_trimming_enabled_;
101 } 101 }
102 102
103 private: 103 private:
104 enum State { 104 enum State {
105 UNINITIALIZED, 105 UNINITIALIZED,
106 RETURNING_DATA_FOR_READS, 106 RETURNING_DATA_FOR_READS,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 base::TimeDelta timestamp_offset); 255 base::TimeDelta timestamp_offset);
256 256
257 // Called to signal changes in the "end of stream" 257 // Called to signal changes in the "end of stream"
258 // state. UnmarkEndOfStream() must not be called if a matching 258 // state. UnmarkEndOfStream() must not be called if a matching
259 // MarkEndOfStream() has not come before it. 259 // MarkEndOfStream() has not come before it.
260 void MarkEndOfStream(PipelineStatus status); 260 void MarkEndOfStream(PipelineStatus status);
261 void UnmarkEndOfStream(); 261 void UnmarkEndOfStream();
262 262
263 void Shutdown(); 263 void Shutdown();
264 264
265 // Sets the memory limit on each stream. |memory_limit| is the 265 // Sets the memory limit on each stream of a specific type.
266 // maximum number of bytes each stream is allowed to hold in its buffer. 266 // |memory_limit| is the maximum number of bytes each stream of type |type|
267 void SetMemoryLimitsForTesting(int memory_limit); 267 // is allowed to hold in its buffer.
268 void SetMemoryLimits(DemuxerStream::Type type, int memory_limit);
268 269
269 // Returns the ranges representing the buffered data in the demuxer. 270 // Returns the ranges representing the buffered data in the demuxer.
270 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer 271 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer
271 // requires it for doing hack browser seeks to I-frame on Android. See 272 // requires it for doing hack browser seeks to I-frame on Android. See
272 // http://crbug.com/304234. 273 // http://crbug.com/304234.
273 Ranges<base::TimeDelta> GetBufferedRanges() const; 274 Ranges<base::TimeDelta> GetBufferedRanges() const;
274 275
275 private: 276 private:
276 enum State { 277 enum State {
277 WAITING_FOR_INIT, 278 WAITING_FOR_INIT,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 386
386 // Indicates that splice frame generation is enabled. 387 // Indicates that splice frame generation is enabled.
387 const bool splice_frames_enabled_; 388 const bool splice_frames_enabled_;
388 389
389 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 390 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
390 }; 391 };
391 392
392 } // namespace media 393 } // namespace media
393 394
394 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 395 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698