summaryrefslogtreecommitdiff
path: root/libavutil/opt.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r--libavutil/opt.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 1b458e1860..7338e78368 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -869,6 +869,27 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o);
*/
int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_flags);
+
+#define AV_OPT_SERIALIZE_SKIP_DEFAULTS 0x00000001 ///< Serialize options that are not set to default values only.
+#define AV_OPT_SERIALIZE_OPT_FLAGS_EXACT 0x00000002 ///< Serialize options that exactly match opt_flags only.
+
+/**
+ * Serialize object's options.
+ *
+ * Create a string containing object's serialized options.
+ * Such string may be passed back to av_opt_set_from_string() in order to restore option values.
+ *
+ * @param[in] obj AVClass object to serialize
+ * @param[in] opt_flags serialize options with all the specified flags set (AV_OPT_FLAG)
+ * @param[in] flags combination of AV_OPT_SERIALIZE_* flags
+ * @param[out] buffer Pointer to buffer that will be allocated with string containg serialized options.
+ * Buffer must be freed by the caller when is no longer needed.
+ * @param[in] key_val_sep character used to separate key from value
+ * @param[in] pairs_sep character used to separate two pairs from each other
+ * @return >= 0 on success, negative on error
+ */
+int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
+ const char key_val_sep, const char pairs_sep);
/**
* @}
*/