diff options
author | Niklas Haas <git@haasn.xyz> | 2016-11-08 17:53:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-11-08 19:16:26 +0100 |
commit | c676c31815b5c8bd9ba6eab968bbc0862eaa4bba (patch) | |
tree | 1ab96beb3363ce97a588f5e52dab60afcd3161e5 /video/csputils.c | |
parent | 81ceb7b6a57422e5d05593d49b14d99479f266a0 (diff) | |
download | mpv-c676c31815b5c8bd9ba6eab968bbc0862eaa4bba.tar.bz2 mpv-c676c31815b5c8bd9ba6eab968bbc0862eaa4bba.tar.xz |
demux: expose demuxer colorimetry metadata to player
Implementation-wise, the values from the demuxer/codec header are merged
with the values from the decoder such that the former are used only
where the latter are unknown (0/auto).
Diffstat (limited to 'video/csputils.c')
-rw-r--r-- | video/csputils.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/video/csputils.c b/video/csputils.c index 0c2e847186..8f6a9e351e 100644 --- a/video/csputils.c +++ b/video/csputils.c @@ -100,6 +100,22 @@ const struct m_opt_choice_alternatives mp_chroma_names[] = { {0} }; +void mp_colorspace_merge(struct mp_colorspace *orig, struct mp_colorspace *new) +{ + if (!orig->space) + orig->space = new->space; + if (!orig->levels) + orig->levels = new->levels; + if (!orig->primaries) + orig->primaries = new->primaries; + if (!orig->gamma) + orig->gamma = new->gamma; + if (!orig->nom_peak) + orig->nom_peak = new->nom_peak; + if (!orig->sig_peak) + orig->sig_peak = new->sig_peak; +} + // The short name _must_ match with what vf_stereo3d accepts (if supported). // The long name in comments is closer to the Matroska spec (StereoMode element). // The numeric index matches the Matroska StereoMode value. If you add entries |