[FFmpeg-cvslog] tiffenc: deprecate using compression_level

Anton Khirnov git at videolan.org
Fri Nov 25 04:43:28 CET 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Nov 24 20:26:23 2011 +0100| [8b7412fe4e0821ec66eb75da0e586d977b93652c] | committer: Anton Khirnov

tiffenc: deprecate using compression_level

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

 libavcodec/tiffenc.c |    6 ++++++
 libavcodec/version.h |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c
index 7b71481..3b2b829 100644
--- a/libavcodec/tiffenc.c
+++ b/libavcodec/tiffenc.c
@@ -231,6 +231,11 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
     p->key_frame = 1;
     avctx->coded_frame= &s->picture;
 
+#if FF_API_TIFFENC_COMPLEVEL
+    if (avctx->compression_level != FF_COMPRESSION_DEFAULT)
+        av_log(avctx, AV_LOG_WARNING, "Using compression_level to set compression "
+               "algorithm is deprecated. Please use the compression_algo private "
+               "option instead.\n");
     if (avctx->compression_level == 0) {
         s->compr = TIFF_RAW;
     } else if(avctx->compression_level == 2) {
@@ -240,6 +245,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
         s->compr = TIFF_DEFLATE;
 #endif
     }
+#endif
 
     s->width = avctx->width;
     s->height = avctx->height;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3f5c42e..6280e1c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -107,5 +107,9 @@
 #ifndef FF_API_INTERNAL_CONTEXT
 #define FF_API_INTERNAL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_API_TIFFENC_COMPLEVEL
+#define FF_API_TIFFENC_COMPLEVEL (LIBAVCODEC_VERSION_MAJOR < 54)
+#endif
+
 
 #endif /* AVCODEC_VERSION_H */



More information about the ffmpeg-cvslog mailing list