[FFmpeg-devel] [PATCH 2/3] ffmpeg: Remove get_buffer override

Mark Thompson sw at jkqxz.net
Sun Nov 11 17:32:14 EET 2018


Since nothing sets hwaccel_get_buffer any more, this is always equivalent
to the default case.
---
 fftools/ffmpeg.c | 11 -----------
 fftools/ffmpeg.h |  1 -
 2 files changed, 12 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 38c21e944a..e0ffd1b779 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2875,16 +2875,6 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
     return *p;
 }
 
-static int get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
-{
-    InputStream *ist = s->opaque;
-
-    if (ist->hwaccel_get_buffer && frame->format == ist->hwaccel_pix_fmt)
-        return ist->hwaccel_get_buffer(s, frame, flags);
-
-    return avcodec_default_get_buffer2(s, frame, flags);
-}
-
 static int init_input_stream(int ist_index, char *error, int error_len)
 {
     int ret;
@@ -2900,7 +2890,6 @@ static int init_input_stream(int ist_index, char *error, int error_len)
 
         ist->dec_ctx->opaque                = ist;
         ist->dec_ctx->get_format            = get_format;
-        ist->dec_ctx->get_buffer2           = get_buffer;
         ist->dec_ctx->thread_safe_callbacks = 1;
 
         av_opt_set_int(ist->dec_ctx, "refcounted_frames", 1, 0);
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index eb1eaf6363..ae406aae2f 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -369,7 +369,6 @@ typedef struct InputStream {
     /* hwaccel context */
     void  *hwaccel_ctx;
     void (*hwaccel_uninit)(AVCodecContext *s);
-    int  (*hwaccel_get_buffer)(AVCodecContext *s, AVFrame *frame, int flags);
     int  (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
     enum AVPixelFormat hwaccel_pix_fmt;
     enum AVPixelFormat hwaccel_retrieved_pix_fmt;
-- 
2.19.1



More information about the ffmpeg-devel mailing list