diff options
author | wm4 <wm4@nowhere> | 2015-01-22 17:47:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-22 18:18:23 +0100 |
commit | 74581a61064f56b170e555fa72d9cdca161d2307 (patch) | |
tree | 532223eaa3644b01501d443ebca9011ee12af963 /video/vdpau_mixer.c | |
parent | e9ac3fc3a1505c4db1773a2a24d35ac41ab69887 (diff) | |
download | mpv-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_mixer.c')
-rw-r--r-- | video/vdpau_mixer.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/video/vdpau_mixer.c b/video/vdpau_mixer.c index d3a4a02457..3c8f3fb908 100644 --- a/video/vdpau_mixer.c +++ b/video/vdpau_mixer.c @@ -221,7 +221,21 @@ int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer, struct vdp_functions *vdp = &mixer->ctx->vdp; VdpStatus vdp_st; - assert(video->imgfmt == IMGFMT_VDPAU); + if (video->imgfmt == IMGFMT_VDPAU_OUTPUT) { + VdpOutputSurface surface = (uintptr_t)video->planes[3]; + int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0; + vdp_st = vdp->output_surface_render_output_surface(output, + output_rect, + surface, + video_rect, + NULL, NULL, flags); + CHECK_VDP_WARNING(mixer, "Error when calling " + "vdp_output_surface_render_output_surface"); + return 0; + } + + if (video->imgfmt != IMGFMT_VDPAU) + return -1; struct mp_vdpau_mixer_frame *frame = mp_vdpau_mixed_frame_get(video); struct mp_vdpau_mixer_frame fallback = {{0}}; |