Package: qutecom
Version: 2.2.1+dfsg1-5.2
Severity: important
Tags: patch
User: pkg-multimedia-maintain...@lists.alioth.debian.org
Usertags: ffmpeg2.9

Dear Maintainer,

your package fails to build with the upcoming ffmpeg 2.9.
This bug will become release-critical at some point when the
ffmpeg2.9 transition gets closer.

Attached is a patch replacing the deprecated functionality.
It also works with ffmpeg 2.8.
Please apply this patch and forward it upstream, if necessary.

These changes have little regression potential.

Best regards,
Andreas

diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..42021ee
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,203 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2015-11-02>
+
+--- qutecom-2.2.1+dfsg1.orig/libs/pixertool/include/pixertool/ffmpeg-pixertool.h
++++ qutecom-2.2.1+dfsg1/libs/pixertool/include/pixertool/ffmpeg-pixertool.h
+@@ -61,7 +61,7 @@ PIXERTOOL_API pixosi pix_ffmpeg_to_pix_o
+  * @param pix palette identifier to convert
+  * @return equivalent ffmpeg identifier
+  */
+-PIXERTOOL_API enum PixelFormat pix_ffmpeg_from_pix_osi(pixosi pix);
++PIXERTOOL_API enum AVPixelFormat pix_ffmpeg_from_pix_osi(pixosi pix);
+ 
+ /**
+  * Fills an AVPicture with a piximage.
+--- qutecom-2.2.1+dfsg1.orig/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
++++ qutecom-2.2.1+dfsg1/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
+@@ -41,39 +41,39 @@ pixosi pix_ffmpeg_to_pix_osi(int pix) {
+ 	pixosi palette;
+ 
+ 	switch(pix) {
+-	case PIX_FMT_RGB24:
++	case AV_PIX_FMT_RGB24:
+ 		palette = PIX_OSI_RGB24;
+ 		break;
+-	case PIX_FMT_BGR24:
++	case AV_PIX_FMT_BGR24:
+ 		palette = PIX_OSI_BGR24;
+ 		break;
+-	case PIX_FMT_RGB555:
++	case AV_PIX_FMT_RGB555:
+ 		palette = PIX_OSI_RGB555;
+ 		break;
+-	case PIX_FMT_RGB565:
++	case AV_PIX_FMT_RGB565:
+ 		palette = PIX_OSI_RGB565;
+ 		break;
+ #if LIBAVUTIL_VERSION_INT < (50<<16)
+-	case PIX_FMT_RGB32:
++	case AV_PIX_FMT_RGB32:
+ #else
+-	case PIX_FMT_RGBA:
++	case AV_PIX_FMT_RGBA:
+ #endif
+ 		palette = PIX_OSI_RGBA32;
+ 		break;
+-	case PIX_FMT_YUV420P:
++	case AV_PIX_FMT_YUV420P:
+ 		palette = PIX_OSI_YUV420P;
+ 		break;
+-	case PIX_FMT_YUV422P:
++	case AV_PIX_FMT_YUV422P:
+ 		palette = PIX_OSI_YUV422P;
+ 		break;
+-	case PIX_FMT_YUYV422:
++	case AV_PIX_FMT_YUYV422:
+ 		palette = PIX_OSI_YUY2;
+ 		break;
+-	case PIX_FMT_YUV444P:
++	case AV_PIX_FMT_YUV444P:
+ 		palette = PIX_OSI_YUV444P;
+ 		break;
+ /* DOES not compile on MacOS X with current version of fink/ffmpeg (11/9/2006)
+-    case PIX_FMT_UYVY422:
++    case AV_PIX_FMT_UYVY422:
+         palette = PIX_OSI_UYVY;
+         break;
+ */	default:
+@@ -83,48 +83,48 @@ pixosi pix_ffmpeg_to_pix_osi(int pix) {
+ 	return palette;
+ }
+ 
+-enum PixelFormat pix_ffmpeg_from_pix_osi(pixosi pix) {
+-	enum PixelFormat palette;
++enum AVPixelFormat pix_ffmpeg_from_pix_osi(pixosi pix) {
++	enum AVPixelFormat palette;
+ 
+ 	switch(pix) {
+ 	case PIX_OSI_BGR24:
+-		palette = PIX_FMT_BGR24;
++		palette = AV_PIX_FMT_BGR24;
+ 		break;
+ 	case PIX_OSI_RGB24:
+-		palette = PIX_FMT_RGB24;
++		palette = AV_PIX_FMT_RGB24;
+ 		break;
+ 	case PIX_OSI_RGB555:
+-		palette = PIX_FMT_RGB555;
++		palette = AV_PIX_FMT_RGB555;
+ 		break;
+ 	case PIX_OSI_RGB565:
+-		palette = PIX_FMT_RGB565;
++		palette = AV_PIX_FMT_RGB565;
+ 		break;
+ 	case PIX_OSI_ARGB32:
+ 	case PIX_OSI_RGB32:
+ 	case PIX_OSI_RGBA32:
+ #if LIBAVUTIL_VERSION_INT < (50<<16)
+-		palette = PIX_FMT_RGBA32;
++		palette = AV_PIX_FMT_RGBA32;
+ #else
+-		palette = PIX_FMT_BGRA;
++		palette = AV_PIX_FMT_BGRA;
+ #endif
+ 		break;
+ 	case PIX_OSI_YUV420P:
+-		palette = PIX_FMT_YUV420P;
++		palette = AV_PIX_FMT_YUV420P;
+ 		break;
+ 	case PIX_OSI_YUV422P:
+-		palette = PIX_FMT_YUV422P;
++		palette = AV_PIX_FMT_YUV422P;
+ 		break;
+ 	case PIX_OSI_YUV444P:
+-		palette = PIX_FMT_YUV444P;
++		palette = AV_PIX_FMT_YUV444P;
+ 		break;
+ 	case PIX_OSI_YUV422:
+ 	case PIX_OSI_YUYV:
+ 	case PIX_OSI_YUY2:
+-		palette = PIX_FMT_YUYV422;
++		palette = AV_PIX_FMT_YUYV422;
+ 		break;
+ /* DOES not compile on MacOS X with current version of fink/ffmpeg (11/9/2006)
+ 	case PIX_OSI_UYVY:
+-		palette = PIX_FMT_UYVY422;
++		palette = AV_PIX_FMT_UYVY422;
+ 		break;
+ */	default:
+ 		palette = PIX_OSI_UNSUPPORTED;
+--- qutecom-2.2.1+dfsg1.orig/libs/pixertool/src/pixertool.cpp
++++ qutecom-2.2.1+dfsg1/libs/pixertool/src/pixertool.cpp
+@@ -114,8 +114,8 @@ pixerrorcode pix_convert(int flags, pixi
+ 
+ 	//int len_target = pix_size(img_dst->palette, img_src->width, img_src->height);
+ 
+-	enum PixelFormat pix_fmt_source = pix_ffmpeg_from_pix_osi(img_src->palette);
+-	enum PixelFormat pix_fmt_target = pix_ffmpeg_from_pix_osi(img_dst->palette);
++	enum AVPixelFormat pix_fmt_source = pix_ffmpeg_from_pix_osi(img_src->palette);
++	enum AVPixelFormat pix_fmt_target = pix_ffmpeg_from_pix_osi(img_dst->palette);
+ 
+ 	AVPicture avp_source, avp_target;
+ 	avpicture_fill(&avp_source,  buf_source, pix_fmt_source, img_src->width, img_src->height);
+@@ -126,7 +126,7 @@ pixerrorcode pix_convert(int flags, pixi
+ 		avp_source.data[0] += avp_source.linesize[0] * (img_src->height - 1);
+ 		avp_source.linesize[0] *= -1;
+ 
+-		if (pix_fmt_source == PIX_FMT_YUV420P) {
++		if (pix_fmt_source == AV_PIX_FMT_YUV420P) {
+ 			avp_source.data[1] += avp_source.linesize[1] * (img_src->height / 2 - 1);
+ 			avp_source.linesize[1] *= -1;
+ 			avp_source.data[2] += avp_source.linesize[2] * (img_src->height / 2 - 1);
+@@ -139,7 +139,7 @@ pixerrorcode pix_convert(int flags, pixi
+ 
+ 		//resampling only works yuv420P -> yuv420P in current ffmpeg
+ 
+-		if (pix_fmt_source != PIX_FMT_YUV420P) {
++		if (pix_fmt_source != AV_PIX_FMT_YUV420P) {
+ 			return PIX_NOK;
+ 		}
+ 
+--- qutecom-2.2.1+dfsg1.orig/wifo/phapi/phcodec-avcodec-wrapper.c
++++ qutecom-2.2.1+dfsg1/wifo/phapi/phcodec-avcodec-wrapper.c
+@@ -118,7 +118,7 @@ int phcodec_avcodec_encoder_init(ph_avco
+ 		}
+ 	}
+ 
+-	encoder_t->context->pix_fmt = PIX_FMT_YUV420P;
++	encoder_t->context->pix_fmt = AV_PIX_FMT_YUV420P;
+ 	encoder_t->context->width = dest_width;
+ 	encoder_t->context->height = dest_height;
+     
+@@ -136,8 +136,8 @@ int phcodec_avcodec_encoder_init(ph_avco
+ 	encoder_t->context->rtp_payload_size = 1000;
+ 	encoder_t->context->rtp_callback = phcodec_avcodec_video_rtp_callback;
+ 
+-	encoder_t->resized_pic = avcodec_alloc_frame();
+-	encoder_t->sampled_frame = avcodec_alloc_frame();
++	encoder_t->resized_pic = av_frame_alloc();
++	encoder_t->sampled_frame = av_frame_alloc();
+ 
+ 	return 0;
+ }
+@@ -152,7 +152,7 @@ int phcodec_avcodec_decoder_init(ph_avco
+ 
+ 
+ 	decoder_t->context = avcodec_alloc_context3(NULL);
+-	decoder_t->pictureIn = avcodec_alloc_frame();
++	decoder_t->pictureIn = av_frame_alloc();
+ 
+ 	decoder_t->decoder = avcodec_find_decoder(meta_t->avcodec_decoder_id);
+ 
+--- qutecom-2.2.1+dfsg1.orig/wifo/phapi/phmedia-video.c
++++ qutecom-2.2.1+dfsg1/wifo/phapi/phmedia-video.c
+@@ -679,7 +679,7 @@ int ph_msession_video_start(struct ph_ms
+ 		// create the still image for the virtual webcam
+ 		fs_buffer = (uint8_t*)av_malloc((176*144*3)/2);
+ 		video_stream->phmfs_onewaycam.buffer = fs_buffer;
+-		yuv_local_len = avpicture_get_size(PIX_FMT_YUV420P, 176, 144);
++		yuv_local_len = avpicture_get_size(AV_PIX_FMT_YUV420P, 176, 144);
+ 		//memcpy(video_stream->phmfs_onewaycam.buffer, pic_yuv, yuv_local_len);
+ 		memset(video_stream->phmfs_onewaycam.buffer, NOWEBCAM_FILL_VALUE, yuv_local_len);
+ 		//
diff --git a/debian/patches/series b/debian/patches/series
index af68b26..7f0dee4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@ libav9.8.patch
 libav10.patch
 find-qt4-cmake30.patch
 fix-missing-qt-include.patch
+ffmpeg_2.9.patch

Reply via email to