summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vaapi.c
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/out/vo_vaapi.c
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/out/vo_vaapi.c')
-rw-r--r--video/out/vo_vaapi.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index cf07787a48..06c7b3c9f4 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -303,14 +303,7 @@ static struct mp_image *get_screenshot(struct priv *p)
struct mp_image *hwimg = p->output_surfaces[p->visible_surface];
if (!hwimg)
return NULL;
- struct mp_image *img = va_surface_download(hwimg, NULL);
- if (!img)
- return NULL;
- struct mp_image_params params = p->image_params;
- params.imgfmt = img->imgfmt;
- mp_image_params_guess_csp(&params); // ensure colorspace consistency
- mp_image_set_params(img, &params);
- return img;
+ return mp_image_new_ref(hwimg);
}
static void free_subpicture(struct priv *p, struct vaapi_osd_image *img)