From 47d46ec487faffaf72d6e253955929c5661dc111 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 29 Apr 2015 15:48:13 +0200 Subject: vo_opengl: attach target-prim/target-csp to window screenshots This will essentially make screenshot-tag-colorspace also affect the "screenshot window" command, where possible. Unfortunately, it's completely incompatible with icc-profile, due to API limitations of ffmpeg (we can only give it an enum of well-known primaries, rather than an actual ICC profile or primaries). --- video/out/vo_opengl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index dda9f1ed7e..464a6055fe 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -373,11 +373,18 @@ static int control(struct vo *vo, uint32_t request, void *data) vo->want_redraw = true; return r ? VO_TRUE : VO_NOTIMPL; } - case VOCTRL_SCREENSHOT_WIN: + case VOCTRL_SCREENSHOT_WIN: { mpgl_lock(p->glctx); - *(struct mp_image **)data = glGetWindowScreenshot(p->gl); + struct mp_image *screen = glGetWindowScreenshot(p->gl); + // set image parameters according to the display, if possible + if (screen) { + screen->params.primaries = p->renderer_opts->target_prim; + screen->params.gamma = p->renderer_opts->target_trc; + } + *(struct mp_image **)data = screen; mpgl_unlock(p->glctx); return true; + } case VOCTRL_GET_HWDEC_INFO: { struct mp_hwdec_info **arg = data; *arg = &p->hwdec_info; -- cgit v1.2.3