[FFmpeg-cvslog] swscale: reintroduce sws_format_name() symbol

Stefano Sabatini git at videolan.org
Fri Jun 3 00:47:11 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Thu Jun  2 19:00:47 2011 +0200| [b932eb1be62b47b29969667f14a207e425e79a55] | committer: Stefano Sabatini

swscale: reintroduce sws_format_name() symbol

Reintroduce the internal symbol which was removed in:

commit e1197b9e1746c03b1d13d816d1569aeaf1b71ecc
Author: Stefano Sabatini <stefano.sabatini-lala at poste.it>
Date:   Sun May 29 17:57:40 2011 +0200

    swscale: remove sws_format_name()

    Use av_get_pix_fmt_name() instead.

The symbol is used by some external libs (hi libx264!), this gives
time to them to use the recently added av_get_pix_fmt_name() rather
than an internal symbol.

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

 libswscale/swscale.h          |    5 ++++-
 libswscale/swscale_internal.h |    8 ++++++++
 libswscale/utils.c            |    7 +++++++
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index 7ac2fe2..e798773 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -31,7 +31,7 @@
 
 #define LIBSWSCALE_VERSION_MAJOR 0
 #define LIBSWSCALE_VERSION_MINOR 14
-#define LIBSWSCALE_VERSION_MICRO 0
+#define LIBSWSCALE_VERSION_MICRO 1
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
                                                LIBSWSCALE_VERSION_MINOR, \
@@ -53,6 +53,9 @@
 #ifndef FF_API_SWS_CPU_CAPS
 #define FF_API_SWS_CPU_CAPS    (LIBSWSCALE_VERSION_MAJOR < 2)
 #endif
+#ifndef FF_API_SWS_FORMAT_NAME
+#define FF_API_SWS_FORMAT_NAME  (LIBSWSCALE_VERSION_MAJOR < 2)
+#endif
 
 /**
  * Returns the LIBSWSCALE_VERSION_INT constant.
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 87712be..77a91e1 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -349,6 +349,14 @@ void ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
                             const int16_t **chrVSrc, int chrFilterSize,
                             uint8_t *dest, int dstW, int dstY);
 
+#if FF_API_SWS_FORMAT_NAME
+/**
+ * @deprecated Use av_get_pix_fmt_name() instead.
+ */
+attribute_deprecated
+const char *sws_format_name(enum PixelFormat format);
+#endif
+
 //FIXME replace this with something faster
 #define is16BPS(x)      (           \
            (x)==PIX_FMT_GRAY16BE    \
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 3801ea2..d8c2c08 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -165,6 +165,13 @@ int sws_isSupportedOutput(enum PixelFormat pix_fmt)
 
 extern const int32_t ff_yuv2rgb_coeffs[8][4];
 
+#if FF_API_SWS_FORMAT_NAME
+const char *sws_format_name(enum PixelFormat format)
+{
+    return av_get_pix_fmt_name(format);
+}
+#endif
+
 static double getSplineCoeff(double a, double b, double c, double d, double dist)
 {
     if (dist<=1.0) return ((d*dist + c)*dist + b)*dist +a;



More information about the ffmpeg-cvslog mailing list