| 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 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "media/base/video_decoder.h" | 13 #include "media/base/video_decoder.h" |
| 14 #include "media/base/video_decoder_config.h" | 14 #include "media/base/video_decoder_config.h" |
| 15 #include "media/base/video_frame_pool.h" | 15 #include "media/base/video_frame_pool.h" |
| 16 #include "media/ffmpeg/ffmpeg_deleters.h" |
| 16 | 17 |
| 17 struct AVCodecContext; | 18 struct AVCodecContext; |
| 18 struct AVFrame; | 19 struct AVFrame; |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 class SingleThreadTaskRunner; | 22 class SingleThreadTaskRunner; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace media { | 25 namespace media { |
| 25 | 26 |
| 26 class DecoderBuffer; | 27 class DecoderBuffer; |
| 27 class ScopedPtrAVFreeContext; | |
| 28 class ScopedPtrAVFreeFrame; | |
| 29 | 28 |
| 30 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { | 29 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
| 31 public: | 30 public: |
| 32 explicit FFmpegVideoDecoder( | 31 explicit FFmpegVideoDecoder( |
| 33 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 32 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 34 virtual ~FFmpegVideoDecoder(); | 33 virtual ~FFmpegVideoDecoder(); |
| 35 | 34 |
| 36 // VideoDecoder implementation. | 35 // VideoDecoder implementation. |
| 37 virtual void Initialize(const VideoDecoderConfig& config, | 36 virtual void Initialize(const VideoDecoderConfig& config, |
| 38 const PipelineStatusCB& status_cb) OVERRIDE; | 37 const PipelineStatusCB& status_cb) OVERRIDE; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 73 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 75 base::WeakPtrFactory<FFmpegVideoDecoder> weak_factory_; | 74 base::WeakPtrFactory<FFmpegVideoDecoder> weak_factory_; |
| 76 base::WeakPtr<FFmpegVideoDecoder> weak_this_; | 75 base::WeakPtr<FFmpegVideoDecoder> weak_this_; |
| 77 | 76 |
| 78 DecoderState state_; | 77 DecoderState state_; |
| 79 | 78 |
| 80 DecodeCB decode_cb_; | 79 DecodeCB decode_cb_; |
| 81 base::Closure reset_cb_; | 80 base::Closure reset_cb_; |
| 82 | 81 |
| 83 // FFmpeg structures owned by this object. | 82 // FFmpeg structures owned by this object. |
| 84 scoped_ptr_malloc<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; | 83 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; |
| 85 scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame_; | 84 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; |
| 86 | 85 |
| 87 VideoDecoderConfig config_; | 86 VideoDecoderConfig config_; |
| 88 | 87 |
| 89 VideoFramePool frame_pool_; | 88 VideoFramePool frame_pool_; |
| 90 | 89 |
| 91 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 90 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace media | 93 } // namespace media |
| 95 | 94 |
| 96 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 95 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |