diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-03-13 08:48:16 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-04-09 19:13:10 +0200 |
commit | 4d1f31ea44f82adfb2b712534d71e27233a4f785 (patch) | |
tree | a6288ce73d5203e823e1d099161fae78ceb7839c /libavfilter/avfilter.c | |
parent | 62549f9655c48f0ec061087fa33a96040ce01145 (diff) | |
download | ffmpeg-4d1f31ea44f82adfb2b712534d71e27233a4f785.tar.gz |
lavfi: make AVFilterContext export filter options.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r-- | libavfilter/avfilter.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 1ba91d9821..2fe8dfbe5c 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -321,10 +321,35 @@ static const char *filter_name(void *p) return filter->filter->name; } +static void *filter_child_next(void *obj, void *prev) +{ + AVFilterContext *ctx = obj; + if (!prev && ctx->filter && ctx->filter->priv_class && ctx->priv) + return ctx->priv; + return NULL; +} + +static const AVClass *filter_child_class_next(const AVClass *prev) +{ + AVFilter **f = NULL; + + while (prev && *(f = av_filter_next(f))) + if ((*f)->priv_class == prev) + break; + + while (*(f = av_filter_next(f))) + if ((*f)->priv_class) + return (*f)->priv_class; + + return NULL; +} + static const AVClass avfilter_class = { .class_name = "AVFilter", .item_name = filter_name, .version = LIBAVUTIL_VERSION_INT, + .child_next = filter_child_next, + .child_class_next = filter_child_class_next, }; int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) |