| 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 14 matching lines...) Expand all Loading... |
| 25 #include <stddef.h> | 25 #include <stddef.h> |
| 26 #include <stdint.h> | 26 #include <stdint.h> |
| 27 | 27 |
| 28 #include <memory> | 28 #include <memory> |
| 29 #include <string> | 29 #include <string> |
| 30 #include <utility> | 30 #include <utility> |
| 31 #include <vector> | 31 #include <vector> |
| 32 | 32 |
| 33 #include "base/callback.h" | 33 #include "base/callback.h" |
| 34 #include "base/macros.h" | 34 #include "base/macros.h" |
| 35 #include "base/memory/weak_ptr.h" | 35 #include "base/threading/thread.h" |
| 36 #include "base/sequenced_task_runner.h" | |
| 37 #include "base/single_thread_task_runner.h" | |
| 38 #include "media/base/audio_decoder_config.h" | 36 #include "media/base/audio_decoder_config.h" |
| 39 #include "media/base/decoder_buffer.h" | 37 #include "media/base/decoder_buffer.h" |
| 40 #include "media/base/decoder_buffer_queue.h" | 38 #include "media/base/decoder_buffer_queue.h" |
| 41 #include "media/base/demuxer.h" | 39 #include "media/base/demuxer.h" |
| 42 #include "media/base/pipeline_status.h" | 40 #include "media/base/pipeline_status.h" |
| 43 #include "media/base/text_track_config.h" | 41 #include "media/base/text_track_config.h" |
| 44 #include "media/base/video_decoder_config.h" | 42 #include "media/base/video_decoder_config.h" |
| 45 #include "media/ffmpeg/ffmpeg_deleters.h" | 43 #include "media/ffmpeg/ffmpeg_deleters.h" |
| 46 #include "media/filters/blocking_url_protocol.h" | 44 #include "media/filters/blocking_url_protocol.h" |
| 47 #include "media/media_features.h" | 45 #include "media/media_features.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Called after the streams have been collected from the media, to allow | 288 // Called after the streams have been collected from the media, to allow |
| 291 // the text renderer to bind each text stream to the cue rendering engine. | 289 // the text renderer to bind each text stream to the cue rendering engine. |
| 292 void AddTextStreams(); | 290 void AddTextStreams(); |
| 293 | 291 |
| 294 void SetLiveness(DemuxerStream::Liveness liveness); | 292 void SetLiveness(DemuxerStream::Liveness liveness); |
| 295 | 293 |
| 296 DemuxerHost* host_; | 294 DemuxerHost* host_; |
| 297 | 295 |
| 298 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 296 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 299 | 297 |
| 300 // Task runner on which all blocking FFmpeg operations are executed; retrieved | 298 // Thread on which all blocking FFmpeg operations are executed. |
| 301 // from base::TaskScheduler. | 299 base::Thread blocking_thread_; |
| 302 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | |
| 303 | |
| 304 // Indicates if Stop() has been called. | |
| 305 bool stopped_; | |
| 306 | 300 |
| 307 // Tracks if there's an outstanding av_read_frame() operation. | 301 // Tracks if there's an outstanding av_read_frame() operation. |
| 308 // | 302 // |
| 309 // TODO(scherkus): Allow more than one read in flight for higher read | 303 // TODO(scherkus): Allow more than one read in flight for higher read |
| 310 // throughput using demuxer_bench to verify improvements. | 304 // throughput using demuxer_bench to verify improvements. |
| 311 bool pending_read_; | 305 bool pending_read_; |
| 312 | 306 |
| 313 // Tracks if there's an outstanding av_seek_frame() operation. Used to discard | 307 // Tracks if there's an outstanding av_seek_frame() operation. Used to discard |
| 314 // results of pre-seek av_read_frame() operations. | 308 // results of pre-seek av_read_frame() operations. |
| 315 PipelineStatusCB pending_seek_cb_; | 309 PipelineStatusCB pending_seek_cb_; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 base::WeakPtr<FFmpegDemuxer> weak_this_; | 371 base::WeakPtr<FFmpegDemuxer> weak_this_; |
| 378 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; | 372 base::WeakPtrFactory<FFmpegDemuxer> cancel_pending_seek_factory_; |
| 379 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; | 373 base::WeakPtrFactory<FFmpegDemuxer> weak_factory_; |
| 380 | 374 |
| 381 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 375 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 382 }; | 376 }; |
| 383 | 377 |
| 384 } // namespace media | 378 } // namespace media |
| 385 | 379 |
| 386 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 380 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |