We will likely want to add new fields to it in the future, so this is
needed to avoid breaking ABI.
---
doc/APIchanges | 2 ++
libavcodec/vaapi.c | 5 +++++
libavcodec/vaapi.h | 11 +++++++++++
3 files changed, 18 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges
index 66c2590..eafea0a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -16,6 +16,8 @@ API changes, most recent first:
2013-11-xx - xxxxxxx - lavc 55.28.0 - vaapi.h
Add av_vaapi_get_profile().
Rename struct vaapi_context to AVVAAPIContext.
+ Add av_vaapi_alloc_context(). This function must from now on be
+ used for allocating AVVAAPIContext.
2013-11-xx - xxxxxxx - lavu 52.18.0 - mem.h
Move av_fast_malloc() and av_fast_realloc() for libavcodec to libavutil.
diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index d45c983..fc8760d 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -262,4 +262,9 @@ do { \
return AVERROR(EINVAL);
}
+AVVAAPIContext *av_vaapi_alloc_context(void)
+{
+ return av_mallocz(sizeof(AVVAAPIContext));
+}
+
/* @} */
diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
index f427f65..99c9f9e 100644
--- a/libavcodec/vaapi.h
+++ b/libavcodec/vaapi.h
@@ -176,6 +176,10 @@ struct vaapi_context {
* during initialization or through each AVCodecContext.get_buffer()
* function call. In any case, they must be valid prior to calling
* decoding functions.
+ *
+ * The size of this structure is not a part of the public ABI and must not
+ * be used outside of libavcodec. Use av_vaapi_alloc_context() to allocate an
+ * AVVAAPIContext.
*/
typedef struct AVVAAPIContext {
/**
@@ -299,6 +303,13 @@ typedef struct AVVAAPIContext {
} AVVAAPIContext;
/**
+ * Allocate an AVVAAPIContext.
+ *
+ * @return Newly-allocated AVVAAPIContext or NULL on failure.
+ */
+AVVAAPIContext *av_vaapi_alloc_context(void);
+
+/**
* Get a decoder profile that should be used for initializing a VAAPI config.
* Should be called from the AVCodecContext.get_format() callback.
*
--
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel