[FFmpeg-devel] [PATCH] vdpau: Add an allocation function for AVVDPAUContext.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Aug 11 11:22:18 CEST 2013


Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 doc/APIchanges       |  4 ++++
 libavcodec/vdpau.c   |  5 +++++
 libavcodec/vdpau.h   | 10 +++++++++-
 libavcodec/version.h |  2 +-
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index dc40bc3..1c0a5ba 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2013-08-xx - xxxxxxx - lavc 55.25.100 - vdpau.h
+  Add allocation function for AVVDPAUContext, allowing
+  to extend it in the future without breaking ABI/API.
+
 2013-08-xx - xxxxxxx - lavc 55.13.0 - avcodec.h
   Deprecate the bitstream-related members from struct AVVDPAUContext.
   The bistream buffers no longer need to be explicitly freed.
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index cf564a5..63ea755 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -38,6 +38,11 @@
  * @{
  */
 
+AVVDPAUContext *av_alloc_vdpaucontext(void)
+{
+    return av_mallocz(sizeof(AVVDPAUContext));
+}
+
 int ff_vdpau_common_start_frame(Picture *pic,
                                 av_unused const uint8_t *buffer,
                                 av_unused uint32_t size)
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 08116bf..210d517 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -73,7 +73,8 @@ union AVVDPAUPictureInfo {
 /**
  * This structure is used to share data between the libavcodec library and
  * the client video application.
- * The user shall zero-allocate the structure and make it available as
+ * The user shall allocate the structure via the av_alloc_vdpau_hwaccel
+ * function and make it available as
  * AVCodecContext.hwaccel_context. Members can be set by the user once
  * during initialization or through each AVCodecContext.get_buffer()
  * function call. In any case, they must be valid prior to calling
@@ -130,6 +131,13 @@ typedef struct AVVDPAUContext {
 #endif
 } AVVDPAUContext;
 
+/**
+ * @brief allocation function for AVVDPAUContext
+ *
+ * Allows extending the struct without breaking API/ABI
+ */
+AVVDPAUContext *av_alloc_vdpaucontext(void);
+
 #if FF_API_CAP_VDPAU
 /** @brief The videoSurface is used for rendering. */
 #define FF_VDPAU_STATE_USED_FOR_RENDER 1
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 75b15a7..ad8af90 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/avutil.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR  24
+#define LIBAVCODEC_VERSION_MINOR  25
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.8.4.rc1



More information about the ffmpeg-devel mailing list