| 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 18 matching lines...) Expand all Loading... |
| 29 #include "base/gtest_prod_util.h" | 29 #include "base/gtest_prod_util.h" |
| 30 #include "base/memory/scoped_vector.h" | 30 #include "base/memory/scoped_vector.h" |
| 31 #include "base/threading/thread.h" | 31 #include "base/threading/thread.h" |
| 32 #include "media/base/audio_decoder_config.h" | 32 #include "media/base/audio_decoder_config.h" |
| 33 #include "media/base/decoder_buffer.h" | 33 #include "media/base/decoder_buffer.h" |
| 34 #include "media/base/decoder_buffer_queue.h" | 34 #include "media/base/decoder_buffer_queue.h" |
| 35 #include "media/base/demuxer.h" | 35 #include "media/base/demuxer.h" |
| 36 #include "media/base/pipeline.h" | 36 #include "media/base/pipeline.h" |
| 37 #include "media/base/text_track_config.h" | 37 #include "media/base/text_track_config.h" |
| 38 #include "media/base/video_decoder_config.h" | 38 #include "media/base/video_decoder_config.h" |
| 39 #include "media/ffmpeg/ffmpeg_deleters.h" |
| 39 #include "media/filters/blocking_url_protocol.h" | 40 #include "media/filters/blocking_url_protocol.h" |
| 40 | 41 |
| 41 // FFmpeg forward declarations. | 42 // FFmpeg forward declarations. |
| 42 struct AVPacket; | 43 struct AVPacket; |
| 43 struct AVRational; | 44 struct AVRational; |
| 44 struct AVStream; | 45 struct AVStream; |
| 45 | 46 |
| 46 namespace media { | 47 namespace media { |
| 47 | 48 |
| 48 class MediaLog; | 49 class MediaLog; |
| 49 class FFmpegDemuxer; | 50 class FFmpegDemuxer; |
| 50 class FFmpegGlue; | 51 class FFmpegGlue; |
| 51 class FFmpegH264ToAnnexBBitstreamConverter; | 52 class FFmpegH264ToAnnexBBitstreamConverter; |
| 52 class ScopedPtrAVFreePacket; | |
| 53 | 53 |
| 54 typedef scoped_ptr_malloc<AVPacket, ScopedPtrAVFreePacket> ScopedAVPacket; | 54 typedef scoped_ptr<AVPacket, ScopedPtrAVFreePacket> ScopedAVPacket; |
| 55 | 55 |
| 56 class FFmpegDemuxerStream : public DemuxerStream { | 56 class FFmpegDemuxerStream : public DemuxerStream { |
| 57 public: | 57 public: |
| 58 // Keeps a copy of |demuxer| and initializes itself using information | 58 // Keeps a copy of |demuxer| and initializes itself using information |
| 59 // inside |stream|. Both parameters must outlive |this|. | 59 // inside |stream|. Both parameters must outlive |this|. |
| 60 FFmpegDemuxerStream(FFmpegDemuxer* demuxer, AVStream* stream); | 60 FFmpegDemuxerStream(FFmpegDemuxer* demuxer, AVStream* stream); |
| 61 virtual ~FFmpegDemuxerStream(); | 61 virtual ~FFmpegDemuxerStream(); |
| 62 | 62 |
| 63 // Enqueues the given AVPacket. It is invalid to queue a |packet| after | 63 // Enqueues the given AVPacket. It is invalid to queue a |packet| after |
| 64 // SetEndOfStream() has been called. | 64 // SetEndOfStream() has been called. |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 scoped_ptr<FFmpegGlue> glue_; | 263 scoped_ptr<FFmpegGlue> glue_; |
| 264 | 264 |
| 265 const NeedKeyCB need_key_cb_; | 265 const NeedKeyCB need_key_cb_; |
| 266 | 266 |
| 267 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); | 267 DISALLOW_COPY_AND_ASSIGN(FFmpegDemuxer); |
| 268 }; | 268 }; |
| 269 | 269 |
| 270 } // namespace media | 270 } // namespace media |
| 271 | 271 |
| 272 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ | 272 #endif // MEDIA_FILTERS_FFMPEG_DEMUXER_H_ |
| OLD | NEW |