summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-06-03 20:35:17 +0200
committerwm4 <wm4@nowhere>2016-06-03 20:35:22 +0200
commit026b75e7f509d29d25f42cb335538f369fb6c381 (patch)
tree23bf7c8664e97cb040fe6c90efd7156b2aa1040b /video/out/vo_opengl.c
parent2179879172be97541ceffdd7d29cba09c1ca9629 (diff)
downloadmpv-026b75e7f509d29d25f42cb335538f369fb6c381.tar.bz2
mpv-026b75e7f509d29d25f42cb335538f369fb6c381.tar.xz
vo_opengl: move all icc handling from vo_opengl.c to video.c
Originally, video.c did not access any CMS things (other than lut3d being set on it), but this has changed. In practice, almost all accesses to it have moved to video.c. vo_opengl only created it, and set the auto icc profile path. Complete the move. Some things wrt. option handling are a bit fishy. (But when is this not the case.) icc-profile-auto was not tested, but the distributed human CI will take care of it.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 4a3b5e7b4e..8016569c42 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -45,7 +45,6 @@
#include "filter_kernels.h"
#include "video/hwdec.h"
#include "opengl/video.h"
-#include "opengl/lcms.h"
#define NUM_VSYNC_FENCES 10
@@ -56,13 +55,11 @@ struct gl_priv {
GL *gl;
struct gl_video *renderer;
- struct gl_lcms *cms;
struct gl_hwdec *hwdec;
// Options
struct gl_video_opts *renderer_opts;
- struct mp_icc_opts *icc_opts;
int use_glFinish;
int waitvsync;
int use_gl_debug;
@@ -216,8 +213,7 @@ static void call_request_hwdec_api(void *ctx, enum hwdec_type type)
static void get_and_update_icc_profile(struct gl_priv *p, int *events)
{
- bool has_profile = p->icc_opts->profile && p->icc_opts->profile[0];
- if (p->icc_opts->profile_auto && !has_profile) {
+ if (gl_video_icc_auto_enabled(p->renderer)) {
MP_VERBOSE(p, "Querying ICC profile...\n");
bstr icc = bstr0(NULL);
int r = mpgl_control(p->glctx, events, VOCTRL_GET_ICC_PROFILE, &icc);
@@ -229,13 +225,9 @@ static void get_and_update_icc_profile(struct gl_priv *p, int *events)
MP_ERR(p, "icc-profile-auto not implemented on this platform.\n");
}
- gl_lcms_set_memory_profile(p->cms, &icc);
- has_profile = true;
+ gl_video_set_icc_profile(p->renderer, icc);
}
}
-
- if (has_profile)
- gl_video_update_profile(p->renderer);
}
static void get_and_update_ambient_lighting(struct gl_priv *p, int *events)
@@ -407,17 +399,13 @@ static int preinit(struct vo *vo)
MP_VERBOSE(vo, "swap_control extension missing.\n");
}
- p->cms = gl_lcms_init(p, vo->log, vo->global);
- if (!p->cms)
- goto err_out;
- p->renderer = gl_video_init(p->gl, vo->log, vo->global, p->cms);
+ p->renderer = gl_video_init(p->gl, vo->log, vo->global);
if (!p->renderer)
goto err_out;
gl_video_set_osd_source(p->renderer, vo->osd);
gl_video_set_options(p->renderer, p->renderer_opts);
gl_video_configure_queue(p->renderer, vo);
- gl_lcms_set_options(p->cms, p->icc_opts);
get_and_update_icc_profile(p, &(int){0});
vo->hwdec_devs = hwdec_devices_create();
@@ -455,7 +443,6 @@ static const struct m_option options[] = {
OPT_INTRANGE("vsync-fences", opt_vsync_fences, 0, 0, NUM_VSYNC_FENCES),
OPT_SUBSTRUCT("", renderer_opts, gl_video_conf, 0),
- OPT_SUBSTRUCT("", icc_opts, mp_icc_conf, 0),
{0},
};