summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2023-02-27 10:44:39 -0500
committerLeo Izen <leo.izen@gmail.com>2023-03-05 22:37:05 -0500
commit4defd8bb271dcf73474cd15d78ec51fbf3b65ff1 (patch)
tree4f739749cabc230eeaf2b9fdf4de5121fd0aee83 /video/out
parent8217b186f6d210c2abebb7ec6c7d5152d11fa4bf (diff)
downloadmpv-4defd8bb271dcf73474cd15d78ec51fbf3b65ff1.tar.bz2
mpv-4defd8bb271dcf73474cd15d78ec51fbf3b65ff1.tar.xz
vo_gpu_next: use inverse mapping functions to tag screenshots
Screenshots using the hardware renderer should now include color tags that map directly from the libplacebo tags, so the if/else logic only needs to be included once.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_gpu_next.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index c09f9fafe9..94a171a7ab 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1247,21 +1247,12 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
if (!args->res)
goto done;
- if (args->scaled) {
- // Provide tagging for target CSP info (if known)
- const struct gl_video_opts *opts = p->opts_cache->opts;
- args->res->params.color.primaries = opts->target_prim;
- args->res->params.color.gamma = opts->target_trc;
- args->res->params.color.levels = p->output_levels;
- args->res->params.color.sig_peak = opts->target_peak;
+ args->res->params.color.primaries = mp_prim_from_pl(target.color.primaries);
+ args->res->params.color.gamma = mp_trc_from_pl(target.color.transfer);
+ args->res->params.color.levels = mp_levels_from_pl(target.repr.levels);
+ args->res->params.color.sig_peak = target.color.hdr.max_luma / MP_REF_WHITE;
+ if (args->scaled)
args->res->params.p_w = args->res->params.p_h = 1;
- } else if (args->native_csp) {
- args->res->params.color = mpi->params.color;
- args->res->params.color.space = MP_CSP_RGB;
- } else {
- args->res->params.color.primaries = MP_CSP_PRIM_BT_709;
- args->res->params.color.gamma = MP_CSP_TRC_SRGB;
- }
bool ok = pl_tex_download(gpu, pl_tex_transfer_params(
.tex = fbo,