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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // |track_id| either contains the selected video track id or is null, | 246 // |track_id| either contains the selected video track id or is null, |
247 // indicating that all video tracks are deselected/disabled. | 247 // indicating that all video tracks are deselected/disabled. |
248 void OnSelectedVideoTrackChanged(base::Optional<MediaTrack::Id> track_id, | 248 void OnSelectedVideoTrackChanged(base::Optional<MediaTrack::Id> track_id, |
249 base::TimeDelta curr_time) override; | 249 base::TimeDelta curr_time) override; |
250 | 250 |
251 // The lowest demuxed timestamp. If negative, DemuxerStreams must use this to | 251 // The lowest demuxed timestamp. If negative, DemuxerStreams must use this to |
252 // adjust packet timestamps such that external clients see a zero-based | 252 // adjust packet timestamps such that external clients see a zero-based |
253 // timeline. | 253 // timeline. |
254 base::TimeDelta start_time() const { return start_time_; } | 254 base::TimeDelta start_time() const { return start_time_; } |
255 | 255 |
| 256 // Task runner used to execute blocking FFmpeg operations. |
| 257 scoped_refptr<base::SequencedTaskRunner> ffmpeg_task_runner() { |
| 258 return blocking_task_runner_; |
| 259 } |
| 260 |
256 private: | 261 private: |
257 // To allow tests access to privates. | 262 // To allow tests access to privates. |
258 friend class FFmpegDemuxerTest; | 263 friend class FFmpegDemuxerTest; |
259 | 264 |
260 // FFmpeg callbacks during initialization. | 265 // FFmpeg callbacks during initialization. |
261 void OnOpenContextDone(const PipelineStatusCB& status_cb, bool result); | 266 void OnOpenContextDone(const PipelineStatusCB& status_cb, bool result); |
262 void OnFindStreamInfoDone(const PipelineStatusCB& status_cb, int result); | 267 void OnFindStreamInfoDone(const PipelineStatusCB& status_cb, int result); |
263 | 268 |
264 void LogMetadata(AVFormatContext* avctx, base::TimeDelta max_duration); | 269 void LogMetadata(AVFormatContext* avctx, base::TimeDelta max_duration); |
265 | 270 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 base::WeakPtr<FFmpegDemuxer> weak_this_; | 383 base::WeakPtr<FFmpegDemuxer> weak_this_; |
379 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; | 384 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; |
380 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 385 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
381 | 386 |
382 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 387 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
383 }; | 388 }; |
384 | 389 |
385 } // namespace media | 390 } // namespace media |
386 | 391 |
387 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 392 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
OLD | NEW |