From 76541db2a73798414e0d4dc80070be2a815b30fb Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Sun, 24 Mar 2024 09:05:37 -0400 Subject: [PATCH] vo_xv: support video-target-params The target colorspace depends on whether the xv adaptor supports setting BT.709 colorspace. --- video/out/vo_xv.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index 378602b655..d2d5b737e7 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -92,6 +92,7 @@ struct xvctx { int Shmem_Flag; XShmSegmentInfo Shminfo[MAX_BUFFERS]; int Shm_Warned_Slow; + struct mp_image_params dst_params; }; #define MP_FOURCC(a,b,c,d) ((a) | ((b)<<8) | ((c)<<16) | ((unsigned)(d)<<24)) @@ -523,6 +524,13 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) xv_set_eq(vo, ctx->xv_port, "bt_709", is_709 * 200 - 100); read_xv_csp(vo); + ctx->dst_params = *params; + if (ctx->cached_csp) + ctx->dst_params.repr.sys = ctx->cached_csp; + mp_mutex_lock(&vo->params_mutex); + vo->target_params = &ctx->dst_params; + mp_mutex_unlock(&vo->params_mutex); + resize(vo); return 0;