Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-14 00:39:54 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-08-14 00:39:54 +0400
commit2ba45778095cdd6e1438644e4797b76e9de6c672 (patch)
tree6d7ef68dc6929b79854a0e9803cdb69bc70501e4 /libavutil/opt.h
parented8e6d535cf4c56d82f9c91646dfc42787b719d6 (diff)
parenta8c104a511f97e4ea617df73b31737e28a8a5126 (diff)
Merge commit 'a8c104a511f97e4ea617df73b31737e28a8a5126'
* commit 'a8c104a511f97e4ea617df73b31737e28a8a5126': AVOption: add support for dictionary types. Conflicts: libavutil/opt.c libavutil/opt.h libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r--libavutil/opt.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 7705990210..4905ee30c0 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -226,6 +226,7 @@ enum AVOptionType{
AV_OPT_TYPE_STRING,
AV_OPT_TYPE_RATIONAL,
AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length
+ AV_OPT_TYPE_DICT,
AV_OPT_TYPE_CONST = 128,
AV_OPT_TYPE_IMAGE_SIZE = MKBETAG('S','I','Z','E'), ///< offset must point to two consecutive integers
AV_OPT_TYPE_PIXEL_FMT = MKBETAG('P','F','M','T'),
@@ -511,7 +512,7 @@ int av_opt_set_from_string(void *ctx, const char *opts,
const char *const *shorthand,
const char *key_val_sep, const char *pairs_sep);
/**
- * Free all string and binary options in obj.
+ * Free all allocated objects in obj.
*/
void av_opt_free(void *obj);
@@ -735,16 +736,21 @@ const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *pre
* AVERROR(ERANGE) if the value is out of range
* AVERROR(EINVAL) if the value is not valid
*/
-int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
-int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
-int av_opt_set_double(void *obj, const char *name, double val, int search_flags);
-int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
-int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
+int av_opt_set (void *obj, const char *name, const char *val, int search_flags);
+int av_opt_set_int (void *obj, const char *name, int64_t val, int search_flags);
+int av_opt_set_double (void *obj, const char *name, double val, int search_flags);
+int av_opt_set_q (void *obj, const char *name, AVRational val, int search_flags);
+int av_opt_set_bin (void *obj, const char *name, const uint8_t *val, int size, int search_flags);
int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags);
int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags);
int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags);
int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags);
int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, int search_flags);
+/**
+ * @note Any old dictionary present is discarded and replaced with a copy of the new one. The
+ * caller still owns val is and responsible for freeing it.
+ */
+int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, int search_flags);
/**
* Set a binary option to an integer list.
@@ -761,6 +767,7 @@ int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, in
AVERROR(EINVAL) : \
av_opt_set_bin(obj, name, (const uint8_t *)(val), \
av_int_list_length(val, term) * sizeof(*(val)), flags))
+
/**
* @}
*/
@@ -780,16 +787,21 @@ int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, in
/**
* @note the returned string will be av_malloc()ed and must be av_free()ed by the caller
*/
-int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
-int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
-int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val);
-int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
+int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val);
+int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val);
+int av_opt_get_double (void *obj, const char *name, int search_flags, double *out_val);
+int av_opt_get_q (void *obj, const char *name, int search_flags, AVRational *out_val);
int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_out, int *h_out);
int av_opt_get_pixel_fmt (void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt);
int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt);
int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val);
int av_opt_get_channel_layout(void *obj, const char *name, int search_flags, int64_t *ch_layout);
/**
+ * @param[out] out_val The returned dictionary is a copy of the actual value and must
+ * 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);
+/**
* @}
*/
/**