summaryrefslogtreecommitdiffstats
path: root/video/out/gl_lcms.c
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-02-25 00:04:30 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-03-31 22:07:33 +0200
commitb0ee9334e33a8603dd07f991ee5cd5f2345030ed (patch)
treea3c5e4d92b028be15d084e664343aee81f458bb9 /video/out/gl_lcms.c
parent956b01ec4eaecef0d48409e7aa5c1d133132fb82 (diff)
downloadmpv-b0ee9334e33a8603dd07f991ee5cd5f2345030ed.tar.bz2
mpv-b0ee9334e33a8603dd07f991ee5cd5f2345030ed.tar.xz
vo_opengl, cocoa: allow to autoselect a color profile
This commit adds support for automatic selection of color profiles based on the display where mpv is initialized, and automatically changes the color profile when display is changed or the profile itself is changed from System Preferences. @UliZappe was responsible with the testing and implementation of a lot of this commit, including the original implementation of `cocoa_get_icc_profile_path` (See #594). Fixes #594
Diffstat (limited to 'video/out/gl_lcms.c')
-rw-r--r--video/out/gl_lcms.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/gl_lcms.c b/video/out/gl_lcms.c
index 08f89b81d9..d2f59306f6 100644
--- a/video/out/gl_lcms.c
+++ b/video/out/gl_lcms.c
@@ -71,6 +71,7 @@ static int validate_3dlut_size_opt(struct mp_log *log, const m_option_t *opt,
const struct m_sub_options mp_icc_conf = {
.opts = (m_option_t[]) {
OPT_STRING("icc-profile", profile, 0),
+ OPT_FLAG("icc-profile-auto", profile_auto, 0),
OPT_STRING("icc-cache", cache, 0),
OPT_INT("icc-intent", intent, 0),
OPT_STRING_VALIDATE("3dlut-size", size_str, 0, validate_3dlut_size_opt),
@@ -106,6 +107,17 @@ static struct bstr load_file(void *talloc_ctx, const char *filename,
return res;
}
+bool mp_icc_set_profile(struct mp_icc_opts *opts, char *profile)
+{
+ if (!opts->profile || strcmp(opts->profile, profile) != 0) {
+ if (opts->profile)
+ talloc_free(opts->profile);
+ opts->profile = talloc_strdup(opts, profile);
+ return true;
+ }
+ return false;
+}
+
#define LUT3D_CACHE_HEADER "mpv 3dlut cache 1.0\n"
struct lut3d *mp_load_icc(struct mp_icc_opts *opts, struct mp_log *log,