diff --git a/doc/filters.texi b/doc/filters.texi index bd74a77514..ffdc0db570 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -6201,8 +6201,7 @@ The @code{testsrc} source generates a test video pattern, showing a color pattern, a scrolling gradient and a timestamp. This is mainly intended for testing purposes. -These sources accept an optional sequence of @var{key}=@var{value} pairs, -separated by ":". The description of the accepted options follows. +The sources accept the following options: @table @option diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 32b20f4d07..ba6f414bf2 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -725,6 +725,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque !strcmp(filter->filter->name, "pp" ) || !strcmp(filter->filter->name, "aperms") || !strcmp(filter->filter->name, "resample") || + !strcmp(filter->filter->name, "rgbtestsrc") || !strcmp(filter->filter->name, "setpts" ) || !strcmp(filter->filter->name, "settb" ) || !strcmp(filter->filter->name, "showspectrum") || @@ -733,6 +734,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque !strcmp(filter->filter->name, "split" ) || !strcmp(filter->filter->name, "stereo3d" ) || !strcmp(filter->filter->name, "subtitles") || + !strcmp(filter->filter->name, "testsrc" ) || !strcmp(filter->filter->name, "thumbnail") || !strcmp(filter->filter->name, "transpose") || !strcmp(filter->filter->name, "treble" ) || diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 6a3a9e98fe..16455003d7 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -508,10 +508,8 @@ static av_cold int test_init(AVFilterContext *ctx, const char *args) { TestSourceContext *test = ctx->priv; - test->class = &testsrc_class; test->fill_picture_fn = test_fill_picture; - av_opt_set_defaults(test); - return init(ctx, args); + return init(ctx, NULL); } static int test_query_formats(AVFilterContext *ctx) @@ -534,17 +532,17 @@ static const AVFilterPad avfilter_vsrc_testsrc_outputs[] = { }; AVFilter avfilter_vsrc_testsrc = { - .name = "testsrc", - .description = NULL_IF_CONFIG_SMALL("Generate test pattern."), - .priv_size = sizeof(TestSourceContext), - .init = test_init, - .uninit = uninit, + .name = "testsrc", + .description = NULL_IF_CONFIG_SMALL("Generate test pattern."), + .priv_size = sizeof(TestSourceContext), + .priv_class = &testsrc_class, + .init = test_init, + .uninit = uninit, - .query_formats = test_query_formats, + .query_formats = test_query_formats, .inputs = NULL, .outputs = avfilter_vsrc_testsrc_outputs, - .priv_class = &testsrc_class, }; #endif /* CONFIG_TESTSRC_FILTER */ @@ -615,10 +613,8 @@ static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) TestSourceContext *test = ctx->priv; test->draw_once = 1; - test->class = &rgbtestsrc_class; test->fill_picture_fn = rgbtest_fill_picture; - av_opt_set_defaults(test); - return init(ctx, args); + return init(ctx, NULL); } static int rgbtest_query_formats(AVFilterContext *ctx) @@ -654,18 +650,18 @@ static const AVFilterPad avfilter_vsrc_rgbtestsrc_outputs[] = { }; AVFilter avfilter_vsrc_rgbtestsrc = { - .name = "rgbtestsrc", - .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."), - .priv_size = sizeof(TestSourceContext), - .init = rgbtest_init, - .uninit = uninit, + .name = "rgbtestsrc", + .description = NULL_IF_CONFIG_SMALL("Generate RGB test pattern."), + .priv_size = sizeof(TestSourceContext), + .priv_class = &rgbtestsrc_class, + .init = rgbtest_init, + .uninit = uninit, - .query_formats = rgbtest_query_formats, + .query_formats = rgbtest_query_formats, .inputs = NULL, .outputs = avfilter_vsrc_rgbtestsrc_outputs, - .priv_class = &rgbtestsrc_class, }; #endif /* CONFIG_RGBTESTSRC_FILTER */