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

Unified Diff: media/filters/ffmpeg_video_decode_engine.h

Issue 3014059: media: recycle buffers/direct rendering etc. (third patch) (Closed)
Patch Set: code review Created 10 years, 4 months 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/filters/ffmpeg_video_allocator.h ('k') | media/filters/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decode_engine.h
diff --git a/media/filters/ffmpeg_video_decode_engine.h b/media/filters/ffmpeg_video_decode_engine.h
index b12c87ef4331f2d2832357082cc0185854083417..fbb465aab1ba2a1f248af13834078268c3127f65 100644
--- a/media/filters/ffmpeg_video_decode_engine.h
+++ b/media/filters/ffmpeg_video_decode_engine.h
@@ -5,6 +5,8 @@
#ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODE_ENGINE_H_
#define MEDIA_FILTERS_FFMPEG_VIDEO_DECODE_ENGINE_H_
+#include <deque>
+
#include "base/scoped_ptr.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/filters/video_decode_engine.h"
@@ -16,6 +18,8 @@ struct AVStream;
namespace media {
+class FFmpegVideoAllocator;
+
class FFmpegVideoDecodeEngine : public VideoDecodeEngine {
public:
FFmpegVideoDecodeEngine();
@@ -40,12 +44,39 @@ class FFmpegVideoDecodeEngine : public VideoDecodeEngine {
VideoFrame::Format GetSurfaceFormat() const;
private:
void DecodeFrame(scoped_refptr<Buffer> buffer);
+ void ReadInput();
+ void TryToFinishPendingFlush();
AVCodecContext* codec_context_;
AVStream* av_stream_;
scoped_ptr_malloc<AVFrame, ScopedPtrAVFree> av_frame_;
VideoDecodeEngine::EventHandler* event_handler_;
+ // Whether direct rendering is used.
+ bool direct_rendering_;
+
+ // Used when direct rendering is used to recycle output buffers.
+ scoped_ptr<FFmpegVideoAllocator> allocator_;
+
+ // 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/filters/ffmpeg_video_allocator.h ('k') | media/filters/ffmpeg_video_decode_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698