[FFmpeg-devel] [PATCH] swscale: Deprecate vector functions which are unused outside swscale

Michael Niedermayer michael at niedermayer.cc
Thu Mar 31 17:52:16 CEST 2016

There are no known users of these functions within debian
It should be thus possible to remove these functions without recommandition of a

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
 libswscale/swscale.h |   16 ++++++++--------
 libswscale/utils.c   |    6 ++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/libswscale/swscale.h b/libswscale/swscale.h
index da9dd2e..703108d 100644
--- a/libswscale/swscale.h
+++ b/libswscale/swscale.h
@@ -251,13 +251,13 @@ SwsVector *sws_getGaussianVec(double variance, double quality);
  * Allocate and return a vector with length coefficients, all
  * with the same value c.
-SwsVector *sws_getConstVec(double c, int length);
+attribute_deprecated SwsVector *sws_getConstVec(double c, int length);
  * Allocate and return a vector with just one coefficient, with
  * value 1.0.
-SwsVector *sws_getIdentityVec(void);
+attribute_deprecated SwsVector *sws_getIdentityVec(void);
  * Scale all the coefficients of a by the scalar value.
@@ -268,22 +268,22 @@ void sws_scaleVec(SwsVector *a, double scalar);
  * Scale all the coefficients of a so that their sum equals height.
 void sws_normalizeVec(SwsVector *a, double height);
-void sws_convVec(SwsVector *a, SwsVector *b);
-void sws_addVec(SwsVector *a, SwsVector *b);
-void sws_subVec(SwsVector *a, SwsVector *b);
-void sws_shiftVec(SwsVector *a, int shift);
+attribute_deprecated void sws_convVec(SwsVector *a, SwsVector *b);
+attribute_deprecated void sws_addVec(SwsVector *a, SwsVector *b);
+attribute_deprecated void sws_subVec(SwsVector *a, SwsVector *b);
+attribute_deprecated void sws_shiftVec(SwsVector *a, int shift);
  * Allocate and return a clone of the vector a, that is a vector
  * with the same coefficients as a.
-SwsVector *sws_cloneVec(SwsVector *a);
+attribute_deprecated SwsVector *sws_cloneVec(SwsVector *a);
  * Print with av_log() a textual representation of the vector a
  * if log_level <= av_log_level.
-void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
+attribute_deprecated void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
 void sws_freeVec(SwsVector *a);
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 24ddd13..8a13124 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -53,6 +53,12 @@
 #include "libavutil/ppc/cpu.h"
 #include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
+// We have to implement deprecated functions until they are removed, this is the
+// simplest way to prevent warnings
+#undef attribute_deprecated
+#define attribute_deprecated
 #include "rgb2rgb.h"
 #include "swscale.h"
 #include "swscale_internal.h"

More information about the ffmpeg-devel mailing list