summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-22 17:01:35 +0200
committerwm4 <wm4@nowhere>2017-08-22 17:01:35 +0200
commit03cf150ff3516789d581214177f291d46310aaf4 (patch)
tree2f352bf9c6d36e10001accdb72cef2d7683ab04a /video/out/opengl/video.c
parentd67aa6da6bbd3cba9eabd12cda4703821fecc7a1 (diff)
downloadmpv-03cf150ff3516789d581214177f291d46310aaf4.tar.bz2
mpv-03cf150ff3516789d581214177f291d46310aaf4.tar.xz
video: redo video equalizer option handling
I really wouldn't care much about this, but some parts of the core code are under HAVE_GPL, so there's some need to get rid of it. Simply turn the video equalizer from its current fine-grained handling with vf/vo fallbacks into global options. This makes updating them much simpler. This removes any possibility of applying video equalizers in filters, which affects vf_scale, and the previously removed vf_eq. Not a big loss, since the preferred VOs have this builtin. Remove video equalizer handling from vo_direct3d, vo_sdl, vo_vaapi, and vo_xv. I'm not going to waste my time on these legacy VOs. vo.eq_opts_cache exists _only_ to send a VOCTRL_SET_EQUALIZER, which exists _only_ to trigger a redraw. This seems silly, but for now I feel like this is less of a pain. The rest of the equalizer using code is self-updating. See commit 96b906a51d5 for how some video equalizer code was GPL only. Some command line option names and ranges can probably be traced back to a GPL only committer, but we don't consider these copyrightable.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index bbf88e2747..f95222081c 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -242,7 +242,7 @@ struct gl_video {
// state for configured scalers
struct scaler scaler[SCALER_COUNT];
- struct mp_csp_equalizer video_eq;
+ struct mp_csp_equalizer_state *video_eq;
struct mp_rect src_rect; // displayed part of the source video
struct mp_rect dst_rect; // video rectangle on output window
@@ -848,13 +848,6 @@ static void init_video(struct gl_video *p)
mp_image_params_guess_csp(&p->image_params);
- int eq_caps = MP_CSP_EQ_CAPS_GAMMA;
- if (p->image_params.color.space != MP_CSP_BT_2020_C)
- eq_caps |= MP_CSP_EQ_CAPS_COLORMATRIX;
- if (p->image_params.color.space == MP_CSP_XYZ)
- eq_caps |= MP_CSP_EQ_CAPS_BRIGHTNESS;
- p->video_eq.capabilities = eq_caps;
-
av_lfg_init(&p->lfg, 1);
debug_check_gl(p, "before video texture creation");
@@ -2173,7 +2166,7 @@ static void pass_convert_yuv(struct gl_video *p)
struct mp_csp_params cparams = MP_CSP_PARAMS_DEFAULTS;
cparams.gray = p->is_gray;
mp_csp_set_image_params(&cparams, &p->image_params);
- mp_csp_copy_equalizer_values(&cparams, &p->video_eq);
+ mp_csp_equalizer_state_get(p->video_eq, &cparams);
p->user_gamma = 1.0 / (cparams.gamma * p->opts.gamma);
pass_describe(p, "color conversion");
@@ -3582,6 +3575,7 @@ struct gl_video *gl_video_init(struct ra *ra, struct mp_log *log,
.global = g,
.log = log,
.sc = gl_sc_create(ra, g, log),
+ .video_eq = mp_csp_equalizer_create(p, g),
.opts_cache = m_config_cache_alloc(p, g, &gl_video_conf),
};
// make sure this variable is initialized to *something*
@@ -3674,16 +3668,6 @@ void gl_video_configure_queue(struct gl_video *p, struct vo *vo)
vo_set_queue_params(vo, 0, queue_size);
}
-struct mp_csp_equalizer *gl_video_eq_ptr(struct gl_video *p)
-{
- return &p->video_eq;
-}
-
-// Call when the mp_csp_equalizer returned by gl_video_eq_ptr() was changed.
-void gl_video_eq_update(struct gl_video *p)
-{
-}
-
static int validate_scaler_opt(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param)
{
@@ -3758,7 +3742,6 @@ void gl_video_set_ambient_lux(struct gl_video *p, int lux)
float gamma = gl_video_scale_ambient_lux(16.0, 64.0, 2.40, 1.961, lux);
MP_VERBOSE(p, "ambient light changed: %dlux (gamma: %f)\n", lux, gamma);
p->opts.gamma = MPMIN(1.0, 1.961 / gamma);
- gl_video_eq_update(p);
}
}