From df9b80d21a25e06992c3a3aa87b5703404942b08 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 25 Sep 2024 20:59:35 +0200 Subject: [PATCH] lavu: deprecate av_opt_set_int_list() and related infrastructure It has no more users and is replaced by array-type options. --- doc/APIchanges | 5 +++++ libavutil/avutil.h | 3 +++ libavutil/opt.h | 2 ++ libavutil/utils.c | 2 ++ libavutil/version.h | 1 + 5 files changed, 13 insertions(+) diff --git a/doc/APIchanges b/doc/APIchanges index a79353f79b..f9a4d0e442 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,11 @@ The last version increases of all libraries were on 2024-03-07 API changes, most recent first: +2024-09-xx - xxxxxxxxxx - lavu 59 + Deprecate av_int_list_length_for_size(), av_int_list_length(), and + av_opt_set_int_list() without replacement. All AVOptions using these + should be replaced with AV_OPT_TYPE_FLAG_ARRAY. + 2024-09-xx - xxxxxxxxxx - lavfi 10.6.100 Buffersink now has array-type options - pixel_formats diff --git a/libavutil/avutil.h b/libavutil/avutil.h index d2900dcb48..ee709fbb2a 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -314,6 +314,7 @@ static inline void *av_x_if_null(const void *p, const void *x) return (void *)(intptr_t)(p ? p : x); } +#if FF_API_OPT_INT_LIST /** * Compute the length of an integer list. * @@ -322,6 +323,7 @@ static inline void *av_x_if_null(const void *p, const void *x) * @param list pointer to the list * @return length of the list, in elements, not counting the terminator */ +attribute_deprecated unsigned av_int_list_length_for_size(unsigned elsize, const void *list, uint64_t term) av_pure; @@ -334,6 +336,7 @@ unsigned av_int_list_length_for_size(unsigned elsize, */ #define av_int_list_length(list, term) \ av_int_list_length_for_size(sizeof(*(list)), list, term) +#endif /** * Return the fractional representation of the internal time base. diff --git a/libavutil/opt.h b/libavutil/opt.h index be189f7653..17374211a4 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -886,6 +886,7 @@ int av_opt_set_chlayout(void *obj, const char *name, const AVChannelLayout *layo */ int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, int search_flags); +#if FF_API_OPT_INT_LIST /** * Set a binary option to an integer list. * @@ -901,6 +902,7 @@ int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, in AVERROR(EINVAL) : \ av_opt_set_bin(obj, name, (const uint8_t *)(val), \ av_int_list_length(val, term) * sizeof(*(val)), flags)) +#endif /** * Add, replace, or remove elements for an array option. Which of these diff --git a/libavutil/utils.c b/libavutil/utils.c index 94d247bbee..162a4dee26 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -51,6 +51,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type) } } +#if FF_API_OPT_INT_LIST unsigned av_int_list_length_for_size(unsigned elsize, const void *list, uint64_t term) { @@ -69,6 +70,7 @@ unsigned av_int_list_length_for_size(unsigned elsize, } return i; } +#endif char *av_fourcc_make_string(char *buf, uint32_t fourcc) { diff --git a/libavutil/version.h b/libavutil/version.h index 1ae3f4ef87..69519cfd06 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -115,6 +115,7 @@ #define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_RISCV_FD_ZBA (LIBAVUTIL_VERSION_MAJOR < 60) #define FF_API_VULKAN_FIXED_QUEUES (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_OPT_INT_LIST (LIBAVUTIL_VERSION_MAJOR < 60) /** * @}