diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2023-11-07 00:52:56 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-11-08 21:45:07 +0000 |
commit | 477a0f83184d18a5cd89261b5f81ee668c7f4441 (patch) | |
tree | 73f7ffb96a1799fa390394b0435a08ec92d78ca8 /player/command.c | |
parent | a96d26e63a78d6325ed0238a24d8bd4a66519d19 (diff) | |
download | mpv-477a0f83184d18a5cd89261b5f81ee668c7f4441.tar.bz2 mpv-477a0f83184d18a5cd89261b5f81ee668c7f4441.tar.xz |
vo: replace VOCTRL_HDR_METADATA with direct VO params read
Currently VOCTRL are completely unusable for frequent data query. Since
the HDR parameter addition to video-params, the parameters can change
each frame. In which case observe on those parameter would be triggered
constantly. The problem is that quering those parameters involves VOCTRL
which in turn involves whole render cycle of delay.
Instead update VO params on each draw_frame. This requires changes to VO
reconfiguration condition, but in practice it should only be triggered
when image size or data layout changes. In other cases it will be
handled internal by VO driver.
I'm not quite happy with this solution, but don't see better one without
changing observe/notify logic significantly. There is no good way
currently to handle VOCTRL that are constantly queried.
This adds unfortunate synchronization of player command with VO thread,
but there is not way around that and if too frequent queries of this
param becomes a problem we can thing of other solutions.
Changes the way to get data from VO driver added by a98c5328dc
Fixes: 84de84b
Fixes: #12825
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c index 9c0aa4e2c4..8d6ab07d03 100644 --- a/player/command.c +++ b/player/command.c @@ -2372,17 +2372,16 @@ static struct mp_image_params get_video_out_params(struct MPContext *mpctx) static int mp_property_vo_imgparams(void *ctx, struct m_property *prop, int action, void *arg) { + MPContext *mpctx = ctx; + struct vo *vo = mpctx->video_out; + if (!vo) + return M_PROPERTY_UNAVAILABLE; + int valid = m_property_read_sub_validate(ctx, prop, action, arg); if (valid != M_PROPERTY_VALID) return valid; - struct mp_image_params p = get_video_out_params(ctx); - - MPContext *mpctx = ctx; - if (mpctx->video_out) - vo_control(mpctx->video_out, VOCTRL_HDR_METADATA, &p.color.hdr); - - return property_imgparams(p, action, arg); + return property_imgparams(vo_get_current_params(vo), action, arg); } static int mp_property_dec_imgparams(void *ctx, struct m_property *prop, |