diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-12 01:57:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-12 01:57:02 +0200 |
commit | 5449239a031e657cfe364521d2b6d58c0ef0e7f0 (patch) | |
tree | c7293a1078cf2840bbe3515e6ab2d56f7f64ee9b /libavcodec/vda.h | |
parent | c6a683bf2291344238cb1fc2bd84c91fa1acd3bc (diff) | |
parent | 67afcefb35932b420998f6f3fda46c7c85848a3f (diff) | |
download | ffmpeg-5449239a031e657cfe364521d2b6d58c0ef0e7f0.tar.gz |
Merge commit '67afcefb35932b420998f6f3fda46c7c85848a3f'
* commit '67afcefb35932b420998f6f3fda46c7c85848a3f':
lavc: Add new VDA hwaccel
Conflicts:
configure
libavcodec/vda.h
libavcodec/vda_h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vda.h')
-rw-r--r-- | libavcodec/vda.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/libavcodec/vda.h b/libavcodec/vda.h index 89059bdf00..12330aa363 100644 --- a/libavcodec/vda.h +++ b/libavcodec/vda.h @@ -29,6 +29,8 @@ * Public libavcodec VDA header. */ +#include "libavcodec/avcodec.h" + #include <stdint.h> // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes @@ -153,6 +155,58 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx, int ff_vda_destroy_decoder(struct vda_context *vda_ctx); /** + * This struct holds all the information that needs to be passed + * between the caller and libavcodec for initializing VDA decoding. + * Its size is not a part of the public ABI, it must be allocated with + * av_vda_alloc_context() and freed with av_free(). + */ +typedef struct AVVDAContext { + /** + * VDA decoder object. Created and freed by the caller. + */ + VDADecoder decoder; + + /** + * The output callback that must be passed to VDADecoderCreate. + * Set by av_vda_alloc_context(). + */ + VDADecoderOutputCallback output_callback; +} AVVDAContext; + +/** + * Allocate and initialize a VDA context. + * + * This function should be called from the get_format() callback when the caller + * selects the AV_PIX_FMT_VDA format. The caller must then create the decoder + * object (using the output callback provided by libavcodec) that will be used + * for VDA-accelerated decoding. + * + * When decoding with VDA is finished, the caller must destroy the decoder + * object and free the VDA context using av_free(). + * + * @return the newly allocated context or NULL on failure + */ +AVVDAContext *av_vda_alloc_context(void); + +/** + * This is a convenience function that creates and sets up the VDA context using + * an internal implementation. + * + * @param avctx the corresponding codec context + * + * @return >= 0 on success, a negative AVERROR code on failure + */ +int av_vda_default_init(AVCodecContext *avctx); + +/** + * This function must be called to free the VDA context initialized with + * av_vda_default_init(). + * + * @param avctx the corresponding codec context + */ +void av_vda_default_free(AVCodecContext *avctx); + +/** * @} */ |