avfilter/vf_chromakey: Deduplicate inputs and outputs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-11-01 08:46:38 +01:00
parent 2e2c28119f
commit e557d89ac1

View File

@ -323,7 +323,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
return config_output(ctx->outputs[0]);
}
static const AVFilterPad chromakey_inputs[] = {
static const AVFilterPad inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
@ -333,7 +333,7 @@ static const AVFilterPad chromakey_inputs[] = {
},
};
static const AVFilterPad chromakey_outputs[] = {
static const AVFilterPad outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
@ -370,8 +370,8 @@ const AVFilter ff_vf_chromakey = {
.description = NULL_IF_CONFIG_SMALL("Turns a certain color into transparency. Operates on YUV colors."),
.priv_size = sizeof(ChromakeyContext),
.priv_class = &chromakey_class,
FILTER_INPUTS(chromakey_inputs),
FILTER_OUTPUTS(chromakey_outputs),
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),
FILTER_PIXFMTS_ARRAY(chromakey_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command,
@ -385,24 +385,6 @@ static const AVOption chromahold_options[] = {
{ NULL }
};
static const AVFilterPad chromahold_inputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
.filter_frame = filter_frame,
.config_props = config_input,
},
};
static const AVFilterPad chromahold_outputs[] = {
{
.name = "default",
.type = AVMEDIA_TYPE_VIDEO,
.config_props = config_output,
},
};
static const enum AVPixelFormat hold_pixel_fmts[] = {
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P,
@ -429,8 +411,8 @@ const AVFilter ff_vf_chromahold = {
.description = NULL_IF_CONFIG_SMALL("Turns a certain color range into gray."),
.priv_size = sizeof(ChromakeyContext),
.priv_class = &chromahold_class,
FILTER_INPUTS(chromahold_inputs),
FILTER_OUTPUTS(chromahold_outputs),
FILTER_INPUTS(inputs),
FILTER_OUTPUTS(outputs),
FILTER_PIXFMTS_ARRAY(hold_pixel_fmts),
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
.process_command = process_command,