From 03cf150ff3516789d581214177f291d46310aaf4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 22 Aug 2017 17:01:35 +0200 Subject: 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. --- video/out/vo_vdpau.c | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index eb89301e94..ada3fb805b 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -135,9 +135,6 @@ struct vdpctx { int render_count; int change_id; } osd_surfaces[MAX_OSD_PARTS]; - - // Video equalizer - struct mp_csp_equalizer video_eq; }; static bool status_ok(struct vo *vo); @@ -1026,6 +1023,7 @@ static int preinit(struct vo *vo) hwdec_devices_add(vo->hwdec_devs, &vc->mpvdp->hwctx); vc->video_mixer = mp_vdpau_mixer_create(vc->mpvdp, vo->log); + vc->video_mixer->video_eq = mp_csp_equalizer_create(vo, vo->global); if (mp_vdpau_guess_if_emulated(vc->mpvdp)) { MP_WARN(vo, "VDPAU is most likely emulated via VA-API.\n" @@ -1044,35 +1042,9 @@ static int preinit(struct vo *vo) vc->vdp->bitmap_surface_query_capabilities(vc->vdp_device, VDP_RGBA_FORMAT_A8, &vc->supports_a8, &(uint32_t){0}, &(uint32_t){0}); - vc->video_eq.capabilities = MP_CSP_EQ_CAPS_COLORMATRIX; - return 0; } -static int get_equalizer(struct vo *vo, const char *name, int *value) -{ - struct vdpctx *vc = vo->priv; - - if (vc->rgb_mode) - return false; - - return mp_csp_equalizer_get(&vc->video_mixer->video_eq, name, value) >= 0 ? - VO_TRUE : VO_NOTIMPL; -} - -static int set_equalizer(struct vo *vo, const char *name, int value) -{ - struct vdpctx *vc = vo->priv; - - if (vc->rgb_mode) - return false; - - if (mp_csp_equalizer_set(&vc->video_mixer->video_eq, name, value) < 0) - return VO_NOTIMPL; - vc->video_mixer->initialized = false; - return true; -} - static void checked_resize(struct vo *vo) { if (!status_ok(vo)) @@ -1090,15 +1062,9 @@ static int control(struct vo *vo, uint32_t request, void *data) case VOCTRL_SET_PANSCAN: checked_resize(vo); return VO_TRUE; - case VOCTRL_SET_EQUALIZER: { + case VOCTRL_SET_EQUALIZER: vo->want_redraw = true; - struct voctrl_set_equalizer_args *args = data; - return set_equalizer(vo, args->name, args->value); - } - case VOCTRL_GET_EQUALIZER: { - struct voctrl_get_equalizer_args *args = data; - return get_equalizer(vo, args->name, args->valueptr); - } + return true; case VOCTRL_RESET: forget_frames(vo, true); return true; -- cgit v1.2.3