[FFmpeg-cvslog] r25717 - trunk/libavcodec/imgconvert.c

stefano subversion
Wed Nov 10 21:13:19 CET 2010


Author: stefano
Date: Wed Nov 10 21:13:19 2010
New Revision: 25717

Log:
Make avcodec_pix_fmt_string() use the information in the pixel format
descriptors for printing the number of channels/components.

Also replace the term "nb_channels" with "nb_components" which is more
consistent with the FFmpeg internal terminology, and is somehow
different with respect to the current definition of nb_channels in
PixFmtInfo.

See thread:
Subject: [FFmpeg-devel] [PATCH 6/8] Make avcodec_pix_fmt_string() use the
        information in the pixel format descriptors for printing the
        number of planes. Also replace the term "nb_channels" with
        "nb_planes" which is more correct.
Date: Fri,  5 Nov 2010 12:01:38 +0100

Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	Wed Nov 10 13:45:41 2010	(r25716)
+++ trunk/libavcodec/imgconvert.c	Wed Nov 10 21:13:19 2010	(r25717)
@@ -438,15 +438,14 @@ void avcodec_pix_fmt_string (char *buf, 
     /* print header */
     if (pix_fmt < 0)
         snprintf (buf, buf_size,
-                  "name      " " nb_channels" " depth"
+                  "name      " " nb_components" " depth"
             );
     else{
-        PixFmtInfo info= pix_fmt_info[pix_fmt];
-
+        const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
         snprintf (buf, buf_size,
-                  "%-11s %5d %9d",
+                  "%-11s %7d %9d",
                   av_pix_fmt_descriptors[pix_fmt].name,
-                  info.nb_channels,
+                  pixdesc->nb_components,
                   av_get_bits_per_pixel(&av_pix_fmt_descriptors[pix_fmt])
             );
     }



More information about the ffmpeg-cvslog mailing list