1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avfilter/vsrc_testsrc: Use formats list instead of query function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-27 22:37:13 +02:00
parent a341c85c84
commit 34d822c82d

View File

@ -362,9 +362,7 @@ static av_cold int haldclutsrc_init(AVFilterContext *ctx)
return init(ctx);
}
static int haldclutsrc_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
static const enum AVPixelFormat haldclutsrc_pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
@ -375,9 +373,6 @@ static int haldclutsrc_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE,
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int haldclutsrc_config_props(AVFilterLink *outlink)
{
AVFilterContext *ctx = outlink->src;
@ -405,7 +400,7 @@ const AVFilter ff_vsrc_haldclutsrc = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(haldclutsrc_outputs),
FILTER_QUERY_FUNC(haldclutsrc_query_formats),
FILTER_PIXFMTS_ARRAY(haldclutsrc_pix_fmts),
};
#endif /* CONFIG_HALDCLUTSRC_FILTER */
@ -646,15 +641,6 @@ static av_cold int test_init(AVFilterContext *ctx)
return init(ctx);
}
static int test_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = {
{
.name = "default",
@ -673,7 +659,7 @@ const AVFilter ff_vsrc_testsrc = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(avfilter_vsrc_testsrc_outputs),
FILTER_QUERY_FUNC(test_query_formats),
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_RGB24),
};
#endif /* CONFIG_TESTSRC_FILTER */
@ -1072,9 +1058,7 @@ static av_cold int rgbtest_init(AVFilterContext *ctx)
return init(ctx);
}
static int rgbtest_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
static const enum AVPixelFormat rgbtest_pix_fmts[] = {
AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_BGRA, AV_PIX_FMT_ABGR,
AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24,
AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444,
@ -1085,9 +1069,6 @@ static int rgbtest_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int rgbtest_config_props(AVFilterLink *outlink)
{
TestSourceContext *test = outlink->src->priv;
@ -1116,7 +1097,7 @@ const AVFilter ff_vsrc_rgbtestsrc = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(avfilter_vsrc_rgbtestsrc_outputs),
FILTER_QUERY_FUNC(rgbtest_query_formats),
FILTER_PIXFMTS_ARRAY(rgbtest_pix_fmts),
};
#endif /* CONFIG_RGBTESTSRC_FILTER */
@ -1245,9 +1226,7 @@ static av_cold int yuvtest_init(AVFilterContext *ctx)
return init(ctx);
}
static int yuvtest_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
static const enum AVPixelFormat yuvtest_pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P,
AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P10,
AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14,
@ -1255,9 +1234,6 @@ static int yuvtest_query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static int yuvtest_config_props(AVFilterLink *outlink)
{
TestSourceContext *test = outlink->src->priv;
@ -1285,7 +1261,7 @@ const AVFilter ff_vsrc_yuvtestsrc = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(avfilter_vsrc_yuvtestsrc_outputs),
FILTER_QUERY_FUNC(yuvtest_query_formats),
FILTER_PIXFMTS_ARRAY(yuvtest_pix_fmts),
};
#endif /* CONFIG_YUVTESTSRC_FILTER */
@ -1394,18 +1370,13 @@ static void draw_bar(TestSourceContext *test, const uint8_t color[4],
}
}
static int smptebars_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
static const enum AVPixelFormat smptebars_pix_fmts[] = {
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P,
AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_NONE,
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad smptebars_outputs[] = {
{
.name = "default",
@ -1457,7 +1428,7 @@ const AVFilter ff_vsrc_pal75bars = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(smptebars_outputs),
FILTER_QUERY_FUNC(smptebars_query_formats),
FILTER_PIXFMTS_ARRAY(smptebars_pix_fmts),
};
#endif /* CONFIG_PAL75BARS_FILTER */
@ -1501,7 +1472,7 @@ const AVFilter ff_vsrc_pal100bars = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(smptebars_outputs),
FILTER_QUERY_FUNC(smptebars_query_formats),
FILTER_PIXFMTS_ARRAY(smptebars_pix_fmts),
};
#endif /* CONFIG_PAL100BARS_FILTER */
@ -1568,7 +1539,7 @@ const AVFilter ff_vsrc_smptebars = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(smptebars_outputs),
FILTER_QUERY_FUNC(smptebars_query_formats),
FILTER_PIXFMTS_ARRAY(smptebars_pix_fmts),
};
#endif /* CONFIG_SMPTEBARS_FILTER */
@ -1671,7 +1642,7 @@ const AVFilter ff_vsrc_smptehdbars = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(smptebars_outputs),
FILTER_QUERY_FUNC(smptebars_query_formats),
FILTER_PIXFMTS_ARRAY(smptebars_pix_fmts),
};
#endif /* CONFIG_SMPTEHDBARS_FILTER */
@ -1717,16 +1688,6 @@ static av_cold int allyuv_init(AVFilterContext *ctx)
return init(ctx);
}
static int allyuv_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUV444P, AV_PIX_FMT_GBRP,
AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_allyuv_outputs[] = {
{
.name = "default",
@ -1745,7 +1706,7 @@ const AVFilter ff_vsrc_allyuv = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(avfilter_vsrc_allyuv_outputs),
FILTER_QUERY_FUNC(allyuv_query_formats),
FILTER_PIXFMTS(AV_PIX_FMT_YUV444P, AV_PIX_FMT_GBRP),
};
#endif /* CONFIG_ALLYUV_FILTER */
@ -1788,15 +1749,6 @@ static int allrgb_config_props(AVFilterLink *outlink)
return config_props(outlink);
}
static int allrgb_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE
};
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
static const AVFilterPad avfilter_vsrc_allrgb_outputs[] = {
{
.name = "default",
@ -1815,7 +1767,7 @@ const AVFilter ff_vsrc_allrgb = {
.activate = activate,
.inputs = NULL,
FILTER_OUTPUTS(avfilter_vsrc_allrgb_outputs),
FILTER_QUERY_FUNC(allrgb_query_formats),
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_RGB24),
};
#endif /* CONFIG_ALLRGB_FILTER */