summaryrefslogtreecommitdiff
path: root/libavutil/opt.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-05-22 12:52:50 +0200
committerAnton Khirnov <anton@khirnov.net>2011-06-16 20:24:56 +0200
commit7e83e1c511baf0d02f3af75b6180d6af4d50aa99 (patch)
treec56415cc57d731c090bac30707276a2b51521df6 /libavutil/opt.h
parent0b7ccad6bf79cebe5cd8392105276a4ba19d19f9 (diff)
AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
This way the caller can pass all the options in one nice package.
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r--libavutil/opt.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 46ad8acce1..ef984d9a9c 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -29,6 +29,7 @@
#include "rational.h"
#include "avutil.h"
+#include "dict.h"
enum AVOptionType{
FF_OPT_TYPE_FLAGS,
@@ -191,4 +192,20 @@ void av_opt_free(void *obj);
*/
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name);
+/*
+ * Set all the options from a given dictionary on an object.
+ *
+ * @param obj a struct whose first element is a pointer to AVClass
+ * @param options options to process. This dictionary will be freed and replaced
+ * by a new one containing all options not found in obj.
+ * Of course this new dictionary needs to be freed by caller
+ * with av_dict_free().
+ *
+ * @return 0 on success, a negative AVERROR if some option was found in obj,
+ * but could not be set.
+ *
+ * @see av_dict_copy()
+ */
+int av_opt_set_dict(void *obj, struct AVDictionary **options);
+
#endif /* AVUTIL_OPT_H */