diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-30 23:04:14 +0400 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2016-03-24 11:34:15 +0300 |
commit | 564b4591bbe223bdc5f36a1131eaef103f23f5d0 (patch) | |
tree | 75f56f2edb540eaa6bbeecdedef6b8b4fe6561b4 /libavutil/opt.h | |
parent | 8833f1508b7b6afc3172a8017934a7a54428c686 (diff) |
opt: Add av_opt_copy()
This includes documentation and other modifications by
Lukasz Marek and Martin Storsjö.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r-- | libavutil/opt.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h index 99d727cad3..906b869d51 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -530,6 +530,19 @@ int av_opt_get_q (void *obj, const char *name, int search_flags, AVRationa * be freed with av_dict_free() by the caller */ int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDictionary **out_val); + +/** + * Copy options from src object into dest object. + * + * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object. + * Original memory allocated for such options is freed unless both src and dest options points to the same memory. + * + * @param dest Object to copy from + * @param src Object to copy into + * @return 0 on success, negative on error + */ +int av_opt_copy(void *dest, const void *src); + /** * @} * @} |