diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-31 17:10:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-19 22:14:13 +0200 |
commit | 9c8aeacf82a872e1703efdfd2822a4f2d6324c9a (patch) | |
tree | 5f738c9da8d7396e7b5213876e08cf0c44de583f /libavutil/frame.c | |
parent | 63139f62f35944b9abd42505bf13a740676978e9 (diff) | |
download | ffmpeg-9c8aeacf82a872e1703efdfd2822a4f2d6324c9a.tar.gz |
avutil: add av_get_colorspace_name()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index b0fdd49ade..0ce84d2a51 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -70,6 +70,22 @@ int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type) return f->qp_table_buf->data; } +const char *av_get_colorspace_name(enum AVColorSpace val) +{ + static const char *name[] = { + [AVCOL_SPC_RGB] = "GBR", + [AVCOL_SPC_BT709] = "bt709", + [AVCOL_SPC_FCC] = "fcc", + [AVCOL_SPC_BT470BG] = "bt470bg", + [AVCOL_SPC_SMPTE170M] = "smpte170m", + [AVCOL_SPC_SMPTE240M] = "smpte240m", + [AVCOL_SPC_YCOCG] = "YCgCo", + }; + if (val < 0 || val >= FF_ARRAY_ELEMS(name)) + return NULL; + return name[val]; +} + static void get_frame_defaults(AVFrame *frame) { if (frame->extended_data != frame->data) |