From 74581a61064f56b170e555fa72d9cdca161d2307 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Jan 2015 17:47:14 +0100 Subject: video: handle hwdec screenshots differently Instead of converting the hw surface to an image in the VO, provide a generic way to convet hw surfaces, and use this in the screenshot code. It's all relatively straightforward, except vdpau is being terrible. It needs a huge chunk of new code, because copying back is not simple. --- video/hwdec.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'video/hwdec.h') diff --git a/video/hwdec.h b/video/hwdec.h index 149cd81bae..a7d2cf8c4b 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -9,6 +9,15 @@ struct mp_hwdec_ctx { // API-specific, not needed by all backends. struct mp_vdpau_ctx *vdpau_ctx; struct mp_vaapi_ctx *vaapi_ctx; + + // Optional. + // Allocates a software image from the pool, downloads the hw image from + // mpi, and returns it. + // pool can be NULL (then just use straight allocation). + // Return NULL on error or if mpi has the wrong format. + struct mp_image *(*download_image)(struct mp_hwdec_ctx *ctx, + struct mp_image *mpi, + struct mp_image_pool *swpool); }; // Used to communicate hardware decoder API handles from VO to video decoder. -- cgit v1.2.3