| 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" | |
| 13 #include "media/base/video_decoder.h" | 12 #include "media/base/video_decoder.h" |
| 14 #include "media/base/video_decoder_config.h" | 13 #include "media/base/video_decoder_config.h" |
| 15 #include "media/base/video_frame_pool.h" | 14 #include "media/base/video_frame_pool.h" |
| 16 #include "media/ffmpeg/ffmpeg_deleters.h" | 15 #include "media/ffmpeg/ffmpeg_deleters.h" |
| 17 | 16 |
| 18 struct AVCodecContext; | 17 struct AVCodecContext; |
| 19 struct AVFrame; | 18 struct AVFrame; |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class SingleThreadTaskRunner; | 21 class SingleThreadTaskRunner; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool ConfigureDecoder(); | 63 bool ConfigureDecoder(); |
| 65 | 64 |
| 66 // Releases resources associated with |codec_context_| and |av_frame_| | 65 // Releases resources associated with |codec_context_| and |av_frame_| |
| 67 // and resets them to NULL. | 66 // and resets them to NULL. |
| 68 void ReleaseFFmpegResources(); | 67 void ReleaseFFmpegResources(); |
| 69 | 68 |
| 70 // Reset decoder and call |reset_cb_|. | 69 // Reset decoder and call |reset_cb_|. |
| 71 void DoReset(); | 70 void DoReset(); |
| 72 | 71 |
| 73 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 72 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 74 base::WeakPtrFactory<FFmpegVideoDecoder> weak_factory_; | |
| 75 base::WeakPtr<FFmpegVideoDecoder> weak_this_; | |
| 76 | 73 |
| 77 DecoderState state_; | 74 DecoderState state_; |
| 78 | 75 |
| 79 DecodeCB decode_cb_; | 76 DecodeCB decode_cb_; |
| 80 base::Closure reset_cb_; | 77 base::Closure reset_cb_; |
| 81 | 78 |
| 82 // FFmpeg structures owned by this object. | 79 // FFmpeg structures owned by this object. |
| 83 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; | 80 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; |
| 84 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; | 81 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; |
| 85 | 82 |
| 86 VideoDecoderConfig config_; | 83 VideoDecoderConfig config_; |
| 87 | 84 |
| 88 VideoFramePool frame_pool_; | 85 VideoFramePool frame_pool_; |
| 89 | 86 |
| 90 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 87 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 91 }; | 88 }; |
| 92 | 89 |
| 93 } // namespace media | 90 } // namespace media |
| 94 | 91 |
| 95 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 92 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |