[FFmpeg-cvslog] avcodec/utils: avcodec_string: print colorspace type

Michael Niedermayer git at videolan.org
Sat Aug 31 21:13:47 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Aug 27 22:04:38 2013 +0200| [8da23be458f4249f8e4348fea775c12cb3da241c] | committer: Michael Niedermayer

avcodec/utils: avcodec_string: print colorspace type

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8da23be458f4249f8e4348fea775c12cb3da241c
---

 libavcodec/utils.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index adcb9cd..4e510e6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2601,6 +2601,21 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
             if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
                 av_strlcatf(detail, sizeof(detail),
                             enc->color_range == AVCOL_RANGE_MPEG ? "tv, ": "pc, ");
+            if (enc->colorspace<9U) {
+                static const char *name[] =  {
+                    "GBR",
+                    "bt709",
+                    NULL,
+                    NULL,
+                    "fcc",
+                    "bt470bg",
+                    "smpte170m",
+                    "smpte240m",
+                    "YCgCo",
+                };
+                if (name[enc->colorspace])
+                    av_strlcatf(detail, sizeof(detail), "%s, ", name[enc->colorspace]);
+            }
             if (strlen(detail) > 1) {
                 detail[strlen(detail) - 2] = 0;
                 av_strlcatf(buf, buf_size, "%s)", detail);



More information about the ffmpeg-cvslog mailing list