[FFmpeg-devel] [PATCH 066/218] avfilter/vf_curves: Use formats list instead of query function
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Thu Sep 30 16:40:07 EEST 2021
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
libavfilter/vf_curves.c | 35 +++++++++++++----------------------
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index 4aeb9e36ae..22a1f8aa70 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -513,27 +513,6 @@ static av_cold int curves_init(AVFilterContext *ctx)
return 0;
}
-static int query_formats(AVFilterContext *ctx)
-{
- static const enum AVPixelFormat 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,
- AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR,
- AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0,
- AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48,
- AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
- AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
- AV_PIX_FMT_GBRP9,
- AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10,
- AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12,
- AV_PIX_FMT_GBRP14,
- AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16,
- AV_PIX_FMT_NONE
- };
- return ff_set_common_formats_from_list(ctx, pix_fmts);
-}
-
static int filter_slice_packed(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
{
int x, y;
@@ -817,7 +796,19 @@ const AVFilter ff_vf_curves = {
.uninit = curves_uninit,
FILTER_INPUTS(curves_inputs),
FILTER_OUTPUTS(curves_outputs),
- FILTER_QUERY_FUNC(query_formats),
+ FILTER_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
+ AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA,
+ AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR,
+ AV_PIX_FMT_0RGB, AV_PIX_FMT_0BGR,
+ AV_PIX_FMT_RGB0, AV_PIX_FMT_BGR0,
+ AV_PIX_FMT_RGB48, AV_PIX_FMT_BGR48,
+ AV_PIX_FMT_RGBA64, AV_PIX_FMT_BGRA64,
+ AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP,
+ AV_PIX_FMT_GBRP9,
+ AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10,
+ AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12,
+ AV_PIX_FMT_GBRP14,
+ AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16),
.priv_class = &curves_class,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command,
--
2.30.2
More information about the ffmpeg-devel
mailing list