diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-11-02 22:01:14 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-14 09:38:58 +0100 |
commit | 728c4658563dc82115ade0f1679679eddb7be5ff (patch) | |
tree | fe5f4aec0fab08090215dec4ebba6ae32449c885 | |
parent | ca22d1dea2842fca0422dd1d2bd09e7eb2c8f118 (diff) | |
download | ffmpeg-streaming-728c4658563dc82115ade0f1679679eddb7be5ff.zip ffmpeg-streaming-728c4658563dc82115ade0f1679679eddb7be5ff.tar.gz |
vdpau: add a constructor for AVVDPAUContext.
We will likely want to add new fields to it in the future, so this is
needed to avoid breaking ABI.
-rw-r--r-- | doc/APIchanges | 2 | ||||
-rw-r--r-- | libavcodec/vdpau.c | 5 | ||||
-rw-r--r-- | libavcodec/vdpau.h | 11 |
3 files changed, 18 insertions, 0 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index e00a241..e791443 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,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.25.0 - avcodec.h Add ITU-R BT.2020 and other not yet included values to color primaries, diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index cc0bcff..d8a35ee 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 bf8c8e8..75cb1bf 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. * |