[FFmpeg-cvslog] imgconvert: Add the proper API guards to a deprecated function

Vittorio Giovara git at videolan.org
Wed Jan 27 21:09:30 CET 2016


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Tue Jan 19 16:09:52 2016 -0500| [d43a165bda0eae95f4c7a168c7d13d94966c1a09] | committer: Vittorio Giovara

imgconvert: Add the proper API guards to a deprecated function

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

 libavcodec/imgconvert.c |    2 ++
 libavcodec/version.h    |    3 +++
 2 files changed, 5 insertions(+)

diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 6528c96..4667a4f 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -33,12 +33,14 @@
 #include "libavutil/internal.h"
 #include "libavutil/imgutils.h"
 
+#if FF_API_GETCHROMA
 void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
     *h_shift = desc->log2_chroma_w;
     *v_shift = desc->log2_chroma_h;
 }
+#endif
 
 static int is_gray(const AVPixFmtDescriptor *desc)
 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 303c112..75d99bc 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -48,6 +48,9 @@
  * the public API and may change, break or disappear at any time.
  */
 
+#ifndef FF_API_GETCHROMA
+#define FF_API_GETCHROMA         (LIBAVCODEC_VERSION_MAJOR < 58)
+#endif
 #ifndef FF_API_MISSING_SAMPLE
 #define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 58)
 #endif



More information about the ffmpeg-cvslog mailing list