[FFmpeg-cvslog] lavc: deprecate img_get_alpha_info().
Anton Khirnov
git at videolan.org
Fri Oct 21 02:37:14 CEST 2011
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Oct 17 20:08:02 2011 +0200| [586657c20a84ea85bfd28b9ab19aace427178922] | committer: Anton Khirnov
lavc: deprecate img_get_alpha_info().
It's never been touched or used in any way since it was added in 2003
and only works for PIX_FMT_PAL8, which makes me conclude that nobody's
ever used it.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=586657c20a84ea85bfd28b9ab19aace427178922
---
libavcodec/avcodec.h | 3 +++
libavcodec/imgconvert.c | 2 ++
libavcodec/version.h | 3 +++
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index a5fd2e7..28dde3f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3500,6 +3500,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr);
+#if FF_API_GET_ALPHA_INFO
#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */
#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */
@@ -3507,8 +3508,10 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
* Tell if an image really has transparent alpha values.
* @return ored mask of FF_ALPHA_xxx constants
*/
+attribute_deprecated
int img_get_alpha_info(const AVPicture *src,
enum PixelFormat pix_fmt, int width, int height);
+#endif
/* deinterlace a picture */
/* deinterlace - if not supported return -1 */
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index c446aac..eb398f7 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -862,6 +862,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
return 0;
}
+#if FF_API_GET_ALPHA_INFO
/* NOTE: we scan all the pixels to have an exact information */
static int get_alpha_info_pal8(const AVPicture *src, int width, int height)
{
@@ -908,6 +909,7 @@ int img_get_alpha_info(const AVPicture *src,
}
return ret;
}
+#endif
#if !(HAVE_MMX && HAVE_YASM)
/* filter parameters: [-1 4 2 4 -1] // 8 */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index ef30a69..a361bbd 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -98,5 +98,8 @@
#ifndef FF_API_MJPEG_GLOBAL_OPTS
#define FF_API_MJPEG_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54)
#endif
+#ifndef FF_API_GET_ALPHA_INFO
+#define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54)
+#endif
#endif /* AVCODEC_VERSION_H */
More information about the ffmpeg-cvslog
mailing list