aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/opt.h
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-04-11 14:58:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-12 12:09:51 +0200
commitaf0d270aac86a0ac1eae8e145c5aaf128edd5e74 (patch)
tree042a8a893baf9c27131bd0112c82664a23dfdf75 /libavutil/opt.h
parent3d7d819aad52581c39aa3978bf9ae6d3c189e5a9 (diff)
downloadffmpeg-af0d270aac86a0ac1eae8e145c5aaf128edd5e74.tar.gz
lavu: add helper functions for integer lists.
Add av_int_list_length() to compute a list length. Add av_opt_set_int_list() to set a binary option. Signed-off-by: Nicolas George <nicolas.george@normalesup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r--libavutil/opt.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 30f729e447..e368259455 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -656,6 +656,20 @@ int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_
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);
+
+/**
+ * Set a binary option to an integer list.
+ *
+ * @param obj AVClass object to set options on
+ * @param name name of the binary option
+ * @param val pointer to an integer list (must have the correct type with
+ * regard to the contents of the list)
+ * @param term list terminator (usually 0 or -1)
+ * @param flags search flags
+ */
+#define av_opt_set_int_list(obj, name, val, term, flags) \
+ av_opt_set_bin(obj, name, (const uint8_t *)val, \
+ av_int_list_length(val, term) * sizeof(*val), flags)
/**
* @}
*/