diff mbox series

[FFmpeg-devel,v3,1/5] avfilter/vf_yadif_cuda: simplify filter definition

Message ID 20211216202858.77643-1-ffmpeg@tmm1.net
State New
Headers show
Series [FFmpeg-devel,v3,1/5] avfilter/vf_yadif_cuda: simplify filter definition | expand

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

Aman Karmani Dec. 16, 2021, 8:28 p.m. UTC
From: Aman Karmani <aman@tmm1.net>

Signed-off-by: Aman Karmani <aman@tmm1.net>
---
 libavfilter/vf_yadif_cuda.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

Comments

Philip Langdale Dec. 17, 2021, 3:30 a.m. UTC | #1
On Thu, 16 Dec 2021 12:28:54 -0800
Aman Karmani <ffmpeg@tmm1.net> wrote:

> From: Aman Karmani <aman@tmm1.net>
> 
> Signed-off-by: Aman Karmani <aman@tmm1.net>
> ---
>  libavfilter/vf_yadif_cuda.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/libavfilter/vf_yadif_cuda.c b/libavfilter/vf_yadif_cuda.c
> index da1ab5a8ff..685b8a2035 100644
> --- a/libavfilter/vf_yadif_cuda.c
> +++ b/libavfilter/vf_yadif_cuda.c
> @@ -212,23 +212,6 @@ static av_cold void
> deint_cuda_uninit(AVFilterContext *ctx) s->input_frames = NULL;
>  }
>  
> -static int deint_cuda_query_formats(AVFilterContext *ctx)
> -{
> -    enum AVPixelFormat pix_fmts[] = {
> -        AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
> -    };
> -    int ret;
> -
> -    if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts),
> -                              &ctx->inputs[0]->outcfg.formats)) < 0)
> -        return ret;
> -    if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts),
> -                              &ctx->outputs[0]->incfg.formats)) < 0)
> -        return ret;
> -
> -    return 0;
> -}
> -
>  static int config_input(AVFilterLink *inlink)
>  {
>      AVFilterContext *ctx = inlink->dst;
> @@ -380,9 +363,9 @@ const AVFilter ff_vf_yadif_cuda = {
>      .priv_size      = sizeof(DeintCUDAContext),
>      .priv_class     = &yadif_cuda_class,
>      .uninit         = deint_cuda_uninit,
> +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_CUDA),
>      FILTER_INPUTS(deint_cuda_inputs),
>      FILTER_OUTPUTS(deint_cuda_outputs),
> -    FILTER_QUERY_FUNC(deint_cuda_query_formats),
>      .flags          = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
>      .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
>  };

LGTM. Thanks.

--phil
diff mbox series

Patch

diff --git a/libavfilter/vf_yadif_cuda.c b/libavfilter/vf_yadif_cuda.c
index da1ab5a8ff..685b8a2035 100644
--- a/libavfilter/vf_yadif_cuda.c
+++ b/libavfilter/vf_yadif_cuda.c
@@ -212,23 +212,6 @@  static av_cold void deint_cuda_uninit(AVFilterContext *ctx)
     s->input_frames = NULL;
 }
 
-static int deint_cuda_query_formats(AVFilterContext *ctx)
-{
-    enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,
-    };
-    int ret;
-
-    if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts),
-                              &ctx->inputs[0]->outcfg.formats)) < 0)
-        return ret;
-    if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts),
-                              &ctx->outputs[0]->incfg.formats)) < 0)
-        return ret;
-
-    return 0;
-}
-
 static int config_input(AVFilterLink *inlink)
 {
     AVFilterContext *ctx = inlink->dst;
@@ -380,9 +363,9 @@  const AVFilter ff_vf_yadif_cuda = {
     .priv_size      = sizeof(DeintCUDAContext),
     .priv_class     = &yadif_cuda_class,
     .uninit         = deint_cuda_uninit,
+    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_CUDA),
     FILTER_INPUTS(deint_cuda_inputs),
     FILTER_OUTPUTS(deint_cuda_outputs),
-    FILTER_QUERY_FUNC(deint_cuda_query_formats),
     .flags          = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
 };