[FFmpeg-devel] [PATCH 3/3] avcodec/utils: avcodec_string: print colorspace type

Michael Niedermayer michaelni at gmx.at
Tue Aug 27 22:17:48 CEST 2013


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/utils.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0e0c44e..f76beb2 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2600,6 +2600,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\0",
+                    "bt709\0",
+                    NULL,
+                    NULL,
+                    "fcc\0",
+                    "bt470bg\0"
+                    "smpte170m\0"
+                    "smpte240m\0"
+                    "YCgCo\0"
+                };
+                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);
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list