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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Enables fixes for ogg files with negative timestamps. For AUDIO streams, | 80 // Enables fixes for ogg files with negative timestamps. For AUDIO streams, |
81 // all packets with negative timestamps will be marked for post-decode | 81 // all packets with negative timestamps will be marked for post-decode |
82 // discard. For all other stream types, if FFmpegDemuxer::start_time() is | 82 // discard. For all other stream types, if FFmpegDemuxer::start_time() is |
83 // negative, it will not be used to shift timestamps during EnqueuePacket(). | 83 // negative, it will not be used to shift timestamps during EnqueuePacket(). |
84 void enable_negative_timestamp_fixups_for_ogg() { | 84 void enable_negative_timestamp_fixups_for_ogg() { |
85 fixup_negative_ogg_timestamps_ = true; | 85 fixup_negative_ogg_timestamps_ = true; |
86 } | 86 } |
87 | 87 |
88 // DemuxerStream implementation. | 88 // DemuxerStream implementation. |
89 virtual Type type() OVERRIDE; | 89 virtual Type type() override; |
90 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 90 virtual void Read(const ReadCB& read_cb) override; |
91 virtual void EnableBitstreamConverter() OVERRIDE; | 91 virtual void EnableBitstreamConverter() override; |
92 virtual bool SupportsConfigChanges() OVERRIDE; | 92 virtual bool SupportsConfigChanges() override; |
93 virtual AudioDecoderConfig audio_decoder_config() OVERRIDE; | 93 virtual AudioDecoderConfig audio_decoder_config() override; |
94 virtual VideoDecoderConfig video_decoder_config() OVERRIDE; | 94 virtual VideoDecoderConfig video_decoder_config() override; |
95 virtual VideoRotation video_rotation() OVERRIDE; | 95 virtual VideoRotation video_rotation() override; |
96 | 96 |
97 // Returns the range of buffered data in this stream. | 97 // Returns the range of buffered data in this stream. |
98 Ranges<base::TimeDelta> GetBufferedRanges() const; | 98 Ranges<base::TimeDelta> GetBufferedRanges() const; |
99 | 99 |
100 // Returns elapsed time based on the already queued packets. | 100 // Returns elapsed time based on the already queued packets. |
101 // Used to determine stream duration when it's not known ahead of time. | 101 // Used to determine stream duration when it's not known ahead of time. |
102 base::TimeDelta GetElapsedTime() const; | 102 base::TimeDelta GetElapsedTime() const; |
103 | 103 |
104 // Returns true if this stream has capacity for additional data. | 104 // Returns true if this stream has capacity for additional data. |
105 bool HasAvailableCapacity(); | 105 bool HasAvailableCapacity(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 public: | 156 public: |
157 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 157 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
158 DataSource* data_source, | 158 DataSource* data_source, |
159 const NeedKeyCB& need_key_cb, | 159 const NeedKeyCB& need_key_cb, |
160 const scoped_refptr<MediaLog>& media_log); | 160 const scoped_refptr<MediaLog>& media_log); |
161 virtual ~FFmpegDemuxer(); | 161 virtual ~FFmpegDemuxer(); |
162 | 162 |
163 // Demuxer implementation. | 163 // Demuxer implementation. |
164 virtual void Initialize(DemuxerHost* host, | 164 virtual void Initialize(DemuxerHost* host, |
165 const PipelineStatusCB& status_cb, | 165 const PipelineStatusCB& status_cb, |
166 bool enable_text_tracks) OVERRIDE; | 166 bool enable_text_tracks) override; |
167 virtual void Stop() OVERRIDE; | 167 virtual void Stop() override; |
168 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) OVERRIDE; | 168 virtual void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; |
169 virtual base::Time GetTimelineOffset() const OVERRIDE; | 169 virtual base::Time GetTimelineOffset() const override; |
170 virtual DemuxerStream* GetStream(DemuxerStream::Type type) OVERRIDE; | 170 virtual DemuxerStream* GetStream(DemuxerStream::Type type) override; |
171 virtual base::TimeDelta GetStartTime() const OVERRIDE; | 171 virtual base::TimeDelta GetStartTime() const override; |
172 virtual Liveness GetLiveness() const OVERRIDE; | 172 virtual Liveness GetLiveness() const override; |
173 | 173 |
174 // Calls |need_key_cb_| with the initialization data encountered in the file. | 174 // Calls |need_key_cb_| with the initialization data encountered in the file. |
175 void FireNeedKey(const std::string& init_data_type, | 175 void FireNeedKey(const std::string& init_data_type, |
176 const std::string& encryption_key_id); | 176 const std::string& encryption_key_id); |
177 | 177 |
178 // Allow FFmpegDemuxerStream to notify us when there is updated information | 178 // Allow FFmpegDemuxerStream to notify us when there is updated information |
179 // about capacity and what buffered data is available. | 179 // about capacity and what buffered data is available. |
180 void NotifyCapacityAvailable(); | 180 void NotifyCapacityAvailable(); |
181 void NotifyBufferingChanged(); | 181 void NotifyBufferingChanged(); |
182 | 182 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 // NOTE: Weak pointers must be invalidated before all other member variables. | 298 // NOTE: Weak pointers must be invalidated before all other member variables. |
299 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 299 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
300 | 300 |
301 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 301 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
302 }; | 302 }; |
303 | 303 |
304 } // namespace media | 304 } // namespace media |
305 | 305 |
306 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 306 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |