summaryrefslogtreecommitdiff
path: root/libavcodec/libvpxdec.c
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2015-06-23 14:41:26 -0700
committerJames Zern <jzern@google.com>2015-06-24 15:09:31 -0700
commit766a8346cfb4e3553be207852266058d9edb9945 (patch)
treec3582e5f05ebc39c853c160c24a1d75e01c8fbde /libavcodec/libvpxdec.c
parent469398f8b7a8ebe43bd4d5149cdc2b96eac53b76 (diff)
libvpxdec: report colorspace
Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Zern <jzern@google.com>
Diffstat (limited to 'libavcodec/libvpxdec.c')
-rw-r--r--libavcodec/libvpxdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index d94561efb5..33af775a75 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -62,6 +62,13 @@ static av_cold int vpx_init(AVCodecContext *avctx,
// returns 0 on success, AVERROR_INVALIDDATA otherwise
static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img)
{
+#if VPX_IMAGE_ABI_VERSION >= 3
+ static const enum AVColorSpace colorspaces[8] = {
+ AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, AVCOL_SPC_BT709, AVCOL_SPC_SMPTE170M,
+ AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, AVCOL_SPC_RGB,
+ };
+ avctx->colorspace = colorspaces[img->cs];
+#endif
if (avctx->codec_id == AV_CODEC_ID_VP8 && img->fmt != VPX_IMG_FMT_I420)
return AVERROR_INVALIDDATA;
switch (img->fmt) {