[FFmpeg-cvslog] r25879 - in trunk: doc/APIchanges libavcodec/avcodec.h libavcodec/imgconvert.c libavutil/avutil.h libavutil/pixdesc.c libavutil/pixdesc.h

stefano subversion
Sat Dec 4 13:56:21 CET 2010


Author: stefano
Date: Sat Dec  4 13:56:21 2010
New Revision: 25879

Log:
Deprecate avcodec_pix_fmt_string() in favor of
av_get_pix_fmt_string(), added to libavutil/pixdesc.h.

Modified:
   trunk/doc/APIchanges
   trunk/libavcodec/avcodec.h
   trunk/libavcodec/imgconvert.c
   trunk/libavutil/avutil.h
   trunk/libavutil/pixdesc.c
   trunk/libavutil/pixdesc.h

Modified: trunk/doc/APIchanges
==============================================================================
--- trunk/doc/APIchanges	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/doc/APIchanges	Sat Dec  4 13:56:21 2010	(r25879)
@@ -12,6 +12,10 @@ libavutil:   2009-03-08
 
 
 API changes, most recent first:
+2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string()
+  Deprecate avcodec_pix_fmt_string() in favor of
+  pixdesc.h/av_get_pix_fmt_string().
+
 2010-12-04 - r25878 - lavcore 1.15.0 - av_image_alloc()
   Add av_image_alloc() to libavcore/imgutils.h.
 

Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/libavcodec/avcodec.h	Sat Dec  4 13:56:21 2010	(r25879)
@@ -33,7 +33,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 52
 #define LIBAVCODEC_VERSION_MINOR 97
-#define LIBAVCODEC_VERSION_MICRO  2
+#define LIBAVCODEC_VERSION_MICRO  3
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
@@ -3285,18 +3285,12 @@ int avcodec_get_pix_fmt_loss(enum PixelF
 enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
                               int has_alpha, int *loss_ptr);
 
-
+#if LIBAVCODEC_VERSION_MAJOR < 53
 /**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param[in] buf the buffer where to write the string
- * @param[in] buf_size the size of buf
- * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or
- * a negative value to print the corresponding header.
- * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1.
+ * @deprecated Use av_get_pix_fmt_string() instead.
  */
 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
+#endif
 
 #define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */
 #define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/libavcodec/imgconvert.c	Sat Dec  4 13:56:21 2010	(r25879)
@@ -431,25 +431,12 @@ enum PixelFormat avcodec_get_pix_fmt(con
 {
     return av_get_pix_fmt(name);
 }
-#endif
 
 void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
 {
-    /* print header */
-    if (pix_fmt < 0)
-        snprintf (buf, buf_size,
-                  "name      " " nb_components" " nb_bits"
-            );
-    else{
-        const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
-        snprintf (buf, buf_size,
-                  "%-11s %7d %10d",
-                  pixdesc->name,
-                  pixdesc->nb_components,
-                  av_get_bits_per_pixel(pixdesc)
-            );
-    }
+    av_get_pix_fmt_string(buf, buf_size, pix_fmt);
 }
+#endif
 
 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt)
 {

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/libavutil/avutil.h	Sat Dec  4 13:56:21 2010	(r25879)
@@ -40,7 +40,7 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 #define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR 33
+#define LIBAVUTIL_VERSION_MINOR 34
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Modified: trunk/libavutil/pixdesc.c
==============================================================================
--- trunk/libavutil/pixdesc.c	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/libavutil/pixdesc.c	Sat Dec  4 13:56:21 2010	(r25879)
@@ -851,3 +851,17 @@ int av_get_bits_per_pixel(const AVPixFmt
 
     return bits >> log2_pixels;
 }
+
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
+{
+    /* print header */
+    if (pix_fmt < 0) {
+        snprintf (buf, buf_size, "name      " " nb_components" " nb_bits");
+    } else {
+        const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt];
+        snprintf(buf, buf_size, "%-11s %7d %10d",
+                 pixdesc->name, pixdesc->nb_components, av_get_bits_per_pixel(pixdesc));
+    }
+
+    return buf;
+}

Modified: trunk/libavutil/pixdesc.h
==============================================================================
--- trunk/libavutil/pixdesc.h	Sat Dec  4 13:56:16 2010	(r25878)
+++ trunk/libavutil/pixdesc.h	Sat Dec  4 13:56:21 2010	(r25879)
@@ -142,6 +142,18 @@ void av_write_image_line(const uint16_t 
 enum PixelFormat av_get_pix_fmt(const char *name);
 
 /**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt);
+
+/**
  * Return the number of bits per pixel used by the pixel format
  * described by pixdesc.
  *



More information about the ffmpeg-cvslog mailing list