Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(993)

Unified Diff: media/filters/ffmpeg_video_decoder.h

Issue 8772069: Collapse FFmpegVideoDecodeEngine into FFmpegVideoDecoder and remove VideoDecodeEngine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698