diff --git a/doc/APIchanges b/doc/APIchanges index 3a5e5b646d..953a38d693 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -17,6 +17,8 @@ API changes, most recent first: 2013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h Add av_vdpau_get_profile(). + Add av_vdpau_alloc_context(). This function must from now on be + used for allocating AVVDPAUContext. 2013-11-xx - xxxxxxx - lavc 55.41.100 / 55.25.0 - avcodec.h lavu 52.51.100 - frame.h diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index b848174f90..0eebb9cdc1 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -40,7 +40,7 @@ AVVDPAUContext *av_alloc_vdpaucontext(void) { - return av_mallocz(sizeof(AVVDPAUContext)); + return av_vdpau_alloc_context(); } MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2) @@ -481,4 +481,9 @@ do { \ return AVERROR(EINVAL); } +AVVDPAUContext *av_vdpau_alloc_context(void) +{ + return av_mallocz(sizeof(AVVDPAUContext)); +} + /* @}*/ diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h index b84bdeaeba..e25cc42d7e 100644 --- a/libavcodec/vdpau.h +++ b/libavcodec/vdpau.h @@ -82,6 +82,10 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, * 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_vdpau_alloc_context() to allocate an + * AVVDPAUContext. */ typedef struct AVVDPAUContext { /** @@ -145,6 +149,13 @@ AVVDPAUContext *av_alloc_vdpaucontext(void); AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); +/** + * Allocate an AVVDPAUContext. + * + * @return Newly-allocated AVVDPAUContext or NULL on failure. + */ +AVVDPAUContext *av_vdpau_alloc_context(void); + /** * Get a decoder profile that should be used for initializing a VDPAU decoder. * Should be called from the AVCodecContext.get_format() callback.