From 3c37970637c0e3f1576cae58feed05497e383fc4 Mon Sep 17 00:00:00 2001 From: Sebastien Zwickert Date: Tue, 14 Aug 2012 11:45:29 +0200 Subject: vda: support synchronous decoding Note that the symbols used to run the hardware decoder in asynchronous mode have been marked deprecated and will be dropped at a future version bump. Signed-off-by: Diego Biurrun --- libavcodec/vda.h | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'libavcodec/vda.h') diff --git a/libavcodec/vda.h b/libavcodec/vda.h index ec7d2f75b6..4daaa1463a 100644 --- a/libavcodec/vda.h +++ b/libavcodec/vda.h @@ -29,7 +29,12 @@ * Public libavcodec VDA header. */ +#include "libavcodec/version.h" + +#if FF_API_VDA_ASYNC #include +#endif + #include // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes @@ -47,8 +52,11 @@ * @{ */ +#if FF_API_VDA_ASYNC /** - * This structure is used to store a decoded frame information and data. + * This structure is used to store decoded frame information and data. + * + * @deprecated Use synchronous decoding mode. */ typedef struct vda_frame { /** @@ -75,6 +83,7 @@ typedef struct vda_frame { */ struct vda_frame *next_frame; } vda_frame; +#endif /** * This structure is used to provide the necessary configurations and data @@ -91,9 +100,28 @@ struct vda_context { */ VDADecoder decoder; + /** + * The Core Video pixel buffer that contains the current image data. + * + * encoding: unused + * decoding: Set by libavcodec. Unset by user. + */ + CVPixelBufferRef cv_buffer; + + /** + * Use the hardware decoder in synchronous mode. + * + * encoding: unused + * decoding: Set by user. + */ + int use_sync_decoding; + +#if FF_API_VDA_ASYNC /** * VDA frames queue ordered by presentation timestamp. * + * @deprecated Use synchronous decoding mode. + * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ @@ -102,10 +130,13 @@ struct vda_context { /** * Mutex for locking queue operations. * + * @deprecated Use synchronous decoding mode. + * * - encoding: unused * - decoding: Set/Unset by libavcodec. */ pthread_mutex_t queue_mutex; +#endif /** * The frame width. @@ -163,11 +194,21 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx, /** Destroy the video decoder. */ int ff_vda_destroy_decoder(struct vda_context *vda_ctx); -/** Return the top frame of the queue. */ +#if FF_API_VDA_ASYNC +/** +* Return the top frame of the queue. +* +* @deprecated Use synchronous decoding mode. +*/ vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx); -/** Release the given frame. */ +/** +* Release the given frame. +* +* @deprecated Use synchronous decoding mode. +*/ void ff_vda_release_vda_frame(vda_frame *frame); +#endif /** * @} -- cgit v1.2.3