diff --git a/doc/APIchanges b/doc/APIchanges index 8d305d5867facc59b5d2f3bf76215c5d961bb40d..a216e5aa4dff2e0259542f45f79b74f70a549ce9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2018-04-xx - xxxxxxxxxx - lavu 56.17.100 - opt.h + Add AV_OPT_FLAG_DEPRECATED. + 2018-04-xx - xxxxxxxxxx - lavu 56.16.100 - threadmessage.h Add av_thread_message_queue_nb_elems(). diff --git a/libavutil/opt.c b/libavutil/opt.c index 3b0aab4ee82ea0944be8d82ea8195d421f030b01..99282605f585930a7899249a586bc4eba202fd59 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -463,6 +463,9 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags) if (o->flags & AV_OPT_FLAG_READONLY) return AVERROR(EINVAL); + if (o->flags & AV_OPT_FLAG_DEPRECATED) + av_log(obj, AV_LOG_WARNING, "The \"%s\" option is deprecated: %s\n", name, o->help); + dst = ((uint8_t *)target_obj) + o->offset; switch (o->type) { case AV_OPT_TYPE_BOOL: @@ -759,6 +762,9 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) if (!o || !target_obj || (o->offset<=0 && o->type != AV_OPT_TYPE_CONST)) return AVERROR_OPTION_NOT_FOUND; + if (o->flags & AV_OPT_FLAG_DEPRECATED) + av_log(obj, AV_LOG_WARNING, "The \"%s\" option is deprecated: %s\n", name, o->help); + dst = (uint8_t *)target_obj + o->offset; buf[0] = 0; diff --git a/libavutil/opt.h b/libavutil/opt.h index 07da68ea23d37ad8b1d58b7304ad8f7b9bb0787e..39f4a8dda0e798ee595f147d6a7e85d89ad47e99 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -289,6 +289,7 @@ typedef struct AVOption { #define AV_OPT_FLAG_READONLY 128 #define AV_OPT_FLAG_BSF_PARAM (1<<8) ///< a generic parameter which can be set by the user for bit stream filtering #define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering +#define AV_OPT_FLAG_DEPRECATED (1<<17) ///< set if option is deprecated, users should refer to AVOption.help text for more information //FIXME think about enc-audio, ... style flags /** diff --git a/libavutil/version.h b/libavutil/version.h index 23567000a333d4c5ef2bfba30e7accc8c41b0407..b087c1548804e887c1158e57d74ae875920fd650 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 56 -#define LIBAVUTIL_VERSION_MINOR 16 +#define LIBAVUTIL_VERSION_MINOR 17 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \