diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-10-03 21:49:12 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-10-12 18:51:16 +0400 |
commit | 641c7afe3c17334b81e3e2eef88f1751eb68f89f (patch) | |
tree | 27ff55b88d052b7947b40a40834f80f0c2c99083 /libavutil/opt.h | |
parent | 1bca8f4bc596d286dc50e572f5f8d52e4fc3a8dc (diff) |
AVOptions: add new API for enumerating children.
This will allow the caller to enumerate child contexts in a generic way
and since the API is recursive, it also allows for deeper nesting (e.g.
AVFormatContext->AVIOContext->URLContext)
This will also allow the new setting/reading API to transparently apply
to children contexts.
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r-- | libavutil/opt.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h index 50c0a33bc7..6f0a03be3c 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -30,6 +30,7 @@ #include "rational.h" #include "avutil.h" #include "dict.h" +#include "log.h" enum AVOptionType{ FF_OPT_TYPE_FLAGS, @@ -255,4 +256,44 @@ int av_opt_set_dict(void *obj, struct AVDictionary **options); const AVOption *av_opt_find(void *obj, const char *name, const char *unit, int opt_flags, int search_flags); +/** + * Look for an option in an object. Consider only options which + * have all the specified flags set. + * + * @param[in] obj A pointer to a struct whose first element is a + * pointer to an AVClass. + * Alternatively a double pointer to an AVClass, if + * AV_OPT_SEARCH_FAKE_OBJ search flag is set. + * @param[in] name The name of the option to look for. + * @param[in] unit When searching for named constants, name of the unit + * it belongs to. + * @param opt_flags Find only options with all the specified flags set (AV_OPT_FLAG). + * @param search_flags A combination of AV_OPT_SEARCH_*. + * @param[out] target_obj if non-NULL, an object to which the option belongs will be + * written here. It may be different from obj if AV_OPT_SEARCH_CHILDREN is present + * in search_flags. This parameter is ignored if search_flags contain + * AV_OPT_SEARCH_FAKE_OBJ. + * + * @return A pointer to the option found, or NULL if no option + * was found. + */ +const AVOption *av_opt_find2(void *obj, const char *name, const char *unit, + int opt_flags, int search_flags, void **target_obj); + +/** + * Iterate over AVOptions-enabled children of obj. + * + * @param prev result of a previous call to this function or NULL + * @return next AVOptions-enabled child or NULL + */ +void *av_opt_child_next(void *obj, void *prev); + +/** + * Iterate over potential AVOptions-enabled children of parent. + * + * @param prev result of a previous call to this function or NULL + * @return AVClass corresponding to next potential child or NULL + */ +const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev); + #endif /* AVUTIL_OPT_H */ |