| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | |
| 6 #define MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "media/video/video_decode_engine.h" | |
| 10 | |
| 11 struct AVCodecContext; | |
| 12 struct AVFrame; | |
| 13 | |
| 14 namespace media { | |
| 15 | |
| 16 class MEDIA_EXPORT FFmpegVideoDecodeEngine : public VideoDecodeEngine { | |
| 17 public: | |
| 18 FFmpegVideoDecodeEngine(); | |
| 19 virtual ~FFmpegVideoDecodeEngine(); | |
| 20 | |
| 21 // VideoDecodeEngine implementation. | |
| 22 virtual bool Initialize(const VideoDecoderConfig& config) OVERRIDE; | |
| 23 virtual void Uninitialize() OVERRIDE; | |
| 24 virtual bool Decode(const scoped_refptr<Buffer>& buffer, | |
| 25 scoped_refptr<VideoFrame>* video_frame) OVERRIDE; | |
| 26 virtual void Flush() OVERRIDE; | |
| 27 | |
| 28 private: | |
| 29 // Allocates a video frame based on the current format and dimensions based on | |
| 30 // the current state of |codec_context_|. | |
| 31 scoped_refptr<VideoFrame> AllocateVideoFrame(); | |
| 32 | |
| 33 // FFmpeg structures owned by this object. | |
| 34 AVCodecContext* codec_context_; | |
| 35 AVFrame* av_frame_; | |
| 36 | |
| 37 // Frame rate of the video. | |
| 38 int frame_rate_numerator_; | |
| 39 int frame_rate_denominator_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngine); | |
| 42 }; | |
| 43 | |
| 44 } // namespace media | |
| 45 | |
| 46 #endif // MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_ | |
| OLD | NEW |