aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/opt.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-23 15:02:25 +0200
committerAnton Khirnov <anton@khirnov.net>2011-10-12 16:51:16 +0200
commitdca055be3ae1a79209051a3f581802e3d21b7ad5 (patch)
treebcf09253669fd1d4b03c94f33a3661a9b18d39e4 /libavutil/opt.h
parent059a037fbd0f0f6e47426f5c40ff315fca3e0099 (diff)
downloadffmpeg-dca055be3ae1a79209051a3f581802e3d21b7ad5.tar.gz
AVOptions: add functions for evaluating option strings.
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r--libavutil/opt.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h
index e40db11567..7649447e79 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -226,6 +226,30 @@ int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
*/
int av_opt_set_dict(void *obj, struct AVDictionary **options);
+/**
+ * @defgroup opt_eval_funcs Evaluating option strings
+ * @{
+ * This group of functions can be used to evaluate option strings
+ * and get numbers out of them. They do the same thing as av_opt_set(),
+ * except the result is written into the caller-supplied pointer.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass.
+ * @param o an option for which the string is to be evaluated.
+ * @param val string to be evaluated.
+ * @param *_out value of the string will be written here.
+ *
+ * @return 0 on success, a negative number on failure.
+ */
+int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out);
+int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out);
+int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out);
+int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out);
+int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out);
+int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out);
+/**
+ * @}
+ */
+
#define AV_OPT_SEARCH_CHILDREN 0x0001 /**< Search in possible children of the
given object first. */
/**