summaryrefslogtreecommitdiffstats
path: root/video/vdpau.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-22 17:47:14 +0100
committerwm4 <wm4@nowhere>2015-01-22 18:18:23 +0100
commit74581a61064f56b170e555fa72d9cdca161d2307 (patch)
tree532223eaa3644b01501d443ebca9011ee12af963 /video/vdpau.h
parente9ac3fc3a1505c4db1773a2a24d35ac41ab69887 (diff)
downloadmpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.bz2
mpv-74581a61064f56b170e555fa72d9cdca161d2307.tar.xz
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.
Diffstat (limited to 'video/vdpau.h')
-rw-r--r--video/vdpau.h10
1 files changed, 8 insertions, 2 deletions
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);