summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-02 14:50:03 +0200
committerwm4 <wm4@nowhere>2016-09-02 14:50:03 +0200
commitb2657814c9f7e38bf576d068619822823dbec8e1 (patch)
tree62a5a2744f68582fffd77a0d3e82847e49d3d4ac /video/out/vo_opengl.c
parent4fa6bcbb902d500ca0a1b9d2feeab5a4e5a98345 (diff)
downloadmpv-b2657814c9f7e38bf576d068619822823dbec8e1.tar.bz2
mpv-b2657814c9f7e38bf576d068619822823dbec8e1.tar.xz
vo_opengl: minor renderer option access refactor
Reduce accesses to the renderer opts in vo_opengl.c, and instead add accessors for them to video.c. I suppose gamma and maybe icc-auto could be moved to vo_opengl.c options. Also, the output colorspace could probably be adjusted to what is really used, not just the options (although it's possible that this commit changes this, due to video.c mutating its own copy of the options according to actual renderer capapbilities). But don't deal with this now.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 0e4c117352..300a3a76d0 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -242,7 +242,7 @@ static void get_and_update_ambient_lighting(struct gl_priv *p)
if (r == VO_TRUE) {
gl_video_set_ambient_lux(p->renderer, lux);
}
- if (r != VO_TRUE && p->renderer_opts->gamma_auto) {
+ if (r != VO_TRUE && gl_video_gamma_auto_enabled(p->renderer)) {
MP_ERR(p, "gamma_auto option provided, but querying for ambient"
" lighting is not supported on this platform\n");
}
@@ -306,10 +306,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
struct mp_image *screen = gl_read_window_contents(p->gl);
// set image parameters according to the display, if possible
if (screen) {
- screen->params.color = (struct mp_colorspace) {
- .primaries = p->renderer_opts->target_prim,
- .gamma = p->renderer_opts->target_trc,
- };
+ screen->params.color = gl_video_get_output_colorspace(p->renderer);
if (p->glctx->flip_v)
mp_image_vflip(screen);
}