]> git.sesse.net Git - ffmpeg/commitdiff
tiffenc: deprecate using compression_level
authorAnton Khirnov <anton@khirnov.net>
Thu, 24 Nov 2011 19:26:23 +0000 (20:26 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 24 Nov 2011 20:31:36 +0000 (21:31 +0100)
libavcodec/tiffenc.c
libavcodec/version.h

index 7b71481a74dc2fc732fd84270846c02cb3a1154b..3b2b82991b945b2bbd8443350832b7c4addb2c19 100644 (file)
@@ -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;
index 3f5c42e33e50f5791f63f42f26f7a9ac9fb6fbff..6280e1c1c96256a10519801294772c7b609699b2 100644 (file)
 #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 */