summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorNiklas Haas <git@nand.wakku.to>2015-04-29 15:48:13 +0200
committerwm4 <wm4@nowhere>2015-05-01 21:52:07 +0200
commit47d46ec487faffaf72d6e253955929c5661dc111 (patch)
tree4bb0054bd43e9fd52ca6bf4d5c2ed9e3afc367f0 /video
parent756991bd4f78d3a241df1f4fa208d5f55ef95833 (diff)
downloadmpv-47d46ec487faffaf72d6e253955929c5661dc111.tar.bz2
mpv-47d46ec487faffaf72d6e253955929c5661dc111.tar.xz
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).
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_opengl.c11
1 files changed, 9 insertions, 2 deletions
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;