summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-12-12 22:38:46 +0100
committerNiklas Haas <github-daiK1o@haasn.dev>2023-02-13 21:53:41 +0100
commit16ef237da56afc6b38528c74d006a068e9efc5e3 (patch)
tree273f0760e8fd7fa4a30834505ab66daa6ab3f305 /video/out
parentc9758885849420f267e156c36ba0939a8b0c66d7 (diff)
downloadmpv-16ef237da56afc6b38528c74d006a068e9efc5e3.tar.bz2
mpv-16ef237da56afc6b38528c74d006a068e9efc5e3.tar.xz
vo_gpu_next: allow native CSP screenshots
Useful for getting native screenshots of non-sRGB content, such as HDR etc.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_gpu_next.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index e8b2636ebb..80191a5024 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1229,6 +1229,8 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
if (args->scaled) {
// Apply target LUT, ICC profile and CSP override only in window mode
apply_target_options(p, &target);
+ } else if (args->native_csp) {
+ target.color = image.color;
} else {
target.color = pl_color_space_srgb;
}
@@ -1262,6 +1264,9 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
args->res->params.color.levels = p->output_levels;
args->res->params.color.sig_peak = opts->target_peak;
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;