vo: remove VOCTRL_SET_EQUALIZER and simplify into UPDATE_VIDEO

Since 03cf150ff3, the only purpose of this
VOCTRL was to signal a redraw to the vo. It actualy could have been
removed in 531868fe0d, but this was
missed. The UPDATE_VIDEO flag is better anyway because it allows us to
handle a wide variety of options scattered around that require the VO to
update itself and redraw. We can remove both of the custom callbacks in
vo.c and only leave the VOCTRL_VO_OPTS_CHANGED one. Additionally, that
commit also introduced vo_set_want_redraw, but this is redundant and not
needed. The VOs that use VOCTRL_UPDATE_RENDER_OPTS already set
vo->want_redraw, and those are the only VOs where these options are
relevant in the first place. So we can remove this as well and just let
the big callback in player/command do everything.
This commit is contained in:
Dudemanguy 2024-02-14 11:26:05 -06:00
parent fb33bb7fc4
commit 073858fcdd
7 changed files with 1 additions and 41 deletions

View File

@ -7122,7 +7122,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
if (flags & UPDATE_VIDEO) {
if (mpctx->video_out) {
vo_set_want_redraw(mpctx->video_out);
vo_control(mpctx->video_out, VOCTRL_UPDATE_RENDER_OPTS, NULL);
mp_wakeup_core(mpctx);
}
}

View File

@ -236,7 +236,6 @@ static void update_opts(void *p)
if (m_config_cache_update(vo->opts_cache)) {
read_opts(vo);
if (vo->driver->control) {
vo->driver->control(vo, VOCTRL_VO_OPTS_CHANGED, NULL);
// "Legacy" update of video position related options.
@ -244,18 +243,6 @@ static void update_opts(void *p)
vo->driver->control(vo, VOCTRL_SET_PANSCAN, NULL);
}
}
if (vo->gl_opts_cache && m_config_cache_update(vo->gl_opts_cache)) {
// "Legacy" update of video GL renderer related options.
if (vo->driver->control)
vo->driver->control(vo, VOCTRL_UPDATE_RENDER_OPTS, NULL);
}
if (m_config_cache_update(vo->eq_opts_cache)) {
// "Legacy" update of video equalizer related options.
if (vo->driver->control)
vo->driver->control(vo, VOCTRL_SET_EQUALIZER, NULL);
}
}
// Does not include thread- and VO uninit.
@ -318,12 +305,7 @@ static struct vo *vo_create(bool probing, struct mpv_global *global,
update_opts, vo);
vo->gl_opts_cache = m_config_cache_alloc(NULL, global, &gl_video_conf);
m_config_cache_set_dispatch_change_cb(vo->gl_opts_cache, vo->in->dispatch,
update_opts, vo);
vo->eq_opts_cache = m_config_cache_alloc(NULL, global, &mp_csp_equalizer_conf);
m_config_cache_set_dispatch_change_cb(vo->eq_opts_cache, vo->in->dispatch,
update_opts, vo);
mp_input_set_mouse_transform(vo->input_ctx, NULL, NULL);
if (vo->driver->encode != !!vo->encode_lavc_ctx)
@ -1235,16 +1217,6 @@ void vo_redraw(struct vo *vo)
mp_mutex_unlock(&in->lock);
}
// Same as vo_redraw but the redraw is delayed until it
// is detected in the playloop.
void vo_set_want_redraw(struct vo *vo)
{
struct vo_internal *in = vo->in;
mp_mutex_lock(&in->lock);
in->want_redraw = true;
mp_mutex_unlock(&in->lock);
}
bool vo_want_redraw(struct vo *vo)
{
struct vo_internal *in = vo->in;

View File

@ -67,7 +67,6 @@ enum mp_voctrl {
VOCTRL_RESUME,
VOCTRL_SET_PANSCAN,
VOCTRL_SET_EQUALIZER,
// Triggered by any change to mp_vo_opts. This is for convenience. In theory,
// you could install your own listener.
@ -513,7 +512,6 @@ bool vo_still_displaying(struct vo *vo);
void vo_request_wakeup_on_done(struct vo *vo);
bool vo_has_frame(struct vo *vo);
void vo_redraw(struct vo *vo);
void vo_set_want_redraw(struct vo *vo);
bool vo_want_redraw(struct vo *vo);
void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);

View File

@ -186,9 +186,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_SET_PANSCAN:
resize(vo);
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
vo->want_redraw = true;
return VO_TRUE;
case VOCTRL_SCREENSHOT: {
struct vo_frame *frame = vo_get_current_vo_frame(vo);
if (frame)

View File

@ -1425,7 +1425,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_SET_PANSCAN:
resize(vo);
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
case VOCTRL_PAUSE:
if (p->is_interpolated)
vo->want_redraw = true;

View File

@ -608,9 +608,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_PAUSE:
vo->want_redraw = true;
return VO_TRUE;
case VOCTRL_SET_EQUALIZER:
vo->want_redraw = true;
return VO_TRUE;
case VOCTRL_SET_PANSCAN:
mp_mutex_lock(&ctx->lock);
ctx->need_resize = true;

View File

@ -1071,9 +1071,6 @@ 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:
vo->want_redraw = true;
return true;
case VOCTRL_RESET:
forget_frames(vo, true);
return true;