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

Unified Diff: media/video/ffmpeg_video_decode_engine.h

Issue 8417019: Simplify VideoDecodeEngine interface by making everything synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for CaptureVideoDecoder Created 9 years, 1 month 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 | « media/media.gyp ('k') | media/video/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/ffmpeg_video_decode_engine.h
diff --git a/media/video/ffmpeg_video_decode_engine.h b/media/video/ffmpeg_video_decode_engine.h
index 3ac74118056ffe743d0b371290fe01bd344a0b30..072507abbb05a245efd29edb17a0fb58519628ab 100644
--- a/media/video/ffmpeg_video_decode_engine.h
+++ b/media/video/ffmpeg_video_decode_engine.h
@@ -5,13 +5,9 @@
#ifndef MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_
#define MEDIA_VIDEO_FFMPEG_VIDEO_DECODE_ENGINE_H_
-#include <deque>
-
-#include "base/memory/scoped_ptr.h"
-#include "media/ffmpeg/ffmpeg_common.h"
+#include "base/compiler_specific.h"
#include "media/video/video_decode_engine.h"
-// FFmpeg types.
struct AVCodecContext;
struct AVFrame;
@@ -22,47 +18,26 @@ class MEDIA_EXPORT FFmpegVideoDecodeEngine : public VideoDecodeEngine {
FFmpegVideoDecodeEngine();
virtual ~FFmpegVideoDecodeEngine();
- // Implementation of the VideoDecodeEngine Interface.
- virtual void Initialize(VideoDecodeEngine::EventHandler* event_handler,
- const VideoDecoderConfig& config);
- virtual void ConsumeVideoSample(scoped_refptr<Buffer> buffer);
- virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame);
- virtual void Uninitialize();
- virtual void Flush();
- virtual void Seek();
+ // VideoDecodeEngine implementation.
+ virtual bool Initialize(const VideoDecoderConfig& config) OVERRIDE;
+ virtual void Uninitialize() OVERRIDE;
+ virtual bool Decode(const scoped_refptr<Buffer>& buffer,
+ scoped_refptr<VideoFrame>* video_frame) OVERRIDE;
+ virtual void Flush() OVERRIDE;
private:
- void DecodeFrame(scoped_refptr<Buffer> buffer);
- void ReadInput();
- void TryToFinishPendingFlush();
+ // Allocates a video frame based on the current format and dimensions based on
+ // the current state of |codec_context_|.
+ scoped_refptr<VideoFrame> AllocateVideoFrame();
+ // FFmpeg structures owned by this object.
AVCodecContext* codec_context_;
- scoped_ptr_malloc<AVFrame, ScopedPtrAVFree> av_frame_;
- VideoDecodeEngine::EventHandler* event_handler_;
+ AVFrame* av_frame_;
// Frame rate of the video.
int frame_rate_numerator_;
int frame_rate_denominator_;
- // Indicate how many buffers are pending on input port of this filter:
- // Increment when engine receive one input packet from demuxer;
- // Decrement when engine send one input packet to demuxer;
- int pending_input_buffers_;
-
- // Indicate how many buffers are pending on output port of this filter:
- // Increment when engine receive one output frame from renderer;
- // Decrement when engine send one output frame to renderer;
- int pending_output_buffers_;
-
- // Whether end of stream had been reached at output side.
- bool output_eos_reached_;
-
- // Used when direct rendering is disabled to hold available output buffers.
- std::deque<scoped_refptr<VideoFrame> > frame_queue_available_;
-
- // Whether flush operation is pending.
- bool flush_pending_;
-
DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecodeEngine);
};
« no previous file with comments | « media/media.gyp ('k') | media/video/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698