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/vdpau.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'video/vdpau.h') diff --git a/video/vdpau.h b/video/vdpau.h index 0af00f098b..2304ecd0d6 100644 --- a/video/vdpau.h +++ b/video/vdpau.h @@ -12,14 +12,17 @@ #include "common/msg.h" #include "hwdec.h" -#define CHECK_VDP_ERROR(ctx, message) \ +#define CHECK_VDP_ERROR_ST(ctx, message, statement) \ do { \ if (vdp_st != VDP_STATUS_OK) { \ MP_ERR(ctx, "%s: %s\n", message, vdp->get_error_string(vdp_st)); \ - return -1; \ + statement \ } \ } while (0) +#define CHECK_VDP_ERROR(ctx, message) \ + CHECK_VDP_ERROR_ST(ctx, message, return -1;) + #define CHECK_VDP_WARNING(ctx, message) \ do { \ if (vdp_st != VDP_STATUS_OK) \ @@ -71,6 +74,9 @@ struct mp_vdpau_ctx { bool in_use; int64_t age; } video_surfaces[MAX_VIDEO_SURFACES]; + struct mp_vdpau_mixer *getimg_mixer; + VdpOutputSurface getimg_surface; + int getimg_w, getimg_h; }; struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log, Display *x11); -- cgit v1.2.3