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