aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-22 03:31:34 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit758b15404755af97a7c538010561f84d9a02095c (patch)
tree7ff84ef5f6b3bee757a3bd7bb4274e5756d2ca94
parent5df4b6cf05846230683fcd3833fc2e06a710e712 (diff)
downloadffmpeg-758b15404755af97a7c538010561f84d9a02095c.tar.gz
avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1ec7a703806049265991723a8826bd61555edef4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavutil/pixdesc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 154392af20..13f69fa56f 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2116,6 +2116,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
#define FF_COLOR_GRAY 1 /**< gray color space */
#define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
+#define FF_COLOR_XYZ 4
#define pixdesc_has_alpha(pixdesc) \
((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
@@ -2131,6 +2132,9 @@ static int get_color_type(const AVPixFmtDescriptor *desc) {
if(desc->name && !strncmp(desc->name, "yuvj", 4))
return FF_COLOR_YUV_JPEG;
+ if(desc->name && !strncmp(desc->name, "xyz", 3))
+ return FF_COLOR_XYZ;
+
if(desc->flags & AV_PIX_FMT_FLAG_RGB)
return FF_COLOR_RGB;