Package: opal Version: 3.10.10~dfsg2-1 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..96c293b --- /dev/null +++ b/debian/patches/ffmpeg_2.9.patch @@ -0,0 +1,171 @@ +Description: Replace deprecated FFmpeg API +Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> +Last-Update: <2015-11-02> + +--- opal-3.10.10~dfsg2.orig/plugins/video/H.263-1998/h263-1998.cxx ++++ opal-3.10.10~dfsg2/plugins/video/H.263-1998/h263-1998.cxx +@@ -230,11 +230,10 @@ bool H263_Base_EncoderContext::Init(AVCo + + m_context->opaque = this; + +- m_context->flags = CODEC_FLAG_EMU_EDGE // don't draw edges +- | CODEC_FLAG_TRUNCATED // Possible missing packets ++ m_context->flags = CODEC_FLAG_TRUNCATED // Possible missing packets + ; + +- m_context->pix_fmt = PIX_FMT_YUV420P; ++ m_context->pix_fmt = AV_PIX_FMT_YUV420P; + m_context->gop_size = H263_KEY_FRAME_INTERVAL; + + // X-Lite does not like Custom Picture frequency clocks... stick to 29.97Hz +@@ -440,9 +439,6 @@ bool H263_Base_EncoderContext::OpenCodec + m_inputFrame->data[1] = m_inputFrame->data[0] + planeSize; + m_inputFrame->data[2] = m_inputFrame->data[1] + (planeSize / 4); + +- if (m_context->width > 352) +- m_context->flags &= ~CODEC_FLAG_EMU_EDGE; // Totally bizarre! FFMPEG crashes if on for CIF4 +- + // Dump info + PTRACE(5, m_prefix, "Size is " << m_context->width << "x" << m_context->height); + PTRACE(5, m_prefix, "GOP is " << m_context->gop_size); +@@ -456,7 +452,7 @@ bool H263_Base_EncoderContext::OpenCodec + PTRACE(5, m_prefix, "qmax set to " << m_context->qmax); + PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size); + +- return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0; ++ return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) == 0; + } + + void H263_Base_EncoderContext::CloseCodec() +@@ -707,7 +703,7 @@ bool H263_Base_DecoderContext::OpenCodec + return 0; + } + +- if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0) { ++ if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0) { + PTRACE(1, m_prefix, "Failed to open H.263 decoder"); + return false; + } +--- opal-3.10.10~dfsg2.orig/plugins/video/H.264/h264-x264.cxx ++++ opal-3.10.10~dfsg2/plugins/video/H.264/h264-x264.cxx +@@ -1074,7 +1074,6 @@ class MyDecoder : public PluginCodec<MY_ + m_context->workaround_bugs = FF_BUG_AUTODETECT; + m_context->idct_algo = FF_IDCT_AUTO; + m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK; +- m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE; + m_context->flags2 = + #ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE + CODEC_FLAG2_DROP_FRAME_TIMECODE | +@@ -1084,7 +1083,7 @@ class MyDecoder : public PluginCodec<MY_ + if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL) + return false; + +- if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0) ++ if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0) + return false; + + PTRACE(4, MY_CODEC_LOG, "Opened decoder (SVN $Revision: 28048 $)"); +--- opal-3.10.10~dfsg2.orig/plugins/video/MPEG4-ffmpeg/mpeg4.cxx ++++ opal-3.10.10~dfsg2/plugins/video/MPEG4-ffmpeg/mpeg4.cxx +@@ -539,7 +539,7 @@ void MPEG4EncoderContext::ResetBitCounte + // + + void MPEG4EncoderContext::SetStaticEncodingParams(){ +- m_avcontext->pix_fmt = PIX_FMT_YUV420P; ++ m_avcontext->pix_fmt = AV_PIX_FMT_YUV420P; + m_avcontext->mb_decision = FF_MB_DECISION_SIMPLE; // high quality off + m_avcontext->rtp_payload_size = 750; // ffh263 uses 750 + m_avcontext->rtp_callback = &MPEG4EncoderContext::RtpCallback; +@@ -595,7 +595,6 @@ void MPEG4EncoderContext::SetStaticEncod + m_avcontext->flags|=CODEC_FLAG_AC_PRED; + /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */ + m_avcontext->flags|=CODEC_FLAG_4MV; +- m_avcontext->flags|=CODEC_FLAG_GMC; + m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER; + #endif + m_avcontext->opaque = this; // for use in RTP callback +@@ -710,13 +709,15 @@ bool MPEG4EncoderContext::OpenCodec() + if (PTRACE_CHECK(4)) { + m_avcontext->debug |= FF_DEBUG_RC; + m_avcontext->debug |= FF_DEBUG_PICT_INFO; +- m_avcontext->debug |= FF_DEBUG_MV; ++// m_avcontext->debug |= FF_DEBUG_MV; + } + #endif + + SetStaticEncodingParams(); + SetDynamicEncodingParams(false); // don't force a restart, it's not open +- if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0) ++ AVDictionary *opts = NULL; ++ av_dict_set_int(&opts, "gmc", 1, 0); ++ if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, &opts) < 0) + { + PTRACE(1, "MPEG4", "Encoder could not be opened"); + return false; +@@ -1411,7 +1412,7 @@ bool MPEG4DecoderContext::OpenCodec() + + SetStaticDecodingParams(); + SetDynamicDecodingParams(false); // don't force a restart, it's not open +- if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0) { ++ if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, NULL) < 0) { + PTRACE(1, "MPEG4", "Decoder failed to open"); + return false; + } +--- opal-3.10.10~dfsg2.orig/plugins/video/common/dyna.cxx ++++ opal-3.10.10~dfsg2/plugins/video/common/dyna.cxx +@@ -291,14 +291,14 @@ AVFrame *FFMPEGLibrary::AvcodecAllocFram + { + WaitAndSignal m(processLock); + +- return avcodec_alloc_frame(); ++ return av_frame_alloc(); + } + +-int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec) ++int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options) + { + WaitAndSignal m(processLock); + +- return avcodec_open2(ctx, codec, NULL); ++ return avcodec_open2(ctx, codec, options); + } + + int FFMPEGLibrary::AvcodecClose(AVCodecContext *ctx) +@@ -344,7 +344,15 @@ void FFMPEGLibrary::AvSetDimensions(AVCo + { + WaitAndSignal m(processLock); + +- avcodec_set_dimensions(s, width, height); ++ if (av_image_check_size(width, height, 0, s) < 0) { ++ av_log(s, AV_LOG_WARNING, "Failed to set dimensions %d %d\n", width, height); ++ width = height = 0; ++ } ++ ++ s->coded_width = width; ++ s->coded_height = height; ++ s->width = (width + (1 << av_codec_get_lowres(s)) - 1) >> av_codec_get_lowres(s); ++ s->height = (height + (1 << av_codec_get_lowres(s)) - 1) >> av_codec_get_lowres(s); + } + + void FFMPEGLibrary::AvLogSetLevel(int level) +--- opal-3.10.10~dfsg2.orig/plugins/video/common/dyna.h ++++ opal-3.10.10~dfsg2/plugins/video/common/dyna.h +@@ -97,7 +97,7 @@ class FFMPEGLibrary + AVCodec *AvcodecFindDecoder(enum AVCodecID id); + AVCodecContext *AvcodecAllocContext(AVCodec*); + AVFrame *AvcodecAllocFrame(void); +- int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec); ++ int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options); + int AvcodecClose(AVCodecContext *ctx); + int AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict); + int AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size); +--- opal-3.10.10~dfsg2.orig/plugins/video/common/ffmpeg.h ++++ opal-3.10.10~dfsg2/plugins/video/common/ffmpeg.h +@@ -47,6 +47,7 @@ + + extern "C" { + #include <libavcodec/avcodec.h> ++#include <libavutil/imgutils.h> + // AVPacket was declared in avformat.h before April 2009 + #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0) + #include <libavformat/avformat.h> diff --git a/debian/patches/series b/debian/patches/series index 94f0b29..db4ef65 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -2,3 +2,4 @@ disable-samples-ftbfs.diff plugins_clean_target.patch libav9.patch libav10.patch +ffmpeg_2.9.patch