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 // Implements the Demuxer interface using FFmpeg's libavformat. At this time | 5 // Implements the Demuxer interface using FFmpeg's libavformat. At this time |
6 // will support demuxing any audio/video format thrown at it. The streams | 6 // will support demuxing any audio/video format thrown at it. The streams |
7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer | 7 // output mime types audio/x-ffmpeg and video/x-ffmpeg and include an integer |
8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs | 8 // key FFmpegCodecID which contains the CodecID enumeration value. The CodecIDs |
9 // can be used to create and initialize the corresponding FFmpeg decoder. | 9 // can be used to create and initialize the corresponding FFmpeg decoder. |
10 // | 10 // |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // DemuxerStream implementation. | 88 // DemuxerStream implementation. |
89 Type type() const override; | 89 Type type() const override; |
90 Liveness liveness() const override; | 90 Liveness liveness() const override; |
91 void Read(const ReadCB& read_cb) override; | 91 void Read(const ReadCB& read_cb) override; |
92 void EnableBitstreamConverter() override; | 92 void EnableBitstreamConverter() override; |
93 bool SupportsConfigChanges() override; | 93 bool SupportsConfigChanges() override; |
94 AudioDecoderConfig audio_decoder_config() override; | 94 AudioDecoderConfig audio_decoder_config() override; |
95 VideoDecoderConfig video_decoder_config() override; | 95 VideoDecoderConfig video_decoder_config() override; |
96 VideoRotation video_rotation() override; | 96 VideoRotation video_rotation() override; |
97 | 97 |
| 98 // TODO(servolk): Implement better memory limit control for FFMpegDemuxer, |
| 99 // currently is has a hard-coded limit of 150Mb across all streams (see |
| 100 // IsMaxMemoryUsageReached and crbug.com/343304). |
| 101 // Also FFmpegDemuxer is always used with media::BufferDataSource, perhaps |
| 102 // we should control buffer size via that for FFmpeg. |
| 103 //int GetMemoryLimit() const override; |
| 104 //void SetMemoryLimit(int memory_limit) override; |
| 105 |
98 void SetLiveness(Liveness liveness); | 106 void SetLiveness(Liveness liveness); |
99 | 107 |
100 // Returns the range of buffered data in this stream. | 108 // Returns the range of buffered data in this stream. |
101 Ranges<base::TimeDelta> GetBufferedRanges() const; | 109 Ranges<base::TimeDelta> GetBufferedRanges() const; |
102 | 110 |
103 // Returns elapsed time based on the already queued packets. | 111 // Returns elapsed time based on the already queued packets. |
104 // Used to determine stream duration when it's not known ahead of time. | 112 // Used to determine stream duration when it's not known ahead of time. |
105 base::TimeDelta GetElapsedTime() const; | 113 base::TimeDelta GetElapsedTime() const; |
106 | 114 |
107 // Returns true if this stream has capacity for additional data. | 115 // Returns true if this stream has capacity for additional data. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 312 |
305 // NOTE: Weak pointers must be invalidated before all other member variables. | 313 // NOTE: Weak pointers must be invalidated before all other member variables. |
306 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 314 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
307 | 315 |
308 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 316 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
309 }; | 317 }; |
310 | 318 |
311 } // namespace media | 319 } // namespace media |
312 | 320 |
313 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 321 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |