diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vdpau.c | 5 | ||||
-rw-r--r-- | libavcodec/vdpau.h | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index cc0bcffc5f..d8a35eeb3b 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -133,4 +133,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 bf8c8e8b2c..75cb1bf7a3 100644 --- a/libavcodec/vdpau.h +++ b/libavcodec/vdpau.h @@ -74,6 +74,10 @@ union AVVDPAUPictureInfo { * 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 { /** @@ -127,6 +131,13 @@ typedef struct AVVDPAUContext { } AVVDPAUContext; /** + * 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. * |