diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-26 22:37:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-26 22:37:37 +0200 |
commit | 53ce9905134e042516ddd7a4476dc668c0b094c4 (patch) | |
tree | 05e80abb4ef8b78c7c93bc920b32fb34ac268cc7 /libavutil | |
parent | a48b890392aa22033f182421ba9e3f3b3256461d (diff) | |
parent | 154486f9adc621e620dacd76d78c30a02cc1dcd3 (diff) | |
download | ffmpeg-53ce9905134e042516ddd7a4476dc668c0b094c4.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
opt: Add av_opt_set_bin()
avconv: Display the error returned by avformat_write_header
rtpenc_chain: Return an error code instead of just a plain pointer
rtpenc_chain: Free the URLContext on failure
rtpenc: Expose the ssrc as an avoption
avprobe: display the codec profile in show_stream()
avprobe: fix function prototype
cosmetics: Fix indentation
avprobe: changelog entry
avprobe: update documentation
avprobe: provide JSON output
avprobe: output proper INI format
avprobe: improve formatting
rtmp: fix url parsing
fate: document TARGET_EXEC and its usage
Conflicts:
doc/APIchanges
doc/fate.texi
doc/ffprobe.texi
ffprobe.c
libavformat/version.h
libavutil/avutil.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avutil.h | 2 | ||||
-rw-r--r-- | libavutil/opt.c | 29 | ||||
-rw-r--r-- | libavutil/opt.h | 1 |
3 files changed, 31 insertions, 1 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h index ee8b071383..acef213c1c 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -153,7 +153,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 54 +#define LIBAVUTIL_VERSION_MINOR 55 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/libavutil/opt.c b/libavutil/opt.c index 3f4a5fe957..956edf5ce7 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -323,6 +323,35 @@ int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags) return set_number(obj, name, val.num, val.den, 1, search_flags); } +int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags) +{ + void *target_obj; + const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); + uint8_t *ptr; + uint8_t **dst; + int *lendst; + + if (!o || !target_obj) + return AVERROR_OPTION_NOT_FOUND; + + if (o->type != AV_OPT_TYPE_BINARY) + return AVERROR(EINVAL); + + ptr = av_malloc(len); + if (!ptr) + return AVERROR(ENOMEM); + + dst = (uint8_t **)(((uint8_t *)target_obj) + o->offset); + lendst = (int *)(dst + 1); + + av_free(*dst); + *dst = ptr; + *lendst = len; + memcpy(ptr, val, len); + + return 0; +} + #if FF_API_OLD_AVOPTIONS /** * diff --git a/libavutil/opt.h b/libavutil/opt.h index 1b1ebe2e41..dc0dfa791e 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -562,6 +562,7 @@ int av_opt_set (void *obj, const char *name, const char *val, int search_f 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); /** * @} */ |