Your message dated Mon, 30 May 2016 10:23:07 +0000
with message-id <e1b7klj-0002og...@franck.debian.org>
and subject line Bug#803813: fixed in ffmpegthumbs 4:15.12.0-2
has caused the Debian Bug report #803813,
regarding ffmpegthumbs: FTBFS with FFmpeg 2.9
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
803813: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803813
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: ffmpegthumbs
Version: 15.07.90-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 are non-trivial and should be runtime-tested.

Best regards,
Andreas

diff --git a/debian/control b/debian/control
index 49d34f3..aef0a4b 100644
--- a/debian/control
+++ b/debian/control
@@ -10,6 +10,7 @@ Build-Depends: cmake,
                kde-sc-dev-latest (>= 4:4.12),
                kdelibs5-dev,
                libavcodec-dev,
+               libavfilter-dev,
                libavformat-dev,
                libavutil-dev,
                libswscale-dev,
diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..613ba28
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,242 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
+Last-Update: <2015-11-02>
+
+--- ffmpegthumbs-15.07.90.orig/CMakeLists.txt
++++ ffmpegthumbs-15.07.90/CMakeLists.txt
+@@ -27,7 +27,7 @@ set( ffmpegthumbs_PART_SRCS
+ 
+ kde4_add_plugin(ffmpegthumbs ${ffmpegthumbs_PART_SRCS})
+ 
+-target_link_libraries(ffmpegthumbs  ${KDE4_KIO_LIBS} ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} )
++target_link_libraries(ffmpegthumbs  ${KDE4_KIO_LIBS} ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} )
+ 
+ install(TARGETS ffmpegthumbs DESTINATION ${PLUGIN_INSTALL_DIR})
+ 
+--- ffmpegthumbs-15.07.90.orig/cmake/FindFFmpeg.cmake
++++ ffmpegthumbs-15.07.90/cmake/FindFFmpeg.cmake
+@@ -99,6 +99,7 @@ if (NOT FFMPEG_LIBRARIES)
+ 
+   # Check for all possible component.
+   find_component(AVCODEC  libavcodec  avcodec  libavcodec/avcodec.h)
++  find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
+   find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
+   find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
+   find_component(AVUTIL   libavutil   avutil   libavutil/avutil.h)
+--- ffmpegthumbs-15.07.90.orig/ffmpegthumbnailer/moviedecoder.cpp
++++ ffmpegthumbs-15.07.90/ffmpegthumbnailer/moviedecoder.cpp
+@@ -51,6 +51,9 @@ MovieDecoder::~MovieDecoder()
+ 
+ void MovieDecoder::initialize(const QString& filename)
+ {
++    m_last_width = -1;
++    m_last_height = -1;
++    m_last_pixfmt = AV_PIX_FMT_NONE;
+     av_register_all();
+     avcodec_register_all();
+ 
+@@ -67,7 +70,7 @@ void MovieDecoder::initialize(const QStr
+     }
+ 
+     initializeVideo();
+-    m_pFrame = avcodec_alloc_frame();
++    m_pFrame = av_frame_alloc();
+ 
+     if (m_pFrame) {
+         m_initialized=true;
+@@ -82,6 +85,7 @@ bool MovieDecoder::getInitialized()
+ 
+ void MovieDecoder::destroy()
+ {
++    delete_filter_graph();
+     if (m_pVideoCodecContext) {
+         avcodec_close(m_pVideoCodecContext);
+         m_pVideoCodecContext = NULL;
+@@ -99,7 +103,7 @@ void MovieDecoder::destroy()
+     }
+ 
+     if (m_pFrame) {
+-        av_free(m_pFrame);
++        av_frame_free(&m_pFrame);
+         m_pFrame = NULL;
+     }
+ 
+@@ -239,7 +243,7 @@ bool MovieDecoder::decodeVideoPacket()
+         return false;
+     }
+ 
+-    avcodec_get_frame_defaults(m_pFrame);
++    av_frame_unref(m_pFrame);
+ 
+     int frameFinished = 0;
+ 
+@@ -283,15 +287,83 @@ bool MovieDecoder::getVideoPacket()
+     return frameDecoded;
+ }
+ 
++void MovieDecoder::delete_filter_graph() {
++    if (m_filter_graph) {
++        av_frame_free(&m_filter_frame);
++        avfilter_graph_free(&m_filter_graph);
++    }
++}
++
++int MovieDecoder::init_filter_graph(enum AVPixelFormat pixfmt, int width, int height) {
++    AVFilterInOut *inputs = NULL, *outputs = NULL;
++    char args[512];
++    int res;
++
++    delete_filter_graph();
++    m_filter_graph = avfilter_graph_alloc();
++    snprintf(args, sizeof(args),
++             "buffer=video_size=%dx%d:pix_fmt=%d:time_base=1/1:pixel_aspect=0/1[in];"
++             "[in]yadif[out];"
++             "[out]buffersink",
++             width, height, pixfmt);
++    res = avfilter_graph_parse2(m_filter_graph, args, &inputs, &outputs);
++    if (res < 0)
++        return res;
++    if(inputs || outputs)
++        return -1;
++    res = avfilter_graph_config(m_filter_graph, NULL);
++    if (res < 0)
++        return res;
++
++    m_buffersrc_ctx = avfilter_graph_get_filter(m_filter_graph, "Parsed_buffer_0");
++    m_buffersink_ctx = avfilter_graph_get_filter(m_filter_graph, "Parsed_buffersink_2");
++    if (!m_buffersrc_ctx || !m_buffersink_ctx)
++        return -1;
++    m_filter_frame = av_frame_alloc();
++    m_last_width = width;
++    m_last_height = height;
++    m_last_pixfmt = pixfmt;
++
++    return 0;
++}
++
++int MovieDecoder::process_filter_graph(AVPicture *dst, const AVPicture *src,
++                                enum AVPixelFormat pixfmt, int width, int height) {
++    int res;
++
++    if (!m_filter_graph || width != m_last_width ||
++        height != m_last_height || pixfmt != m_last_pixfmt) {
++        res = init_filter_graph(pixfmt, width, height);
++        if (res < 0)
++            return res;
++    }
++
++    memcpy(m_filter_frame->data, src->data, sizeof(src->data));
++    memcpy(m_filter_frame->linesize, src->linesize, sizeof(src->linesize));
++    m_filter_frame->width = width;
++    m_filter_frame->height = height;
++    m_filter_frame->format = pixfmt;
++    res = av_buffersrc_add_frame(m_buffersrc_ctx, m_filter_frame);
++    if (res < 0)
++        return res;
++    res = av_buffersink_get_frame(m_buffersink_ctx, m_filter_frame);
++    if (res < 0)
++        return res;
++    av_picture_copy(dst, (const AVPicture *) m_filter_frame, pixfmt, width, height);
++    av_frame_unref(m_filter_frame);
++
++    return 0;
++}
++
+ void MovieDecoder::getScaledVideoFrame(int scaledSize, bool maintainAspectRatio, VideoFrame& videoFrame)
+ {
+     if (m_pFrame->interlaced_frame) {
+-        avpicture_deinterlace((AVPicture*) m_pFrame, (AVPicture*) m_pFrame, m_pVideoCodecContext->pix_fmt,
++        process_filter_graph((AVPicture*) m_pFrame, (AVPicture*) m_pFrame, m_pVideoCodecContext->pix_fmt,
+                               m_pVideoCodecContext->width, m_pVideoCodecContext->height);
+     }
+ 
+     int scaledWidth, scaledHeight;
+-    convertAndScaleFrame(PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
++    convertAndScaleFrame(AV_PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
+ 
+     videoFrame.width = scaledWidth;
+     videoFrame.height = scaledHeight;
+@@ -302,7 +374,7 @@ void MovieDecoder::getScaledVideoFrame(i
+     memcpy((&(videoFrame.frameData.front())), m_pFrame->data[0], videoFrame.lineSize * videoFrame.height);
+ }
+ 
+-void MovieDecoder::convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
++void MovieDecoder::convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
+ {
+     calculateDimensions(scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
+     SwsContext* scaleContext = sws_getContext(m_pVideoCodecContext->width, m_pVideoCodecContext->height,
+@@ -323,7 +395,7 @@ void MovieDecoder::convertAndScaleFrame(
+               convertedFrame->data, convertedFrame->linesize);
+     sws_freeContext(scaleContext);
+ 
+-    av_free(m_pFrame);
++    av_frame_free(&m_pFrame);
+     av_free(m_pFrameBuffer);
+ 
+     m_pFrame        = convertedFrame;
+@@ -355,9 +427,9 @@ void MovieDecoder::calculateDimensions(i
+     }
+ }
+ 
+-void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format)
++void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format)
+ {
+-    *avFrame = avcodec_alloc_frame();
++    *avFrame = av_frame_alloc();
+ 
+     int numBytes = avpicture_get_size(format, width, height);
+     *frameBuffer = reinterpret_cast<quint8*>(av_malloc(numBytes));
+--- ffmpegthumbs-15.07.90.orig/ffmpegthumbnailer/moviedecoder.h
++++ ffmpegthumbs-15.07.90/ffmpegthumbnailer/moviedecoder.h
+@@ -23,6 +23,9 @@
+ extern "C" {
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
++#include <libavfilter/avfilter.h>
++#include <libavfilter/buffersrc.h>
++#include <libavfilter/buffersink.h>
+ }
+ 
+ namespace ffmpegthumbnailer
+@@ -52,10 +55,14 @@ private:
+ 
+     bool decodeVideoPacket();
+     bool getVideoPacket();
+-    void convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
+-    void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format);
++    void convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
++    void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format);
+     void calculateDimensions(int squareSize, bool maintainAspectRatio, int& destWidth, int& destHeight);
+ 
++    void delete_filter_graph();
++    int init_filter_graph(enum AVPixelFormat pixfmt, int width, int height);
++    int process_filter_graph(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pixfmt, int width, int height);
++
+ private:
+     int                     m_VideoStream;
+     AVFormatContext*        m_pFormatContext;
+@@ -68,6 +75,13 @@ private:
+     bool                    m_FormatContextWasGiven;
+     bool                    m_AllowSeek;
+     bool                    m_initialized;
++    AVFilterContext*        m_buffersink_ctx;
++    AVFilterContext*        m_buffersrc_ctx;
++    AVFilterGraph*          m_filter_graph;
++    AVFrame*                m_filter_frame;
++    int                     m_last_width;
++    int                     m_last_height;
++    enum AVPixelFormat      m_last_pixfmt;
+ };
+ 
+ }
+--- ffmpegthumbs-15.07.90.orig/tests/CMakeLists.txt
++++ ffmpegthumbs-15.07.90/tests/CMakeLists.txt
+@@ -19,7 +19,7 @@ set(ffmpegthumbtest_SRCS ffmpegthumbtest
+ 
+ kde4_add_executable(ffmpegthumbtest ${ffmpegthumbtest_SRCS} )
+ 
+-target_link_libraries(ffmpegthumbtest ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES})
++target_link_libraries(ffmpegthumbtest ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES})
+ 
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..a827249
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+ffmpeg_2.9.patch

--- End Message ---
--- Begin Message ---
Source: ffmpegthumbs
Source-Version: 4:15.12.0-2

We believe that the bug you reported is fixed in the latest version of
ffmpegthumbs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 803...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Maximiliano Curia <m...@debian.org> (supplier of updated ffmpegthumbs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 29 May 2016 15:40:55 +0200
Source: ffmpegthumbs
Binary: ffmpegthumbs
Architecture: source
Version: 4:15.12.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-...@lists.debian.org>
Changed-By: Maximiliano Curia <m...@debian.org>
Description:
 ffmpegthumbs - video thumbnail generator using ffmpeg
Closes: 803813
Changes:
 ffmpegthumbs (4:15.12.0-2) unstable; urgency=medium
 .
   [ Maximiliano Curia ]
   * Add new patch: ffmpeg2.9_support.patch (Closes: #803813) Thanks to
     Andreas Cadhalpun
   * debian/control: Update Vcs-Browser and Vcs-Git fields
   * Add upstream metadata (DEP-12)
   * Use the newer debian-qt-kde.mk
   * Use upstream ffmpeg 2.9 patch
 .
   [ Automatic packaging ]
   * Bump Standards-Version to 3.9.8
Checksums-Sha1:
 b834e4cc2f64adcffd606123c8bf33414aa78426 2234 ffmpegthumbs_15.12.0-2.dsc
 94d61102ccc3393e6740bfbd5243aa4e39938f21 7148 
ffmpegthumbs_15.12.0-2.debian.tar.xz
Checksums-Sha256:
 30454ce1a079a3b0fee9d5542c43b629140d434b1a17903c13dc3f611ffe181f 2234 
ffmpegthumbs_15.12.0-2.dsc
 554b8f66a59e6fde8356fac4ce2590ddc2405c0355b847df17c3bfe4e5e204e0 7148 
ffmpegthumbs_15.12.0-2.debian.tar.xz
Files:
 111836c80344590813678b6cdea0d72d 2234 kde optional ffmpegthumbs_15.12.0-2.dsc
 3087932980918f9911fd587c222c5f10 7148 kde optional 
ffmpegthumbs_15.12.0-2.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJXS/KPAAoJEMcZdpmymyMqMGgP/AyCIibbWLcXV8hsqgf8yxL2
LDPAr7eTXPveGs0b+R2/cJ9N7QbezeLaCM3patp9X5xOBWXQshq9XTO+bwj6YO0J
yTscp8xs+IWUIX9PsRV+eOPVzdNWrMVjkP+uw029MMfoQJxOJkn1GKOw8soNW4WR
z3uvn2PV1FyhEtjxPOOPsDlVGFLx1LQaPx13TSpnsCeaedEpuvatE5uZ1g8YLKKy
OddH1j0tNU+Zm6r5bb2kjIaoyxZqVvC/PVc8L++SfZN0pIrZ+/KksAO17Uh2vs8c
y6me1qSKdkeC8bBCpzTqWd7B2xeblX8wTT1tf9o+4WefGbWg9gOuUJ57gq6wp8hf
RF+6vC+LydCX/beDl772YoGLBWvcU9b58VbsjeO2FZ9Y1lj7jTGW6ukF3ovNBDHm
rFXprGeOv342z0/r8Nb9+l2ydP8+9/+DSUG/vSwNnTXV3KtFNekd6JeCBhp10syk
kpyLaeNi9/gVnPn89saXdJ1tCL2xjAPa7B+1cNJDhudRv3honmQxiJsHpfoK9oXd
beImcPIyhplHInuZFUVqznDvaIvp936NOgcPs5IJma7bprSTKi6Fo1j1eqvx8Pk3
gqL/zL4L8vmjc10JxHNnbFQxGKxMdBsbycDFzOzMMlpklZHzcuUk7QiTExXQ8Gg9
d6zefrDI64Z02ovj0h0n
=NVS4
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to