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> |
11 #include <utility> | 11 #include <utility> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | |
14 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
15 #include "media/base/byte_queue.h" | 16 #include "media/base/byte_queue.h" |
16 #include "media/base/demuxer.h" | 17 #include "media/base/demuxer.h" |
17 #include "media/base/demuxer_stream.h" | 18 #include "media/base/demuxer_stream.h" |
18 #include "media/base/ranges.h" | 19 #include "media/base/ranges.h" |
19 #include "media/base/stream_parser.h" | 20 #include "media/base/stream_parser.h" |
20 #include "media/filters/source_buffer_stream.h" | 21 #include "media/filters/source_buffer_stream.h" |
21 | 22 |
22 namespace media { | 23 namespace media { |
23 | 24 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 AudioDecoderConfig audio_decoder_config() override; | 88 AudioDecoderConfig audio_decoder_config() override; |
88 VideoDecoderConfig video_decoder_config() override; | 89 VideoDecoderConfig video_decoder_config() override; |
89 bool SupportsConfigChanges() override; | 90 bool SupportsConfigChanges() override; |
90 VideoRotation video_rotation() override; | 91 VideoRotation video_rotation() override; |
91 | 92 |
92 // Returns the text track configuration. It is an error to call this method | 93 // Returns the text track configuration. It is an error to call this method |
93 // if type() != TEXT. | 94 // if type() != TEXT. |
94 TextTrackConfig text_track_config(); | 95 TextTrackConfig text_track_config(); |
95 | 96 |
96 // Sets the memory limit, in bytes, on the SourceBufferStream. | 97 // Sets the memory limit, in bytes, on the SourceBufferStream. |
97 void set_memory_limit(int memory_limit) { | 98 void SetMemoryLimit(size_t memory_limit); |
ddorwin
2015/07/20 21:23:57
Set*Stream*MemoryLimit?
servolk
2015/07/22 19:02:11
I think it's pretty obvious from the context where
ddorwin
2015/07/22 22:48:08
A class/API should be self-documenting and standal
servolk
2015/07/22 23:04:54
Done.
| |
98 stream_->set_memory_limit(memory_limit); | |
99 } | |
100 | 99 |
101 bool supports_partial_append_window_trimming() const { | 100 bool supports_partial_append_window_trimming() const { |
102 return partial_append_window_trimming_enabled_; | 101 return partial_append_window_trimming_enabled_; |
103 } | 102 } |
104 | 103 |
105 void SetLiveness(Liveness liveness); | 104 void SetLiveness(Liveness liveness); |
106 | 105 |
107 private: | 106 private: |
108 enum State { | 107 enum State { |
109 UNINITIALIZED, | 108 UNINITIALIZED, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 // state. UnmarkEndOfStream() must not be called if a matching | 269 // state. UnmarkEndOfStream() must not be called if a matching |
271 // MarkEndOfStream() has not come before it. | 270 // MarkEndOfStream() has not come before it. |
272 void MarkEndOfStream(PipelineStatus status); | 271 void MarkEndOfStream(PipelineStatus status); |
273 void UnmarkEndOfStream(); | 272 void UnmarkEndOfStream(); |
274 | 273 |
275 void Shutdown(); | 274 void Shutdown(); |
276 | 275 |
277 // Sets the memory limit on each stream of a specific type. | 276 // 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| | 277 // |memory_limit| is the maximum number of bytes each stream of type |type| |
279 // is allowed to hold in its buffer. | 278 // is allowed to hold in its buffer. |
280 void SetMemoryLimits(DemuxerStream::Type type, int memory_limit); | 279 void SetMemoryLimits(DemuxerStream::Type type, size_t memory_limit); |
281 | 280 |
282 // Returns the ranges representing the buffered data in the demuxer. | 281 // Returns the ranges representing the buffered data in the demuxer. |
283 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer | 282 // TODO(wolenetz): Remove this method once MediaSourceDelegate no longer |
284 // requires it for doing hack browser seeks to I-frame on Android. See | 283 // requires it for doing hack browser seeks to I-frame on Android. See |
285 // http://crbug.com/304234. | 284 // http://crbug.com/304234. |
286 Ranges<base::TimeDelta> GetBufferedRanges() const; | 285 Ranges<base::TimeDelta> GetBufferedRanges() const; |
287 | 286 |
288 private: | 287 private: |
289 enum State { | 288 enum State { |
290 WAITING_FOR_INIT, | 289 WAITING_FOR_INIT, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 | 397 |
399 // Indicates that splice frame generation is enabled. | 398 // Indicates that splice frame generation is enabled. |
400 const bool splice_frames_enabled_; | 399 const bool splice_frames_enabled_; |
401 | 400 |
402 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); | 401 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); |
403 }; | 402 }; |
404 | 403 |
405 } // namespace media | 404 } // namespace media |
406 | 405 |
407 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ | 406 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ |
OLD | NEW |