diff -Nru libavg-1.8.2/debian/changelog libavg-1.8.2/debian/changelog --- libavg-1.8.2/debian/changelog 2018-01-31 09:40:52.000000000 +0000 +++ libavg-1.8.2/debian/changelog 2018-08-02 16:10:38.000000000 +0000 @@ -1,3 +1,19 @@ +libavg (1.8.2-1+rpi1) buster-staging; urgency=medium + + * Apply modified version of commit 3d8968781320a4b2e067d05b4c5cb6ba234a50f4 from + https://github.com/jcowgill/libavg/tree/ffmpeg-4.0 to fix FTBFS with ffmpeg 4.0. + + Note: commit 9865ae4c9d591a2cc4da7e8f78eebcee88c26544 only seems to be relavent for + versions of libavg that use cmake, which this version doesn't. + * Edit configure.ac to disable vdpau, support is broken with ffmpeg 4.0 and has been removed + upstream. + * Enable dh-autoreconf, for changes to configure.ac. + * Cleanup versioninfo.cache in clean target + * Apply upstream commit 390e7decda5fbc496c2aabf75df190655eb5aee6 to fix + error: ‘AVFMT_RAWPICTURE’ was not declared in this scope + * Cleanup config.sub and config.guess in clean target. + + -- Peter Michael Green Thu, 02 Aug 2018 16:10:38 +0000 + libavg (1.8.2-1) unstable; urgency=medium * Team upload. diff -Nru libavg-1.8.2/debian/patches/disable-vdpau.patch libavg-1.8.2/debian/patches/disable-vdpau.patch --- libavg-1.8.2/debian/patches/disable-vdpau.patch 1970-01-01 00:00:00.000000000 +0000 +++ libavg-1.8.2/debian/patches/disable-vdpau.patch 2018-08-02 16:10:38.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Edit configure.ac to disable vdpau + support is broken with ffmpeg 4.0 and has been removed +Author: Peter Michael Green +Last-Update: 2018-08-02 + +--- libavg-1.8.2.orig/configure.ac ++++ libavg-1.8.2/configure.ac +@@ -186,7 +186,7 @@ AM_CONDITIONAL(ENABLE_OPENGL, test x"$GL + + AM_PATH_SDL(1.2.10,:,AC_MSG_ERROR([libSDL not found. Aborting.])) + +-AC_CHECK_LIB([vdpau],[main],let vdpau_lib=1,let vdpau_lib=0) ++#AC_CHECK_LIB([vdpau],[main],let vdpau_lib=1,let vdpau_lib=0) + AC_CHECK_HEADERS([libavcodec/vdpau.h],let vdpau_h1=1,let vdpau_h1=0) + AC_CHECK_HEADERS([vdpau/vdpau.h],let vdpau_h2=1,let vdpau_h2=0) + if [[ $vdpau_lib -eq 1 ]] && [[ $vdpau_h1 -eq 1 ]] && [[ $vdpau_h2 -eq 1 ]]; then diff -Nru libavg-1.8.2/debian/patches/ffmpeg_4.0.patch libavg-1.8.2/debian/patches/ffmpeg_4.0.patch --- libavg-1.8.2/debian/patches/ffmpeg_4.0.patch 1970-01-01 00:00:00.000000000 +0000 +++ libavg-1.8.2/debian/patches/ffmpeg_4.0.patch 2018-08-02 16:10:38.000000000 +0000 @@ -0,0 +1,51 @@ +Modified by Peter Michael Green to apply to Debian version of libavg + +commit 3d8968781320a4b2e067d05b4c5cb6ba234a50f4 +Author: James Cowgill +Date: Sat Jun 16 22:40:46 2018 +0100 + + Fix build with FFmpeg 4.0 by using new constant names + +Index: libavg-1.8.2.new/src/player/VideoWriterThread.cpp +=================================================================== +--- libavg-1.8.2.new.orig/src/player/VideoWriterThread.cpp ++++ libavg-1.8.2.new/src/player/VideoWriterThread.cpp +@@ -216,7 +216,7 @@ void VideoWriterThread::setupVideoStream + pCodecContext->qmax = m_QMax; + // some formats want stream headers to be separate + if (m_pOutputFormatContext->oformat->flags & AVFMT_GLOBALHEADER) { +- pCodecContext->flags |= CODEC_FLAG_GLOBAL_HEADER; ++ pCodecContext->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + } + m_FramesWritten = 0; + } +Index: libavg-1.8.2.new/src/video/AudioDecoderThread.cpp +=================================================================== +--- libavg-1.8.2.new.orig/src/video/AudioDecoderThread.cpp ++++ libavg-1.8.2.new/src/video/AudioDecoderThread.cpp +@@ -176,7 +176,7 @@ void AudioDecoderThread::decodePacket(AV + bIsPlanar = av_sample_fmt_is_planar((SampleFormat)m_InputSampleFormat); + if (bIsPlanar) { + char* pPackedData = (char*)av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE + +- FF_INPUT_BUFFER_PADDING_SIZE); ++ AV_INPUT_BUFFER_PADDING_SIZE); + planarToInterleaved(pPackedData, pDecodedData, m_pStream->codec->channels, + m_pStream->codec->frame_size); + pBuffer = resampleAudio(pPackedData, framesDecoded, +Index: libavg-1.8.2.new/src/video/WrapFFMpeg.h +=================================================================== +--- libavg-1.8.2.new.orig/src/video/WrapFFMpeg.h ++++ libavg-1.8.2.new/src/video/WrapFFMpeg.h +@@ -88,4 +88,12 @@ extern "C" { + #undef PixelFormat + #endif + ++// Defines renamed in libav 12 / FFmpeg 2.8 ++#ifndef AV_INPUT_BUFFER_PADDING_SIZE ++ #define AV_INPUT_BUFFER_PADDING_SIZE FF_INPUT_BUFFER_PADDING_SIZE ++#endif ++#ifndef AV_CODEC_FLAG_GLOBAL_HEADER ++ #define AV_CODEC_FLAG_GLOBAL_HEADER CODEC_FLAG_GLOBAL_HEADER ++#endif ++ + #endif diff -Nru libavg-1.8.2/debian/patches/only-use-videobuffer-for-old-ffmpeg.patch libavg-1.8.2/debian/patches/only-use-videobuffer-for-old-ffmpeg.patch --- libavg-1.8.2/debian/patches/only-use-videobuffer-for-old-ffmpeg.patch 1970-01-01 00:00:00.000000000 +0000 +++ libavg-1.8.2/debian/patches/only-use-videobuffer-for-old-ffmpeg.patch 2018-08-02 16:10:38.000000000 +0000 @@ -0,0 +1,60 @@ +Modified by Peter Michael Green to apply to Debian's libavg. + +commit 390e7decda5fbc496c2aabf75df190655eb5aee6 +Author: Ulrich von Zadow +Date: Tue May 12 10:41:12 2015 +0200 + + Only need VideoBuffer for old ffmpeg versions. + +Index: libavg-1.8.2.new/src/player/VideoWriterThread.cpp +=================================================================== +--- libavg-1.8.2.new.orig/src/player/VideoWriterThread.cpp ++++ libavg-1.8.2.new/src/player/VideoWriterThread.cpp +@@ -34,7 +34,10 @@ using namespace std; + + namespace avg { + ++#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(54, 0, 0) + const unsigned int VIDEO_BUFFER_SIZE = 400000; ++#endif ++ + const AVPixelFormat STREAM_PIXEL_FORMAT = ::AV_PIX_FMT_YUVJ420P; + + VideoWriterThread::VideoWriterThread(CQueue& cmdQueue, const string& sFilename, +@@ -94,7 +97,9 @@ void VideoWriterThread::close() + } + + av_free(m_pOutputFormatContext); ++#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(54, 0, 0) + av_free(m_pVideoBuffer); ++#endif + av_frame_free(&m_pConvertedFrame); + av_free(m_pPictureBuffer); + sws_freeContext(m_pFrameConversionContext); +@@ -154,10 +159,12 @@ void VideoWriterThread::open() + + openVideoCodec(); + ++#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(54, 0, 0) + m_pVideoBuffer = NULL; + if (!(m_pOutputFormatContext->oformat->flags & AVFMT_RAWPICTURE)) { + m_pVideoBuffer = (unsigned char*)(av_malloc(VIDEO_BUFFER_SIZE)); + } ++#endif + + if (!(m_pOutputFormat->flags & AVFMT_NOFILE)) { + #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(53, 8, 0) +Index: libavg-1.8.2.new/src/player/VideoWriterThread.h +=================================================================== +--- libavg-1.8.2.new.orig/src/player/VideoWriterThread.h ++++ libavg-1.8.2.new/src/player/VideoWriterThread.h +@@ -75,7 +75,9 @@ class AVG_API VideoWriterThread : public + SwsContext* m_pFrameConversionContext; + AVFrame* m_pConvertedFrame; + unsigned char* m_pPictureBuffer; ++#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(54, 0, 0) + unsigned char* m_pVideoBuffer; ++#endif + int m_FramesWritten; + }; + diff -Nru libavg-1.8.2/debian/patches/series libavg-1.8.2/debian/patches/series --- libavg-1.8.2/debian/patches/series 2018-01-31 09:40:52.000000000 +0000 +++ libavg-1.8.2/debian/patches/series 2018-08-02 16:10:38.000000000 +0000 @@ -6,3 +6,6 @@ c11.patch gcc-7.patch ffmpeg_3.4.patch +ffmpeg_4.0.patch +disable-vdpau.patch +only-use-videobuffer-for-old-ffmpeg.patch diff -Nru libavg-1.8.2/debian/rules libavg-1.8.2/debian/rules --- libavg-1.8.2/debian/rules 2018-01-31 09:40:52.000000000 +0000 +++ libavg-1.8.2/debian/rules 2018-08-02 16:10:38.000000000 +0000 @@ -3,7 +3,7 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all %: - dh $@ --with python2 + dh $@ --with python2,autoreconf override_dh_installman: dh_installman debian/*.1 @@ -18,3 +18,8 @@ dh_install rename -f 's/\.py$$//' ./debian/python-libavg/usr/bin/avg_*.py find debian/python-libavg/ -name '*.la' -delete + +override_dh_auto_clean: + dh_auto_clean + rm -f versioninfo.cache + rm -f config.sub config.guess