History

avfilter/vf_chromakey: Deduplicate inputs and outputs

Andreas Rheinhardt committed 3 years ago

Commit e557d891 parent 2e2c2811 file · +6 −24Browse files

Unified · Split

libavfilter/vf_chromakey.c+6−24
@@ -323,7 +323,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar · 322 unmodified lines
323 return config_output(ctx->outputs[0]);323 return config_output(ctx->outputs[0]);
324}324}
325 325
326static const AVFilterPad chromakey_inputs[] = {326static const AVFilterPad inputs[] = {
327 {327 {
328 .name = "default",328 .name = "default",
329 .type = AVMEDIA_TYPE_VIDEO,329 .type = AVMEDIA_TYPE_VIDEO,
@@ -333,7 +333,7 @@ static const AVFilterPad chromakey_inputs[] = { · 3 unmodified lines
333 },333 },
334};334};
335 335
336static const AVFilterPad chromakey_outputs[] = {336static const AVFilterPad outputs[] = {
337 {337 {
338 .name = "default",338 .name = "default",
339 .type = AVMEDIA_TYPE_VIDEO,339 .type = AVMEDIA_TYPE_VIDEO,
@@ -370,8 +370,8 @@ const AVFilter ff_vf_chromakey = { · 30 unmodified lines
370 .description = NULL_IF_CONFIG_SMALL("Turns a certain color into transparency. Operates on YUV colors."),370 .description = NULL_IF_CONFIG_SMALL("Turns a certain color into transparency. Operates on YUV colors."),
371 .priv_size = sizeof(ChromakeyContext),371 .priv_size = sizeof(ChromakeyContext),
372 .priv_class = &chromakey_class,372 .priv_class = &chromakey_class,
373 FILTER_INPUTS(chromakey_inputs),373 FILTER_INPUTS(inputs),
374 FILTER_OUTPUTS(chromakey_outputs),374 FILTER_OUTPUTS(outputs),
375 FILTER_PIXFMTS_ARRAY(chromakey_fmts),375 FILTER_PIXFMTS_ARRAY(chromakey_fmts),
376 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,376 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
377 .process_command = process_command,377 .process_command = process_command,
@@ -385,24 +385,6 @@ static const AVOption chromahold_options[] = { · 7 unmodified lines
385 { NULL }385 { NULL }
386};386};
387 387
388static const AVFilterPad chromahold_inputs[] = {
389 {
390 .name = "default",
391 .type = AVMEDIA_TYPE_VIDEO,
392 .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE,
393 .filter_frame = filter_frame,
394 .config_props = config_input,
395 },
396};
397
398static const AVFilterPad chromahold_outputs[] = {
399 {
400 .name = "default",
401 .type = AVMEDIA_TYPE_VIDEO,
402 .config_props = config_output,
403 },
404};
405
406static const enum AVPixelFormat hold_pixel_fmts[] = {388static const enum AVPixelFormat hold_pixel_fmts[] = {
407 AV_PIX_FMT_YUV420P,389 AV_PIX_FMT_YUV420P,
408 AV_PIX_FMT_YUV422P,390 AV_PIX_FMT_YUV422P,
@@ -429,8 +411,8 @@ const AVFilter ff_vf_chromahold = { · 20 unmodified lines
429 .description = NULL_IF_CONFIG_SMALL("Turns a certain color range into gray."),411 .description = NULL_IF_CONFIG_SMALL("Turns a certain color range into gray."),
430 .priv_size = sizeof(ChromakeyContext),412 .priv_size = sizeof(ChromakeyContext),
431 .priv_class = &chromahold_class,413 .priv_class = &chromahold_class,
432 FILTER_INPUTS(chromahold_inputs),414 FILTER_INPUTS(inputs),
433 FILTER_OUTPUTS(chromahold_outputs),415 FILTER_OUTPUTS(outputs),
434 FILTER_PIXFMTS_ARRAY(hold_pixel_fmts),416 FILTER_PIXFMTS_ARRAY(hold_pixel_fmts),
435 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,417 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
436 .process_command = process_command,418 .process_command = process_command,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t