Package: libavg
Version: 1.8.1-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 are non-trivial and should be runtime-tested.
Best regards,
Andreas
diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 000..dcef95b
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,314 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun
+Last-Update: <2015-11-02>
+
+--- libavg-1.8.1.orig/src/player/VideoWriterThread.cpp
libavg-1.8.1/src/player/VideoWriterThread.cpp
+@@ -35,7 +35,7 @@ using namespace std;
+ namespace avg {
+
+ const unsigned int VIDEO_BUFFER_SIZE = 40;
+-const AVPixelFormat STREAM_PIXEL_FORMAT = ::PIX_FMT_YUVJ420P;
++const AVPixelFormat STREAM_PIXEL_FORMAT = ::AV_PIX_FMT_YUVJ420P;
+
+ VideoWriterThread::VideoWriterThread(CQueue& cmdQueue, const string& sFilename,
+ IntPoint size, int frameRate, int qMin, int qMax)
+@@ -95,7 +95,7 @@ void VideoWriterThread::close()
+
+ av_free(m_pOutputFormatContext);
+ av_free(m_pVideoBuffer);
+-av_free(m_pConvertedFrame);
++av_frame_free(_pConvertedFrame);
+ av_free(m_pPictureBuffer);
+ sws_freeContext(m_pFrameConversionContext);
+ m_pOutputFormatContext = 0;
+@@ -174,7 +174,7 @@ void VideoWriterThread::open()
+ }
+
+ m_pFrameConversionContext = sws_getContext(m_Size.x, m_Size.y,
+-::PIX_FMT_RGB32, m_Size.x, m_Size.y, STREAM_PIXEL_FORMAT,
++::AV_PIX_FMT_RGB32, m_Size.x, m_Size.y, STREAM_PIXEL_FORMAT,
+ SWS_BILINEAR, NULL, NULL, NULL);
+
+ m_pConvertedFrame = createFrame(STREAM_PIXEL_FORMAT, m_Size);
+@@ -234,7 +234,7 @@ AVFrame* VideoWriterThread::createFrame(
+ {
+ AVFrame* pPicture;
+
+-pPicture = avcodec_alloc_frame();
++pPicture = av_frame_alloc();
+
+ int memNeeded = avpicture_get_size(pixelFormat, size.x, size.y);
+ m_pPictureBuffer = static_cast(av_malloc(memNeeded));
+--- libavg-1.8.1.orig/src/video/AudioDecoderThread.cpp
libavg-1.8.1/src/video/AudioDecoderThread.cpp
+@@ -134,7 +134,7 @@ void AudioDecoderThread::decodePacket(AV
+ #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 25, 0)
+ int gotFrame = 0;
+ AVFrame* pDecodedFrame;
+-pDecodedFrame = avcodec_alloc_frame();
++pDecodedFrame = av_frame_alloc();
+ #endif
+ while (pTempPacket->size > 0) {
+ int bytesDecoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+@@ -192,7 +192,7 @@ void AudioDecoderThread::decodePacket(AV
+ }
+ av_free(pDecodedData);
+ #if LIBAVCODEC_VERSION_MAJOR > 53
+-avcodec_free_frame();
++av_frame_free();
+ #elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53, 25, 0)
+ delete pDecodedFrame;
+ #endif
+--- libavg-1.8.1.orig/src/video/FFMpegFrameDecoder.cpp
libavg-1.8.1/src/video/FFMpegFrameDecoder.cpp
+@@ -119,29 +119,29 @@ void FFMpegFrameDecoder::convertFrameToB
+ switch (pBmp->getPixelFormat()) {
+ case R8G8B8X8:
+ case R8G8B8A8:
+-destFmt = PIX_FMT_RGBA;
++destFmt = AV_PIX_FMT_RGBA;
+ break;
+ case B8G8R8X8:
+ case B8G8R8A8:
+-destFmt = PIX_FMT_BGRA;
++destFmt = AV_PIX_FMT_BGRA;
+ break;
+ case R8G8B8:
+-destFmt = PIX_FMT_RGB24;
++destFmt = AV_PIX_FMT_RGB24;
+ break;
+ case B8G8R8:
+-destFmt = PIX_FMT_BGR24;
++destFmt = AV_PIX_FMT_BGR24;
+ break;
+ case YCbCr422:
+-destFmt = PIX_FMT_YUYV422;
++destFmt = AV_PIX_FMT_YUYV422;
+ break;
+ default:
+ AVG_ASSERT_MSG(false, (string("FFMpegFrameDecoder: Dest format ") +
+ toString(pBmp->getPixelFormat()) + " not supported.").c_str());
+-destFmt = PIX_FMT_BGRA;
++destFmt = AV_PIX_FMT_BGRA;
+ }
+ AVCodecContext const* pContext = m_pStream->codec;
+-if (destFmt == PIX_FMT_BGRA && (pContext->pix_fmt == PIX_FMT_YUV420P ||
+-pContext->pix_fmt == PIX_FMT_YUVJ420P))
++if (destFmt == AV_PIX_FMT_BGRA && (pContext->pix_fmt == AV_PIX_FMT_YUV420P ||
++pContext->pix_fmt == AV_PIX_FMT_YUVJ420P))
+ {
+ ScopeTimer timer(ConvertImageLibavgProfilingZone);
+ BitmapPtr pBmpY(new Bitmap(pBmp->getSize(), I8, pFrame->data[0],
+@@ -151,7 +151,7 @@ void FFMpegFrameDecoder::convertFrameToB
+ BitmapPtr pBmpV(new Bitmap(pBmp->getSize(), I8, pFrame->data[2],
+ pFrame->linesize[2],