History

avfilter/vsrc_testsrc: Deduplicate AVClasses

Andreas Rheinhardt committed 5 years ago

Commit 4906a451 parent f8047181 file · +16 −31Browse files

Unified · Split

libavfilter/vsrc_testsrc.c+16−31
@@ -409,10 +409,9 @@ const AVFilter ff_vsrc_haldclutsrc = { · 408 unmodified lines
409409 };
410410 #endif /* CONFIG_HALDCLUTSRC_FILTER */
411411
412−#if CONFIG_NULLSRC_FILTER
412+AVFILTER_DEFINE_CLASS_EXT(nullsrc_yuvtestsrc, "nullsrc/yuvtestsrc", options);
413413
414−#define nullsrc_options options
415−AVFILTER_DEFINE_CLASS(nullsrc);
414+#if CONFIG_NULLSRC_FILTER
416415
417416 static void nullsrc_fill_picture(AVFilterContext *ctx, AVFrame *picref) { }
418417
@@ -435,11 +434,11 @@ static const AVFilterPad nullsrc_outputs[] = { · 16 unmodified lines
435434 const AVFilter ff_vsrc_nullsrc = {
436435 .name = "nullsrc",
437436 .description = NULL_IF_CONFIG_SMALL("Null video source, return unprocessed video frames."),
437+ .priv_class = &nullsrc_yuvtestsrc_class,
438438 .init = nullsrc_init,
439439 .uninit = uninit,
440440 .activate = activate,
441441 .priv_size = sizeof(TestSourceContext),
442− .priv_class = &nullsrc_class,
443442 .inputs = NULL,
444443 FILTER_OUTPUTS(nullsrc_outputs),
445444 };
@@ -1124,9 +1123,6 @@ const AVFilter ff_vsrc_rgbtestsrc = { · 678 unmodified lines
11241123
11251124 #if CONFIG_YUVTESTSRC_FILTER
11261125
1127−#define yuvtestsrc_options options
1128−AVFILTER_DEFINE_CLASS(yuvtestsrc);
1129−
11301126 static void yuvtest_fill_picture8(AVFilterContext *ctx, AVFrame *frame)
11311127 {
11321128 int x, y, w = frame->width, h = frame->height / 3;
@@ -1283,7 +1279,7 @@ const AVFilter ff_vsrc_yuvtestsrc = { · 150 unmodified lines
12831279 .name = "yuvtestsrc",
12841280 .description = NULL_IF_CONFIG_SMALL("Generate YUV test pattern."),
12851281 .priv_size = sizeof(TestSourceContext),
1286− .priv_class = &yuvtestsrc_class,
1282+ .priv_class = &nullsrc_yuvtestsrc_class,
12871283 .init = yuvtest_init,
12881284 .uninit = uninit,
12891285 .query_formats = yuvtest_query_formats,
@@ -1418,10 +1414,9 @@ static const AVFilterPad smptebars_outputs[] = { · 128 unmodified lines
14181414 },
14191415 };
14201416
1421−#if CONFIG_PAL75BARS_FILTER
1417+AVFILTER_DEFINE_CLASS_EXT(palbars, "pal(75|100)bars", options);
14221418
1423−#define pal75bars_options options
1424−AVFILTER_DEFINE_CLASS(pal75bars);
1419+#if CONFIG_PAL75BARS_FILTER
14251420
14261421 static void pal75bars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
14271422 {
@@ -1455,8 +1450,8 @@ static av_cold int pal75bars_init(AVFilterContext *ctx) · 27 unmodified lines
14551450 const AVFilter ff_vsrc_pal75bars = {
14561451 .name = "pal75bars",
14571452 .description = NULL_IF_CONFIG_SMALL("Generate PAL 75% color bars."),
1453+ .priv_class = &palbars_class,
14581454 .priv_size = sizeof(TestSourceContext),
1459− .priv_class = &pal75bars_class,
14601455 .init = pal75bars_init,
14611456 .uninit = uninit,
14621457 .query_formats = smptebars_query_formats,
@@ -1469,9 +1464,6 @@ const AVFilter ff_vsrc_pal75bars = { · 6 unmodified lines
14691464
14701465 #if CONFIG_PAL100BARS_FILTER
14711466
1472−#define pal100bars_options options
1473−AVFILTER_DEFINE_CLASS(pal100bars);
1474−
14751467 static void pal100bars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
14761468 {
14771469 TestSourceContext *test = ctx->priv;
@@ -1502,8 +1494,8 @@ static av_cold int pal100bars_init(AVFilterContext *ctx) · 24 unmodified lines
15021494 const AVFilter ff_vsrc_pal100bars = {
15031495 .name = "pal100bars",
15041496 .description = NULL_IF_CONFIG_SMALL("Generate PAL 100% color bars."),
1497+ .priv_class = &palbars_class,
15051498 .priv_size = sizeof(TestSourceContext),
1506− .priv_class = &pal100bars_class,
15071499 .init = pal100bars_init,
15081500 .uninit = uninit,
15091501 .query_formats = smptebars_query_formats,
@@ -1514,10 +1506,9 @@ const AVFilter ff_vsrc_pal100bars = { · 4 unmodified lines
15141506
15151507 #endif /* CONFIG_PAL100BARS_FILTER */
15161508
1517−#if CONFIG_SMPTEBARS_FILTER
1509+AVFILTER_DEFINE_CLASS_EXT(smptebars, "smpte(hd)bars", options);
15181510
1519−#define smptebars_options options
1520−AVFILTER_DEFINE_CLASS(smptebars);
1511+#if CONFIG_SMPTEBARS_FILTER
15211512
15221513 static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
15231514 {
@@ -1584,9 +1575,6 @@ const AVFilter ff_vsrc_smptebars = { · 60 unmodified lines
15841575
15851576 #if CONFIG_SMPTEHDBARS_FILTER
15861577
1587−#define smptehdbars_options options
1588−AVFILTER_DEFINE_CLASS(smptehdbars);
1589−
15901578 static void smptehdbars_fill_picture(AVFilterContext *ctx, AVFrame *picref)
15911579 {
15921580 TestSourceContext *test = ctx->priv;
@@ -1676,8 +1664,8 @@ static av_cold int smptehdbars_init(AVFilterContext *ctx) · 83 unmodified lines
16761664 const AVFilter ff_vsrc_smptehdbars = {
16771665 .name = "smptehdbars",
16781666 .description = NULL_IF_CONFIG_SMALL("Generate SMPTE HD color bars."),
1667+ .priv_class = &smptebars_class,
16791668 .priv_size = sizeof(TestSourceContext),
1680− .priv_class = &smptehdbars_class,
16811669 .init = smptehdbars_init,
16821670 .uninit = uninit,
16831671 .query_formats = smptebars_query_formats,
@@ -1689,10 +1677,10 @@ const AVFilter ff_vsrc_smptehdbars = { · 5 unmodified lines
16891677 #endif /* CONFIG_SMPTEHDBARS_FILTER */
16901678 #endif /* CONFIG_SMPTEBARS_FILTER || CONFIG_SMPTEHDBARS_FILTER */
16911679
1692−#if CONFIG_ALLYUV_FILTER
1680+AVFILTER_DEFINE_CLASS_EXT(allyuv_allrgb, "allyuv/allrgb",
1681+ &options[NOSIZE_OPTIONS_OFFSET]);
16931682
1694−#define allyuv_options &options[NOSIZE_OPTIONS_OFFSET]
1695−AVFILTER_DEFINE_CLASS(allyuv);
1683+#if CONFIG_ALLYUV_FILTER
16961684
16971685 static void allyuv_fill_picture(AVFilterContext *ctx, AVFrame *frame)
16981686 {
@@ -1751,7 +1739,7 @@ const AVFilter ff_vsrc_allyuv = { · 52 unmodified lines
17511739 .name = "allyuv",
17521740 .description = NULL_IF_CONFIG_SMALL("Generate all yuv colors."),
17531741 .priv_size = sizeof(TestSourceContext),
1754− .priv_class = &allyuv_class,
1742+ .priv_class = &allyuv_allrgb_class,
17551743 .init = allyuv_init,
17561744 .uninit = uninit,
17571745 .query_formats = allyuv_query_formats,
@@ -1764,9 +1752,6 @@ const AVFilter ff_vsrc_allyuv = { · 6 unmodified lines
17641752
17651753 #if CONFIG_ALLRGB_FILTER
17661754
1767−#define allrgb_options &options[NOSIZE_OPTIONS_OFFSET]
1768−AVFILTER_DEFINE_CLASS(allrgb);
1769−
17701755 static void allrgb_fill_picture(AVFilterContext *ctx, AVFrame *frame)
17711756 {
17721757 unsigned x, y;
@@ -1824,7 +1809,7 @@ const AVFilter ff_vsrc_allrgb = { · 51 unmodified lines
18241809 .name = "allrgb",
18251810 .description = NULL_IF_CONFIG_SMALL("Generate all RGB colors."),
18261811 .priv_size = sizeof(TestSourceContext),
1827− .priv_class = &allrgb_class,
1812+ .priv_class = &allyuv_allrgb_class,
18281813 .init = allrgb_init,
18291814 .uninit = uninit,
18301815 .query_formats = allrgb_query_formats,

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