From 5e9f7916674c4640707727eac80c659290492bad Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 23 Jan 2015 22:06:12 +0100 Subject: video: separate screenshot modes Use different VOCTRLs for "window" and normal screenshot modes. The normal one will probably be removed, and replaced by generic code in vo.c, and this commit is preparation for this. (Doing it the other way around would be slightly simpler, but I haven't decided yet about the second one, and touching every VO is needed anyway in order to remove the unneeded crap. E.g. has_osd has been unused for a long time.) --- video/out/vo_vdpau.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 7b98b84243..1a1287c1d7 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -1048,14 +1048,15 @@ static int control(struct vo *vo, uint32_t request, void *data) case VOCTRL_RESET: forget_frames(vo, true); return true; - case VOCTRL_SCREENSHOT: { + case VOCTRL_SCREENSHOT_WIN: + case VOCTRL_SCREENSHOT: + { if (!status_ok(vo)) return false; - struct voctrl_screenshot_args *args = data; - if (args->full_window) { - args->out_image = get_window_screenshot(vo); + if (request == VOCTRL_SCREENSHOT_WIN) { + *(struct mp_image **)data = get_window_screenshot(vo); } else { - args->out_image = + *(struct mp_image **)data = vc->current_image ? mp_image_new_ref(vc->current_image) : NULL; } return true; -- cgit v1.2.3