summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-25 23:17:04 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-03 21:48:25 +0200
commitfee6b287a559084062d179974816fd922dc93a4f (patch)
tree954fe93c54730fcf73afcdc3610b9f51ffdf9778 /video/out/opengl/video.c
parent1aab0376014ff7fc278a81847c989b3970aa0736 (diff)
downloadmpv-fee6b287a559084062d179974816fd922dc93a4f.tar.bz2
mpv-fee6b287a559084062d179974816fd922dc93a4f.tar.xz
vo_opengl: support embedded ICC profiles
This currently only works when using lcms-based color management (--icc-profile-*). In principle, we could also support using lcms even when the user has not specified an ICC profile, by generating the profile against a fixed reference (--target-prim/--target-trc) instead. I still might do that some day, simply because 3dlut provides a higher quality conversion than our simple gamut mapping does for stuff like BT.2020, and also because it's now needed to enable embedded ICC profiles. But that would be a separate change, so preserve the status quo for now. (Besides, my opinion is still that you should be using an ICC profile if you care about colors being accurate _at all_)
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 14d7d68171..ecb0cba183 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -593,7 +593,11 @@ static bool gl_video_get_lut3d(struct gl_video *p, enum mp_csp_prim prim,
if (!p->use_lut_3d)
return false;
- if (p->lut_3d_texture && !gl_lcms_has_changed(p->cms, prim, trc))
+ struct AVBufferRef *icc = NULL;
+ if (p->image.mpi)
+ icc = p->image.mpi->icc_profile;
+
+ if (p->lut_3d_texture && !gl_lcms_has_changed(p->cms, prim, trc, icc))
return true;
// GLES3 doesn't provide filtered 16 bit integer textures
@@ -606,7 +610,7 @@ static bool gl_video_get_lut3d(struct gl_video *p, enum mp_csp_prim prim,
}
struct lut3d *lut3d = NULL;
- if (!fmt || !gl_lcms_get_lut3d(p->cms, &lut3d, prim, trc) || !lut3d) {
+ if (!fmt || !gl_lcms_get_lut3d(p->cms, &lut3d, prim, trc, icc) || !lut3d) {
p->use_lut_3d = false;
return false;
}