Factorize.
Unified · Split
| @@ -61,7 +61,7 @@ typedef struct { · 60 unmodified lines | |||
| 61 | 61 | ||
| 62 | #define OFFSET(x) offsetof(TestSourceContext, x) | 62 | #define OFFSET(x) offsetof(TestSourceContext, x) |
| 63 | 63 | ||
| 64 | static const AVOption testsrc_options[]= { | 64 | static const AVOption options[] = { |
| 65 | { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, | 65 | { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, |
| 66 | { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, | 66 | { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, |
| 67 | { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | 67 | { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, |
| @@ -186,13 +186,8 @@ static int request_frame(AVFilterLink *outlink) · 118 unmodified lines | |||
| 186 | 186 | ||
| 187 | #if CONFIG_NULLSRC_FILTER | 187 | #if CONFIG_NULLSRC_FILTER |
| 188 | 188 | ||
| 189 | static const AVClass nullsrc_class = { | 189 | #define nullsrc_options options |
| 190 | .class_name = "nullsrc", | 190 | AVFILTER_DEFINE_CLASS(nullsrc); |
| 191 | .item_name = av_default_item_name, | ||
| 192 | .option = testsrc_options, | ||
| 193 | .version = LIBAVUTIL_VERSION_INT, | ||
| 194 | .category = AV_CLASS_CATEGORY_FILTER, | ||
| 195 | }; | ||
| 196 | 191 | ||
| 197 | static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { } | 192 | static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { } |
| 198 | 193 | ||
| @@ -224,6 +219,7 @@ AVFilter avfilter_vsrc_nullsrc = { · 25 unmodified lines | |||
| 224 | 219 | ||
| 225 | #if CONFIG_TESTSRC_FILTER | 220 | #if CONFIG_TESTSRC_FILTER |
| 226 | 221 | ||
| 222 | #define testsrc_options options | ||
| 227 | AVFILTER_DEFINE_CLASS(testsrc); | 223 | AVFILTER_DEFINE_CLASS(testsrc); |
| 228 | 224 | ||
| 229 | /** | 225 | /** |
| @@ -443,13 +439,8 @@ AVFilter avfilter_vsrc_testsrc = { · 213 unmodified lines | |||
| 443 | 439 | ||
| 444 | #if CONFIG_RGBTESTSRC_FILTER | 440 | #if CONFIG_RGBTESTSRC_FILTER |
| 445 | 441 | ||
| 446 | static const AVClass rgbtestsrc_class = { | 442 | #define rgbtestsrc_options options |
| 447 | .class_name = "rgbtestsrc", | 443 | AVFILTER_DEFINE_CLASS(rgbtestsrc); |
| 448 | .item_name = av_default_item_name, | ||
| 449 | .option = testsrc_options, | ||
| 450 | .version = LIBAVUTIL_VERSION_INT, | ||
| 451 | .category = AV_CLASS_CATEGORY_FILTER, | ||
| 452 | }; | ||
| 453 | 444 | ||
| 454 | #define R 0 | 445 | #define R 0 |
| 455 | #define G 1 | 446 | #define G 1 |