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

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h

Issue 1645543003: H264: Improve FFmpeg decoder performance by using I420BufferPool. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: common_video not unnecessarily depending on webrtc_h264, fixed circular dependency Created 4 years, 10 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
Index: webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
index f5924fccc1d15e8b505919f4569b024d3e85087e..357d981948d34fb3465de76637f83b9994aa726c 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
+++ b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.h
@@ -19,6 +19,7 @@ extern "C" {
} // extern "C"
#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/common_video/include/i420_buffer_pool.h"
namespace webrtc {
@@ -52,8 +53,17 @@ class H264DecoderImpl : public H264Decoder {
int64_t render_time_ms = -1) override;
private:
+ // Called by FFmpeg when it needs a frame buffer to store decoded frames in.
+ // The |VideoFrame| returned by FFmpeg at |Decode| originate from here. Their
+ // buffers are reference counted and freed by FFmpeg using |AVFreeBuffer2|.
+ static int AVGetBuffer2(
+ AVCodecContext* context, AVFrame* av_frame, int flags);
+ // Called by FFmpeg when it is done with a video frame, see |AVGetBuffer2|.
+ static void AVFreeBuffer2(void* opaque, uint8_t* data);
+
bool IsInitialized() const;
+ I420BufferPool pool_;
rtc::scoped_ptr<AVCodecContext, AVCodecContextDeleter> av_context_;
rtc::scoped_ptr<AVFrame, AVFrameDeleter> av_frame_;
« no previous file with comments | « webrtc/modules/video_coding/codecs/h264/h264.gypi ('k') | webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698