From ce083282f0a8b7d63c4047c30b7bac498f9806dd Mon Sep 17 00:00:00 2001 From: RĂ©mi Denis-Courmont Date: Sat, 4 Oct 2014 16:55:04 +0300 Subject: vdpau: common support for managing the VdpDecoder in avcodec Using the not so new init and uninit callbacks, avcodec can now take care of creating and destroying the VDPAU decoder instance. The application is still responsible for creating the VDPAU device and allocating video surfaces - this is necessary to keep video surfaces on the GPU all the way to the output. But the application will no longer needs to care about any codec-specific aspects. Signed-off-by: Anton Khirnov --- libavcodec/vdpau_internal.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'libavcodec/vdpau_internal.h') diff --git a/libavcodec/vdpau_internal.h b/libavcodec/vdpau_internal.h index 3f55ee7dc9..94fa9aae89 100644 --- a/libavcodec/vdpau_internal.h +++ b/libavcodec/vdpau_internal.h @@ -48,6 +48,34 @@ union AVVDPAUPictureInfo { #include "vdpau.h" #endif +typedef struct VDPAUHWContext { + AVVDPAUContext context; + VdpDevice device; + VdpGetProcAddress *get_proc_address; +} VDPAUHWContext; + +typedef struct VDPAUContext { + /** + * VDPAU device handle + */ + VdpDevice device; + + /** + * VDPAU decoder handle + */ + VdpDecoder decoder; + + /** + * VDPAU device driver + */ + VdpGetProcAddress *get_proc_address; + + /** + * VDPAU decoder render callback + */ + VdpDecoderRender *render; +} VDPAUContext; + struct vdpau_picture_context { /** * VDPAU picture information. @@ -70,6 +98,10 @@ struct vdpau_picture_context { VdpBitstreamBuffer *bitstream_buffers; }; +int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, + int level); +int ff_vdpau_common_uninit(AVCodecContext *avctx); + int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic, const uint8_t *buffer, uint32_t size); int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, -- cgit v1.2.3