[FFmpeg-cvslog] avfilter/vf_chromakey: Deduplicate inputs and outputs

Andreas Rheinhardt git at videolan.org
Sat Nov 4 02:36:23 EET 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Nov  1 08:46:38 2023 +0100| [e557d89ac109e4c6353481803f2feeb3313fc6ce] | committer: Andreas Rheinhardt

avfilter/vf_chromakey: Deduplicate inputs and outputs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e557d89ac109e4c6353481803f2feeb3313fc6ce
---

 libavfilter/vf_chromakey.c | 30 ++++++------------------------
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index c204a58328..9c0918bb4d 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -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,



More information about the ffmpeg-cvslog mailing list