avfilter/vf_convolution: 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 23:18:51 +02:00
parent 102131da32
commit 0fbdedc049

View File

@ -77,8 +77,6 @@ static const int same7x7[49] = {0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0}; 0, 0, 0, 0, 0, 0, 0};
static int query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pix_fmts[] = { static const enum AVPixelFormat pix_fmts[] = {
AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P,
AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P,
@ -101,9 +99,6 @@ static int query_formats(AVFilterContext *ctx)
AV_PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
return ff_set_common_formats_from_list(ctx, pix_fmts);
}
typedef struct ThreadData { typedef struct ThreadData {
AVFrame *in, *out; AVFrame *in, *out;
} ThreadData; } ThreadData;
@ -967,7 +962,7 @@ const AVFilter ff_vf_convolution = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };
@ -994,7 +989,7 @@ const AVFilter ff_vf_prewitt = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };
@ -1011,7 +1006,7 @@ const AVFilter ff_vf_sobel = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };
@ -1028,7 +1023,7 @@ const AVFilter ff_vf_roberts = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };
@ -1045,7 +1040,7 @@ const AVFilter ff_vf_kirsch = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };
@ -1062,7 +1057,7 @@ const AVFilter ff_vf_scharr = {
.init = init, .init = init,
FILTER_INPUTS(convolution_inputs), FILTER_INPUTS(convolution_inputs),
FILTER_OUTPUTS(convolution_outputs), FILTER_OUTPUTS(convolution_outputs),
FILTER_QUERY_FUNC(query_formats), FILTER_PIXFMTS_ARRAY(pix_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS, .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command, .process_command = process_command,
}; };