diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-27 16:42:25 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-05 18:58:24 +0200 |
commit | 253dc9bbc0f708275e49f85adbd1e95037894f2b (patch) | |
tree | 88b165b1c99404358a16d6c48f520abfa742e0c9 /libavfilter/vf_chromashift.c | |
parent | 17e44e4d1fd2d6c18e2813f3acff2fe5eab7afcd (diff) | |
download | ffmpeg-253dc9bbc0f708275e49f85adbd1e95037894f2b.tar.gz |
avfilter/vf_chromashift: Use formats list instead of query function
In this case it also allows to avoid a runtime check to which filter
an AVFilterContext belongs to.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_chromashift.c')
-rw-r--r-- | libavfilter/vf_chromashift.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c index 18e362adb8..1e85530485 100644 --- a/libavfilter/vf_chromashift.c +++ b/libavfilter/vf_chromashift.c @@ -52,8 +52,6 @@ typedef struct ChromaShiftContext { int (*filter_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); } ChromaShiftContext; -static int query_formats(AVFilterContext *ctx) -{ static const enum AVPixelFormat yuv_pix_fmts[] = { AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ422P,AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ411P, @@ -75,15 +73,6 @@ static int query_formats(AVFilterContext *ctx) AV_PIX_FMT_GBRAP10, AV_PIX_FMT_GBRAP12, AV_PIX_FMT_GBRAP16, AV_PIX_FMT_NONE }; - const enum AVPixelFormat *pix_fmts; - - if (!strcmp(ctx->filter->name, "rgbashift")) - pix_fmts = rgb_pix_fmts; - else - pix_fmts = yuv_pix_fmts; - - return ff_set_common_formats_from_list(ctx, pix_fmts); -} #define DEFINE_SMEAR(depth, type, div) \ static int smear_slice ## depth(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) \ @@ -447,7 +436,7 @@ const AVFilter ff_vf_chromashift = { .priv_class = &chromashift_class, FILTER_OUTPUTS(outputs), FILTER_INPUTS(inputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_PIXFMTS_ARRAY(yuv_pix_fmts), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .process_command = process_command, }; @@ -476,7 +465,7 @@ const AVFilter ff_vf_rgbashift = { .priv_class = &rgbashift_class, FILTER_OUTPUTS(outputs), FILTER_INPUTS(inputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_PIXFMTS_ARRAY(rgb_pix_fmts), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .process_command = process_command, }; |