diff mbox series

[FFmpeg-devel,2/3] ffmpeg: remove unused hwaccel_get_buffer function pointer

Message ID 20211114185956.53923-2-jamrial@gmail.com
State Accepted
Commit 379f8b8ec6213789afc174d57c2751c52e66a8a7
Headers show
Series [FFmpeg-devel,1/3] ffmpeg: allocate the output hwaccel AVFrame only once
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

James Almer Nov. 14, 2021, 6:59 p.m. UTC
As well as the custom get_buffer2() implementation which would become a
redundant wrapper for avcodec_default_get_buffer2() after this

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg.c | 11 -----------
 fftools/ffmpeg.h |  1 -
 2 files changed, 12 deletions(-)

Comments

James Almer Nov. 19, 2021, 3:56 p.m. UTC | #1
On 11/14/2021 3:59 PM, James Almer wrote:
> As well as the custom get_buffer2() implementation which would become a
> redundant wrapper for avcodec_default_get_buffer2() after this
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>   fftools/ffmpeg.c | 11 -----------
>   fftools/ffmpeg.h |  1 -
>   2 files changed, 12 deletions(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 26030ed25e..bde5a2f603 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -2938,16 +2938,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;
> @@ -2963,7 +2953,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;
>   #if LIBAVCODEC_VERSION_MAJOR < 60
>   FF_DISABLE_DEPRECATION_WARNINGS
>           ist->dec_ctx->thread_safe_callbacks = 1;
> diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
> index 17135cb830..2d6c5416c4 100644
> --- a/fftools/ffmpeg.h
> +++ b/fftools/ffmpeg.h
> @@ -377,7 +377,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;

Will apply this and PATCH 3/3.
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 26030ed25e..bde5a2f603 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2938,16 +2938,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;
@@ -2963,7 +2953,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;
 #if LIBAVCODEC_VERSION_MAJOR < 60
 FF_DISABLE_DEPRECATION_WARNINGS
         ist->dec_ctx->thread_safe_callbacks = 1;
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 17135cb830..2d6c5416c4 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -377,7 +377,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;