diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-08-13 13:40:01 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-08-18 10:19:05 +0200 |
commit | 42d621d131a45fb63571ca6029c2fc4f02811c10 (patch) | |
tree | 8a8c32a05e78393c923405b089f2b68968a2f57d /libavfilter/buffersrc.c | |
parent | 831a999ddaf89ad3bb31bfcf4201463098444539 (diff) | |
download | ffmpeg-42d621d131a45fb63571ca6029c2fc4f02811c10.tar.gz |
lavfi: add priv class to filter definitions and flags to filter internal options
This allows the iteration callbacks to discover the internal class and
options, and show them when required.
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r-- | libavfilter/buffersrc.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index c5e3518f8e..1b46b5bd7b 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -164,17 +164,17 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src) } #define OFFSET(x) offsetof(BufferSourceContext, x) -#define V AV_OPT_FLAG_VIDEO_PARAM +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM 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 }, - { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = V }, - { "pixel_aspect", NULL, OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, - { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = V }, + { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, + { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, + { "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = FLAGS }, + { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = FLAGS }, + { "pixel_aspect", NULL, OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, + { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = FLAGS }, { NULL }, }; -#undef V +#undef FLAGS AVFILTER_DEFINE_CLASS(buffer); @@ -233,12 +233,12 @@ fail: return ret; } -#define A AV_OPT_FLAG_AUDIO_PARAM +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM 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 }, - { "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A }, + { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, + { "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, FLAGS }, + { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = FLAGS }, + { "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = FLAGS }, { NULL }, }; @@ -412,6 +412,7 @@ AVFilter avfilter_vsrc_buffer = { .poll_frame = poll_frame, .config_props = config_props, }, { .name = NULL}}, + .priv_class = &buffer_class, }; AVFilter avfilter_asrc_abuffer = { @@ -430,4 +431,5 @@ AVFilter avfilter_asrc_abuffer = { .poll_frame = poll_frame, .config_props = config_props, }, { .name = NULL}}, + .priv_class = &abuffer_class, }; |