summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-01-10 15:38:43 +0100
committerNiklas Haas <git@haasn.dev>2022-01-10 15:43:57 +0100
commit79783f4ac5ab6025ec10286dff298b3c29513dde (patch)
tree7ecd81fbadec07d5ee67329fe2652cc552e9a9b6
parentd77b30abceb88160f5c67f58ce27f45dfe5c8b4f (diff)
downloadmpv-79783f4ac5ab6025ec10286dff298b3c29513dde.tar.bz2
mpv-79783f4ac5ab6025ec10286dff298b3c29513dde.tar.xz
vo_gpu: placebo: add missing gamma functions
These got added upstream a while ago. Need to be added to the mapping helpers. It might be time to think about bumping the minimum dependency here. Reported-by: Uoti Urpala <uau@glyph.nonexistent.invalid>
-rw-r--r--video/out/placebo/utils.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/video/out/placebo/utils.c b/video/out/placebo/utils.c
index 35cca963c4..bc4ae4a5c9 100644
--- a/video/out/placebo/utils.c
+++ b/video/out/placebo/utils.c
@@ -90,10 +90,7 @@ enum pl_color_transfer mp_trc_to_pl(enum mp_csp_trc trc)
case MP_CSP_TRC_SRGB: return PL_COLOR_TRC_SRGB;
case MP_CSP_TRC_LINEAR: return PL_COLOR_TRC_LINEAR;
case MP_CSP_TRC_GAMMA18: return PL_COLOR_TRC_GAMMA18;
- case MP_CSP_TRC_GAMMA20: return PL_COLOR_TRC_UNKNOWN; // missing
case MP_CSP_TRC_GAMMA22: return PL_COLOR_TRC_GAMMA22;
- case MP_CSP_TRC_GAMMA24: return PL_COLOR_TRC_UNKNOWN; // missing
- case MP_CSP_TRC_GAMMA26: return PL_COLOR_TRC_UNKNOWN; // missing
case MP_CSP_TRC_GAMMA28: return PL_COLOR_TRC_GAMMA28;
case MP_CSP_TRC_PRO_PHOTO: return PL_COLOR_TRC_PRO_PHOTO;
case MP_CSP_TRC_PQ: return PL_COLOR_TRC_PQ;
@@ -102,6 +99,16 @@ enum pl_color_transfer mp_trc_to_pl(enum mp_csp_trc trc)
case MP_CSP_TRC_S_LOG1: return PL_COLOR_TRC_S_LOG1;
case MP_CSP_TRC_S_LOG2: return PL_COLOR_TRC_S_LOG2;
case MP_CSP_TRC_COUNT: return PL_COLOR_TRC_COUNT;
+
+#if PL_API_VER >= 146
+ case MP_CSP_TRC_GAMMA20: return PL_COLOR_TRC_GAMMA20;
+ case MP_CSP_TRC_GAMMA24: return PL_COLOR_TRC_GAMMA24;
+ case MP_CSP_TRC_GAMMA26: return PL_COLOR_TRC_GAMMA26;
+#else
+ case MP_CSP_TRC_GAMMA20: return PL_COLOR_TRC_UNKNOWN;
+ case MP_CSP_TRC_GAMMA24: return PL_COLOR_TRC_UNKNOWN;
+ case MP_CSP_TRC_GAMMA26: return PL_COLOR_TRC_UNKNOWN;
+#endif
}
MP_ASSERT_UNREACHABLE();