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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 bool fixup_negative_timestamps_; | 183 bool fixup_negative_timestamps_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream); | 185 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxerStream); |
186 }; | 186 }; |
187 | 187 |
188 class MEDIA_EXPORT FFmpegDemuxer : public Demuxer { | 188 class MEDIA_EXPORT FFmpegDemuxer : public Demuxer { |
189 public: | 189 public: |
190 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 190 FFmpegDemuxer(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
191 DataSource* data_source, | 191 DataSource* data_source, |
192 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 192 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
| 193 const MediaTracksUpdatedCB& media_tracks_updated_cb, |
193 const scoped_refptr<MediaLog>& media_log); | 194 const scoped_refptr<MediaLog>& media_log); |
194 ~FFmpegDemuxer() override; | 195 ~FFmpegDemuxer() override; |
195 | 196 |
196 // Demuxer implementation. | 197 // Demuxer implementation. |
197 std::string GetDisplayName() const override; | 198 std::string GetDisplayName() const override; |
198 void Initialize(DemuxerHost* host, | 199 void Initialize(DemuxerHost* host, |
199 const PipelineStatusCB& status_cb, | 200 const PipelineStatusCB& status_cb, |
200 bool enable_text_tracks) override; | 201 bool enable_text_tracks) override; |
201 void Stop() override; | 202 void Stop() override; |
202 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; | 203 void Seek(base::TimeDelta time, const PipelineStatusCB& cb) override; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // Set if we know duration of the audio stream. Used when processing end of | 323 // Set if we know duration of the audio stream. Used when processing end of |
323 // stream -- at this moment we definitely know duration. | 324 // stream -- at this moment we definitely know duration. |
324 bool duration_known_; | 325 bool duration_known_; |
325 | 326 |
326 // FFmpegURLProtocol implementation and corresponding glue bits. | 327 // FFmpegURLProtocol implementation and corresponding glue bits. |
327 scoped_ptr<BlockingUrlProtocol> url_protocol_; | 328 scoped_ptr<BlockingUrlProtocol> url_protocol_; |
328 scoped_ptr<FFmpegGlue> glue_; | 329 scoped_ptr<FFmpegGlue> glue_; |
329 | 330 |
330 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 331 const EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
331 | 332 |
| 333 const MediaTracksUpdatedCB media_tracks_updated_cb_; |
| 334 |
332 // NOTE: Weak pointers must be invalidated before all other member variables. | 335 // NOTE: Weak pointers must be invalidated before all other member variables. |
333 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 336 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
334 | 337 |
335 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 338 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
336 }; | 339 }; |
337 | 340 |
338 } // namespace media | 341 } // namespace media |
339 | 342 |
340 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 343 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |