mirror of https://git.ffmpeg.org/ffmpeg.git
lavfi/*_vaapi: switch to query_func2()
Also, drop redundant calls that also happen implicitly in generic code.
This commit is contained in:
parent
194e1ca03f
commit
c1d7814dca
|
@ -26,22 +26,17 @@
|
|||
#include "formats.h"
|
||||
#include "vaapi_vpp.h"
|
||||
|
||||
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx)
|
||||
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx,
|
||||
AVFilterFormatsConfig **cfg_in,
|
||||
AVFilterFormatsConfig **cfg_out)
|
||||
{
|
||||
enum AVPixelFormat pix_fmts[] = {
|
||||
static const enum AVPixelFormat pix_fmts[] = {
|
||||
AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE,
|
||||
};
|
||||
int err;
|
||||
|
||||
if ((err = ff_formats_ref(ff_make_format_list(pix_fmts),
|
||||
&avctx->inputs[0]->outcfg.formats)) < 0)
|
||||
return err;
|
||||
if ((err = ff_formats_ref(ff_make_format_list(pix_fmts),
|
||||
&avctx->outputs[0]->incfg.formats)) < 0)
|
||||
return err;
|
||||
|
||||
if ((err = ff_set_common_all_color_spaces(avctx)) < 0 ||
|
||||
(err = ff_set_common_all_color_ranges(avctx)) < 0)
|
||||
err = ff_set_common_formats_from_list2(avctx, cfg_in, cfg_out, pix_fmts);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -67,7 +67,9 @@ void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx);
|
|||
|
||||
void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx);
|
||||
|
||||
int ff_vaapi_vpp_query_formats(AVFilterContext *avctx);
|
||||
int ff_vaapi_vpp_query_formats(const AVFilterContext *avctx,
|
||||
AVFilterFormatsConfig **cfg_in,
|
||||
AVFilterFormatsConfig **cfg_out);
|
||||
|
||||
void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx);
|
||||
|
||||
|
|
|
@ -425,7 +425,7 @@ const AVFilter ff_vf_deinterlace_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(deint_vaapi_inputs),
|
||||
FILTER_OUTPUTS(deint_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &deint_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -364,6 +364,6 @@ const AVFilter ff_vf_drawbox_vaapi = {
|
|||
.uninit = &drawbox_vaapi_uninit,
|
||||
FILTER_INPUTS(drawbox_vaapi_inputs),
|
||||
FILTER_OUTPUTS(drawbox_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -249,7 +249,7 @@ const AVFilter ff_vf_denoise_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(misc_vaapi_inputs),
|
||||
FILTER_OUTPUTS(misc_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &denoise_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
@ -262,7 +262,7 @@ const AVFilter ff_vf_sharpness_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(misc_vaapi_inputs),
|
||||
FILTER_OUTPUTS(misc_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &sharpness_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -278,6 +278,6 @@ const AVFilter ff_vf_pad_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(pad_vaapi_inputs),
|
||||
FILTER_OUTPUTS(pad_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -247,7 +247,7 @@ const AVFilter ff_vf_procamp_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(procamp_vaapi_inputs),
|
||||
FILTER_OUTPUTS(procamp_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &procamp_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -299,7 +299,7 @@ const AVFilter ff_vf_scale_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(scale_vaapi_inputs),
|
||||
FILTER_OUTPUTS(scale_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &scale_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -567,7 +567,7 @@ const AVFilter ff_vf_tonemap_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(tonemap_vaapi_inputs),
|
||||
FILTER_OUTPUTS(tonemap_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &tonemap_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
|
@ -280,7 +280,7 @@ const AVFilter ff_vf_transpose_vaapi = {
|
|||
.uninit = &ff_vaapi_vpp_ctx_uninit,
|
||||
FILTER_INPUTS(transpose_vaapi_inputs),
|
||||
FILTER_OUTPUTS(transpose_vaapi_outputs),
|
||||
FILTER_QUERY_FUNC(&ff_vaapi_vpp_query_formats),
|
||||
FILTER_QUERY_FUNC2(&ff_vaapi_vpp_query_formats),
|
||||
.priv_class = &transpose_vaapi_class,
|
||||
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue