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 size_t GetMemoryLimit() const override; |
| 92 void SetMemoryLimit(size_t 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 base::TimeDelta timestamp_offset); | 264 base::TimeDelta timestamp_offset); |
268 | 265 |
269 // Called to signal changes in the "end of stream" | 266 // Called to signal changes in the "end of stream" |
270 // state. UnmarkEndOfStream() must not be called if a matching | 267 // state. UnmarkEndOfStream() must not be called if a matching |
271 // MarkEndOfStream() has not come before it. | 268 // MarkEndOfStream() has not come before it. |
272 void MarkEndOfStream(PipelineStatus status); | 269 void MarkEndOfStream(PipelineStatus status); |
273 void UnmarkEndOfStream(); | 270 void UnmarkEndOfStream(); |
274 | 271 |
275 void Shutdown(); | 272 void Shutdown(); |
276 | 273 |
277 // Sets the memory limit on each stream of a specific type. | |
278 // |memory_limit| is the maximum number of bytes each stream of type |type| | |
279 // is allowed to hold in its buffer. | |
280 void SetMemoryLimits(DemuxerStream::Type type, int memory_limit); | |
281 | |
282 // Returns the ranges representing the buffered data in the demuxer. | 274 // Returns the ranges representing the buffered data in the demuxer. |
283 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer | 275 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer |
284 // requires it for doing hack browser seeks to I-frame on Android. See | 276 // requires it for doing hack browser seeks to I-frame on Android. See |
285 // http://crbug.com/304234. | 277 // http://crbug.com/304234. |
286 Ranges<base::TimeDelta> GetBufferedRanges() const; | 278 Ranges<base::TimeDelta> GetBufferedRanges() const; |
287 | 279 |
288 private: | 280 private: |
289 enum State { | 281 enum State { |
290 WAITING_FOR_INIT, | 282 WAITING_FOR_INIT, |
291 INITIALIZING, | 283 INITIALIZING, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 | 390 |
399 // Indicates that splice frame generation is enabled. | 391 // Indicates that splice frame generation is enabled. |
400 const bool splice_frames_enabled_; | 392 const bool splice_frames_enabled_; |
401 | 393 |
402 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 394 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
403 }; | 395 }; |
404 | 396 |
405 } // namespace media | 397 } // namespace media |
406 | 398 |
407 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 399 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |