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 #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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 void UnmarkEndOfStream(); | 81 void UnmarkEndOfStream(); |
82 | 82 |
83 // DemuxerStream methods. | 83 // DemuxerStream methods. |
84 void Read(const ReadCB& read_cb) override; | 84 void Read(const ReadCB& read_cb) override; |
85 Type type() const override; | 85 Type type() const override; |
86 Liveness liveness() const override; | 86 Liveness liveness() const override; |
87 AudioDecoderConfig audio_decoder_config() override; | 87 AudioDecoderConfig audio_decoder_config() override; |
88 VideoDecoderConfig video_decoder_config() override; | 88 VideoDecoderConfig video_decoder_config() override; |
89 bool SupportsConfigChanges() override; | 89 bool SupportsConfigChanges() override; |
90 VideoRotation video_rotation() override; | 90 VideoRotation video_rotation() override; |
| 91 int GetMemoryLimit() const override; |
| 92 void SetMemoryLimit(int memory_limit) override; |
91 | 93 |
92 // Returns the text track configuration. It is an error to call this method | 94 // Returns the text track configuration. It is an error to call this method |
93 // if type() != TEXT. | 95 // if type() != TEXT. |
94 TextTrackConfig text_track_config(); | 96 TextTrackConfig text_track_config(); |
95 | 97 |
96 // Sets the memory limit, in bytes, on the SourceBufferStream. | |
97 void set_memory_limit(int memory_limit) { | |
98 stream_->set_memory_limit(memory_limit); | |
99 } | |
100 | |
101 bool supports_partial_append_window_trimming() const { | 98 bool supports_partial_append_window_trimming() const { |
102 return partial_append_window_trimming_enabled_; | 99 return partial_append_window_trimming_enabled_; |
103 } | 100 } |
104 | 101 |
105 void SetLiveness(Liveness liveness); | 102 void SetLiveness(Liveness liveness); |
106 | 103 |
107 private: | 104 private: |
108 enum State { | 105 enum State { |
109 UNINITIALIZED, | 106 UNINITIALIZED, |
110 RETURNING_DATA_FOR_READS, | 107 RETURNING_DATA_FOR_READS, |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 base::TimeDelta timestamp_offset); | 263 base::TimeDelta timestamp_offset); |
267 | 264 |
268 // Called to signal changes in the "end of stream" | 265 // Called to signal changes in the "end of stream" |
269 // state. UnmarkEndOfStream() must not be called if a matching | 266 // state. UnmarkEndOfStream() must not be called if a matching |
270 // MarkEndOfStream() has not come before it. | 267 // MarkEndOfStream() has not come before it. |
271 void MarkEndOfStream(PipelineStatus status); | 268 void MarkEndOfStream(PipelineStatus status); |
272 void UnmarkEndOfStream(); | 269 void UnmarkEndOfStream(); |
273 | 270 |
274 void Shutdown(); | 271 void Shutdown(); |
275 | 272 |
276 // Sets the memory limit on each stream of a specific type. | |
277 // |memory_limit| is the maximum number of bytes each stream of type |type| | |
278 // is allowed to hold in its buffer. | |
279 void SetMemoryLimits(DemuxerStream::Type type, int memory_limit); | |
280 | |
281 // Returns the ranges representing the buffered data in the demuxer. | 273 // Returns the ranges representing the buffered data in the demuxer. |
282 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer | 274 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer |
283 // requires it for doing hack browser seeks to I-frame on Android. See | 275 // requires it for doing hack browser seeks to I-frame on Android. See |
284 // http://crbug.com/304234. | 276 // http://crbug.com/304234. |
285 Ranges<base::TimeDelta> GetBufferedRanges() const; | 277 Ranges<base::TimeDelta> GetBufferedRanges() const; |
286 | 278 |
287 private: | 279 private: |
288 enum State { | 280 enum State { |
289 WAITING_FOR_INIT, | 281 WAITING_FOR_INIT, |
290 INITIALIZING, | 282 INITIALIZING, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 389 |
398 // Indicates that splice frame generation is enabled. | 390 // Indicates that splice frame generation is enabled. |
399 const bool splice_frames_enabled_; | 391 const bool splice_frames_enabled_; |
400 | 392 |
401 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 393 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
402 }; | 394 }; |
403 | 395 |
404 } // namespace media | 396 } // namespace media |
405 | 397 |
406 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 398 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |