diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-06-22 16:33:09 +0400 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-06-23 01:11:43 +0400 |
commit | c17808cebd2b9cf734dfa7f652ed49a3b3289386 (patch) | |
tree | 809dfdeee9db61d718252717b8f21f423e067417 /libavfilter/buffersrc.c | |
parent | 012aa12a6bff8333da2165256bae312f6844ab65 (diff) |
lavfi: define macro AVFILTER_DEFINE_CLASS
The macro can be used to define consistently the internal class of a
filter, save some typing and factorize.
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r-- | libavfilter/buffersrc.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index b50a5e1715..4debd5f257 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -219,7 +219,7 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src) #define OFFSET(x) offsetof(BufferSourceContext, x) #define V AV_OPT_FLAG_VIDEO_PARAM -static const AVOption video_options[] = { +static const AVOption buffer_options[] = { { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, { "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = V }, @@ -230,13 +230,7 @@ static const AVOption video_options[] = { }; #undef V -static const AVClass vbuffer_class = { - .class_name = "vbuffer source", - .item_name = av_default_item_name, - .option = video_options, - .version = LIBAVUTIL_VERSION_INT, - .category = AV_CLASS_CATEGORY_FILTER, -}; +AVFILTER_DEFINE_CLASS(buffer); static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaque) { @@ -244,7 +238,7 @@ static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaq char pix_fmt_str[128], sws_param[256] = "", *colon, *equal; int ret, n = 0; - c->class = &vbuffer_class; + c->class = &buffer_class; if (!args) { av_log(ctx, AV_LOG_ERROR, "Arguments required\n"); @@ -295,7 +289,7 @@ fail: } #define A AV_OPT_FLAG_AUDIO_PARAM -static const AVOption audio_options[] = { +static const AVOption abuffer_options[] = { { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, A }, { "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, A }, { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = A }, @@ -303,13 +297,7 @@ static const AVOption audio_options[] = { { NULL }, }; -static const AVClass abuffer_class = { - .class_name = "abuffer source", - .item_name = av_default_item_name, - .option = audio_options, - .version = LIBAVUTIL_VERSION_INT, - .category = AV_CLASS_CATEGORY_FILTER, -}; +AVFILTER_DEFINE_CLASS(abuffer); static av_cold int init_audio(AVFilterContext *ctx, const char *args, void *opaque) { |