From 807147d9c063bd8b9711f69f31579ccdef30efdf Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 16 Feb 2017 16:28:36 +0100 Subject: vd_lavc: move most vaapi hwaccel setup code to generic code Now hw_vaapi.c contains only the device setup, which could probably also be abstracted. --- video/decode/lavc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'video/decode/lavc.h') diff --git a/video/decode/lavc.h b/video/decode/lavc.h index 46bf85a6e5..b41d56ce2f 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -55,6 +55,9 @@ typedef struct lavc_ctx { // For free use by hwdec implementation void *hwdec_priv; + // Set by generic hwaccels. + struct mp_hwdec_ctx *hwdec_dev; + int hwdec_fmt; int hwdec_w; int hwdec_h; @@ -98,6 +101,16 @@ struct vd_lavc_hwdec { // with hwdec_find_decoder. // Intuitively, this will force the corresponding wrapper decoder. const char *lavc_suffix; + // Generic hwaccels set AVCodecContext.hw_frames_ctx in get_format(). + // pixfmt_map must be non-NULL. + // struct lavc_ctx.hwdec_dev must be set at runtime (in init). + bool generic_hwaccel; + // Array of pixfmt pairs. The first pixfmt is the AVCodecContext.sw_pix_fmt, + // the second the required AVHWFramesContext.sw_format. + const enum AVPixelFormat (*pixfmt_map)[2]; + // The generic hwaccel has a fixed pool size. Enough surfaces need to be + // preallocated before decoding begins. If false, pool size is left to 0. + bool static_pool; }; enum { -- cgit v1.2.3