aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2017-10-26 00:18:44 +0100
committerMark Thompson <sw@jkqxz.net>2017-12-19 23:22:31 +0000
commite2d575543ceeee72f12ac911e72f802bc6cba32e (patch)
tree99aa0ba5f4f9c6d89d636943da6f7e35acd7db18
parent39056b5240524e4119fa630240f9b45ea0230aad (diff)
downloadffmpeg-e2d575543ceeee72f12ac911e72f802bc6cba32e.tar.gz
lavc: Deprecate av_hwaccel_next() and av_register_hwaccel()
-rw-r--r--doc/APIchanges4
-rw-r--r--libavcodec/avcodec.h13
-rw-r--r--libavcodec/utils.c15
-rw-r--r--libavcodec/version.h5
4 files changed, 26 insertions, 11 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index f5f15c49a1..e29fb24172 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,10 @@ libavutil: 2017-03-23
API changes, most recent first:
+2017-xx-xx - xxxxxxx - lavc 58.7.0 - avcodec.h
+ Deprecate user visibility of the AVHWAccel structure and the functions
+ av_register_hwaccel() and av_hwaccel_next().
+
2017-xx-xx - xxxxxxx - lavc 58.6.0 - avcodec.h
Add AVCodecHWConfig and avcodec_get_hw_config().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index cf9f9dfe84..53b5a7c4d4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2962,6 +2962,10 @@ const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index);
/**
* @defgroup lavc_hwaccel AVHWAccel
+ *
+ * @note Nothing in this structure should be accessed by the user. At some
+ * point in future it will not be externally visible at all.
+ *
* @{
*/
typedef struct AVHWAccel {
@@ -5040,17 +5044,26 @@ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
*/
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+#if FF_API_USER_VISIBLE_AVHWACCEL
/**
* Register the hardware accelerator hwaccel.
+ *
+ * @deprecated This function doesn't do anything.
*/
+attribute_deprecated
void av_register_hwaccel(AVHWAccel *hwaccel);
/**
* If hwaccel is NULL, returns the first registered hardware accelerator,
* if hwaccel is non-NULL, returns the next registered hardware accelerator
* after hwaccel, or NULL if hwaccel is the last one.
+ *
+ * @deprecated AVHWaccel structures contain no user-serviceable parts, so
+ * this function should not be used.
*/
+attribute_deprecated
AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel);
+#endif
/**
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3d6b35fa41..ba3457664a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1347,21 +1347,16 @@ const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index)
return &codec->hw_configs[index]->public;
}
-static AVHWAccel *first_hwaccel = NULL;
-
-void av_register_hwaccel(AVHWAccel *hwaccel)
+#if FF_API_USER_VISIBLE_AVHWACCEL
+AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel)
{
- AVHWAccel **p = &first_hwaccel;
- while (*p)
- p = &(*p)->next;
- *p = hwaccel;
- hwaccel->next = NULL;
+ return NULL;
}
-AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel)
+void av_register_hwaccel(AVHWAccel *hwaccel)
{
- return hwaccel ? hwaccel->next : first_hwaccel;
}
+#endif
int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
{
diff --git a/libavcodec/version.h b/libavcodec/version.h
index e6edd5c867..7ef743dc69 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
-#define LIBAVCODEC_VERSION_MINOR 6
+#define LIBAVCODEC_VERSION_MINOR 7
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -95,5 +95,8 @@
#ifndef FF_API_VAAPI_CONTEXT
#define FF_API_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
+#ifndef FF_API_USER_VISIBLE_AVHWACCEL
+#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 60)
+#endif
#endif /* AVCODEC_VERSION_H */