Index: media/filters/ffmpeg_video_decoder.h |
diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h |
index e89bcbda1acffba2c869a53ca700e0e7beccba7b..34cf700adb0c8877881b80338681eb9bca30b4ca 100644 |
--- a/media/filters/ffmpeg_video_decoder.h |
+++ b/media/filters/ffmpeg_video_decoder.h |
@@ -14,9 +14,10 @@ |
class MessageLoop; |
-namespace media { |
+struct AVCodecContext; |
+struct AVFrame; |
-class VideoDecodeEngine; |
+namespace media { |
class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
public: |
@@ -53,20 +54,37 @@ class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
// Carries out the decoding operation scheduled by DecodeBuffer(). |
void DoDecodeBuffer(const scoped_refptr<Buffer>& buffer); |
+ bool Decode(const scoped_refptr<Buffer>& buffer, |
+ scoped_refptr<VideoFrame>* video_frame); |
// Delivers the frame to |read_cb_| and resets the callback. |
void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); |
+ // Releases resources associated with |codec_context_| and |av_frame_| |
+ // and resets them to NULL. |
+ void ReleaseFFmpegResources(); |
+ |
+ // Allocates a video frame based on the current format and dimensions based on |
+ // the current state of |codec_context_|. |
+ scoped_refptr<VideoFrame> AllocateVideoFrame(); |
+ |
MessageLoop* message_loop_; |
PtsStream pts_stream_; |
DecoderState state_; |
- scoped_ptr<VideoDecodeEngine> decode_engine_; |
StatisticsCallback statistics_callback_; |
ReadCB read_cb_; |
+ // FFmpeg structures owned by this object. |
+ AVCodecContext* codec_context_; |
+ AVFrame* av_frame_; |
+ |
+ // Frame rate of the video. |
+ int frame_rate_numerator_; |
+ int frame_rate_denominator_; |
+ |
// TODO(scherkus): I think this should be calculated by VideoRenderers based |
// on information provided by VideoDecoders (i.e., aspect ratio). |
gfx::Size natural_size_; |