From b2657814c9f7e38bf576d068619822823dbec8e1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 2 Sep 2016 14:50:03 +0200 Subject: 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. --- video/out/opengl/video.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 658153372e..56005e77eb 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -594,6 +594,19 @@ static void uninit_rendering(struct gl_video *p) gl_sc_reset_error(p->sc); } +bool gl_video_gamma_auto_enabled(struct gl_video *p) +{ + return p->opts.gamma_auto; +} + +struct mp_colorspace gl_video_get_output_colorspace(struct gl_video *p) +{ + return (struct mp_colorspace) { + .primaries = p->opts.target_prim, + .gamma = p->opts.target_trc, + }; +} + // Warning: profile.start must point to a ta allocation, and the function // takes over ownership. void gl_video_set_icc_profile(struct gl_video *p, bstr icc_data) -- cgit v1.2.3