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
6161
6262 #define OFFSET(x) offsetof(TestSourceContext, x)
6363
64−static const AVOption testsrc_options[]= {
64+static const AVOption options[] = {
6565 { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
6666 { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 },
6767 { "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
186186
187187 #if CONFIG_NULLSRC_FILTER
188188
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);
196191
197192 static void nullsrc_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref) { }
198193
@@ -224,6 +219,7 @@ AVFilter avfilter_vsrc_nullsrc = { · 25 unmodified lines
224219
225220 #if CONFIG_TESTSRC_FILTER
226221
222+#define testsrc_options options
227223 AVFILTER_DEFINE_CLASS(testsrc);
228224
229225 /**
@@ -443,13 +439,8 @@ AVFilter avfilter_vsrc_testsrc = { · 213 unmodified lines
443439
444440 #if CONFIG_RGBTESTSRC_FILTER
445441
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);
453444
454445 #define R 0
455446 #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