History

lavfi/testsrc: use AVFILTER_DEFINE_CLASS for defining the filter classes

Factorize.

Stefano Sabatini committed 14 years ago

Commit 4c8fc6a1 parent 33474eb1 file · +6 −15Browse files

Unified · Split

libavfilter/vsrc_testsrc.c+6−15
@@ -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
64static const AVOption testsrc_options[]= {64static 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_FILTER187#if CONFIG_NULLSRC_FILTER
188 188
189static const AVClass nullsrc_class = {189#define nullsrc_options options
190 .class_name = "nullsrc",190AVFILTER_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
197static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { }192static 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_FILTER220#if CONFIG_TESTSRC_FILTER
226 221
222#define testsrc_options options
227AVFILTER_DEFINE_CLASS(testsrc);223AVFILTER_DEFINE_CLASS(testsrc);
228 224
229/**225/**
@@ -443,13 +439,8 @@ AVFilter avfilter_vsrc_testsrc = { · 213 unmodified lines
443 439
444#if CONFIG_RGBTESTSRC_FILTER440#if CONFIG_RGBTESTSRC_FILTER
445 441
446static const AVClass rgbtestsrc_class = {442#define rgbtestsrc_options options
447 .class_name = "rgbtestsrc",443AVFILTER_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 0445#define R 0
455#define G 1446#define G 1

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