diff mbox series

[FFmpeg-devel,v2,01/11] avfilter/overlay_vaapi: use FILTER_SINGLE_PIXFMT

Message ID 6ec5e9960b725a21a4b0dad188d4eddd8b3571c5.1667197207.git.ffmpegagent@gmail.com
State New
Headers show
Series Fixes and Enhancements for VAAPI Overlay | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Aman Karmani Oct. 31, 2022, 6:19 a.m. UTC
From: softworkz <softworkz@hotmail.com>

Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

Comments

Xiang, Haihao Nov. 4, 2022, 2:07 a.m. UTC | #1
On Mon, 2022-10-31 at 06:19 +0000, softworkz wrote:
> From: softworkz <softworkz@hotmail.com>
> 
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
>  libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
>  1 file changed, 1 insertion(+), 29 deletions(-)
> 
> diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> index 3e6a0de13f..218daf571f 100644
> --- a/libavfilter/vf_overlay_vaapi.c
> +++ b/libavfilter/vf_overlay_vaapi.c
> @@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
>      float            alpha;
>  } OverlayVAAPIContext;
>  
> -static int overlay_vaapi_query_formats(AVFilterContext *ctx)
> -{
> -    int ret;
> -    enum {
> -        MAIN    = 0,
> -        OVERLAY = 1,
> -    };
> -
> -    static const enum AVPixelFormat pix_fmts[] = {
> -        AV_PIX_FMT_VAAPI,
> -        AV_PIX_FMT_NONE
> -    };
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]-
> >outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx-
> >inputs[OVERLAY]->outcfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]-
> >incfg.formats);
> -    if (ret < 0)
> -        return ret;
> -
> -    return 0;
> -}
> -
>  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
>  {
>      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> @@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
>      .activate        = &overlay_vaapi_activate,
>      FILTER_INPUTS(overlay_vaapi_inputs),
>      FILTER_OUTPUTS(overlay_vaapi_outputs),
> -    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
> +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
>      .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
>  };

Patchset LGTM, will apply

-Haihao
Xiang, Haihao Nov. 7, 2022, 3:10 a.m. UTC | #2
On Fri, 2022-11-04 at 02:07 +0000, Xiang, Haihao wrote:
> On Mon, 2022-10-31 at 06:19 +0000, softworkz wrote:
> > From: softworkz <softworkz@hotmail.com>
> > 
> > Signed-off-by: softworkz <softworkz@hotmail.com>
> > ---
> >  libavfilter/vf_overlay_vaapi.c | 30 +-----------------------------
> >  1 file changed, 1 insertion(+), 29 deletions(-)
> > 
> > diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
> > index 3e6a0de13f..218daf571f 100644
> > --- a/libavfilter/vf_overlay_vaapi.c
> > +++ b/libavfilter/vf_overlay_vaapi.c
> > @@ -38,34 +38,6 @@ typedef struct OverlayVAAPIContext {
> >      float            alpha;
> >  } OverlayVAAPIContext;
> >  
> > -static int overlay_vaapi_query_formats(AVFilterContext *ctx)
> > -{
> > -    int ret;
> > -    enum {
> > -        MAIN    = 0,
> > -        OVERLAY = 1,
> > -    };
> > -
> > -    static const enum AVPixelFormat pix_fmts[] = {
> > -        AV_PIX_FMT_VAAPI,
> > -        AV_PIX_FMT_NONE
> > -    };
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]-
> > > outcfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx-
> > > inputs[OVERLAY]->outcfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]-
> > > incfg.formats);
> > -    if (ret < 0)
> > -        return ret;
> > -
> > -    return 0;
> > -}
> > -
> >  static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
> >  {
> >      VAAPIVPPContext *vpp_ctx   = avctx->priv;
> > @@ -418,6 +390,6 @@ const AVFilter ff_vf_overlay_vaapi = {
> >      .activate        = &overlay_vaapi_activate,
> >      FILTER_INPUTS(overlay_vaapi_inputs),
> >      FILTER_OUTPUTS(overlay_vaapi_outputs),
> > -    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
> > +    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
> >      .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
> >  };
> 
> Patchset LGTM, will apply
> 

Pushed,

-Haihao
diff mbox series

Patch

diff --git a/libavfilter/vf_overlay_vaapi.c b/libavfilter/vf_overlay_vaapi.c
index 3e6a0de13f..218daf571f 100644
--- a/libavfilter/vf_overlay_vaapi.c
+++ b/libavfilter/vf_overlay_vaapi.c
@@ -38,34 +38,6 @@  typedef struct OverlayVAAPIContext {
     float            alpha;
 } OverlayVAAPIContext;
 
-static int overlay_vaapi_query_formats(AVFilterContext *ctx)
-{
-    int ret;
-    enum {
-        MAIN    = 0,
-        OVERLAY = 1,
-    };
-
-    static const enum AVPixelFormat pix_fmts[] = {
-        AV_PIX_FMT_VAAPI,
-        AV_PIX_FMT_NONE
-    };
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[MAIN]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[OVERLAY]->outcfg.formats);
-    if (ret < 0)
-        return ret;
-
-    ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->outputs[0]->incfg.formats);
-    if (ret < 0)
-        return ret;
-
-    return 0;
-}
-
 static int overlay_vaapi_build_filter_params(AVFilterContext *avctx)
 {
     VAAPIVPPContext *vpp_ctx   = avctx->priv;
@@ -418,6 +390,6 @@  const AVFilter ff_vf_overlay_vaapi = {
     .activate        = &overlay_vaapi_activate,
     FILTER_INPUTS(overlay_vaapi_inputs),
     FILTER_OUTPUTS(overlay_vaapi_outputs),
-    FILTER_QUERY_FUNC(overlay_vaapi_query_formats),
+    FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VAAPI),
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
 };