diff -Nru ffmpegthumbs-15.12.3/cmake/FindFFmpeg.cmake ffmpegthumbs-17.12.3/cmake/FindFFmpeg.cmake --- ffmpegthumbs-15.12.3/cmake/FindFFmpeg.cmake 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/cmake/FindFFmpeg.cmake 2017-03-27 22:50:03.000000000 +0000 @@ -99,6 +99,7 @@ # 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) diff -Nru ffmpegthumbs-15.12.3/CMakeLists.txt ffmpegthumbs-17.12.3/CMakeLists.txt --- ffmpegthumbs-15.12.3/CMakeLists.txt 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/CMakeLists.txt 2017-03-27 22:50:03.000000000 +0000 @@ -10,7 +10,7 @@ include(WriteBasicConfigVersionFile) include(KDEInstallDirs) include(KDECMakeSettings) -include(KDECompilerSettings) +include(KDECompilerSettings NO_POLICY_SCOPE) find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Gui) find_package(KF5 REQUIRED COMPONENTS KIO) @@ -36,7 +36,7 @@ add_library(ffmpegthumbs MODULE ${ffmpegthumbs_PART_SRCS}) -target_link_libraries(ffmpegthumbs Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} ) +target_link_libraries(ffmpegthumbs Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} ) install(TARGETS ffmpegthumbs DESTINATION ${PLUGIN_INSTALL_DIR}) diff -Nru ffmpegthumbs-15.12.3/debian/changelog ffmpegthumbs-17.12.3/debian/changelog --- ffmpegthumbs-15.12.3/debian/changelog 2016-04-14 21:54:17.000000000 +0000 +++ ffmpegthumbs-17.12.3/debian/changelog 2021-08-31 21:58:33.000000000 +0000 @@ -1,3 +1,90 @@ +ffmpegthumbs (4:17.12.3-0ubuntu1~16.04.sav0) xenial; urgency=medium + + * Backport to Xenial + + -- Rob Savoury Tue, 31 Aug 2021 14:58:33 -0700 + +ffmpegthumbs (4:17.12.3-0ubuntu1) bionic; urgency=medium + + * New upstream release (17.12.3) + + -- Rik Mills Fri, 16 Mar 2018 13:23:01 +0000 + +ffmpegthumbs (4:17.12.2-0ubuntu1) bionic; urgency=medium + + * New upstream release (17.11.80) + * New upstream release (17.11.90) + * New upstream release (17.12.0) + * New upstream release (17.12.2) + + -- Rik Mills Thu, 22 Feb 2018 16:55:01 +0000 + +ffmpegthumbs (4:17.08.3-0ubuntu1) bionic; urgency=medium + + * New upstream release (17.08.3) + + -- Rik Mills Fri, 01 Dec 2017 15:01:29 +0000 + +ffmpegthumbs (4:17.04.3-0ubuntu1) artful; urgency=low + + * New upstream release (17.04.1) + * Install translations and add Breaks/Replaces against kde-l10n + * New upstream release (17.04.2) + * New upstream release (17.04.3) + + -- José Manuel Santamaría Lema Fri, 18 Aug 2017 08:31:25 +0100 + +ffmpegthumbs (4:16.12.3-0ubuntu1) zesty; urgency=low + + [ Darin Miller ] + * New upstream release (16.12.2) + + [ José Manuel Santamaría Lema ] + * New upstream release (16.12.3) + + -- José Manuel Santamaría Lema Fri, 10 Mar 2017 21:27:23 +0000 + +ffmpegthumbs (4:16.12.1-0ubuntu1) zesty; urgency=medium + + [ José Manuel Santamaría Lema ] + * Update Vcs-Git fields to use https:// instead of git:// + + [ Rik Mills ] + * New upstream release (16.12.0) + * Update build deps to use new KF5 style names + * New upstream release (16.12.1) + + -- Rik Mills Thu, 19 Jan 2017 16:16:01 +0000 + +ffmpegthumbs (4:16.04.3-0ubuntu1) yakkety; urgency=medium + + [ Scarlett Clark ] + * New upstream release. + + [ Philip Muškovac ] + * Update the Vcs URLs now that the repositories are hosted on + Launchpad + + [ Scarlett Clark ] + * New upstream bugfix release + + [ Clive Johnston ] + * New upstream release (16.04.2) + * Removing patch ffmpeg_2.9.patch + * New upstream release (16.04.3) + + [ José Manuel Santamaría Lema ] + * Merge with debian, fixing a FTBFS. (LP: #1574037) + + -- Philip Muškovac Fri, 22 Jul 2016 12:15:35 +0000 + +ffmpegthumbs (4:16.04.2-1) unstable; urgency=medium + + [ Automatic packaging ] + * Refresh patches + + -- Maximiliano Curia Wed, 22 Jun 2016 16:18:03 +0200 + ffmpegthumbs (4:15.12.3-0ubuntu1) xenial; urgency=medium * New upstream bugfix release @@ -17,6 +104,27 @@ -- Clive Johnston Wed, 09 Mar 2016 10:23:59 +0100 +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 + + -- Maximiliano Curia Sun, 29 May 2016 15:40:55 +0200 + +ffmpegthumbs (4:15.12.0-1) experimental; urgency=medium + + * New upstream release (15.12.0). + + -- Maximiliano Curia Mon, 01 Feb 2016 10:22:42 +0100 + ffmpegthumbs (4:15.08.2-0ubuntu1) wily; urgency=medium * New upstream release. diff -Nru ffmpegthumbs-15.12.3/debian/control ffmpegthumbs-17.12.3/debian/control --- ffmpegthumbs-15.12.3/debian/control 2016-04-14 21:54:17.000000000 +0000 +++ ffmpegthumbs-17.12.3/debian/control 2018-03-16 13:23:01.000000000 +0000 @@ -5,25 +5,28 @@ Uploaders: Pino Toscano , Sune Vuorela , Maximiliano Curia -Build-Depends: cmake, +Build-Depends: cmake (>= 2.8.12~), debhelper (>= 9), - extra-cmake-modules, - kio-dev (>= 5.18), + extra-cmake-modules (>= 5.31.0~), libavcodec-dev, + libavfilter-dev, libavformat-dev, libavutil-dev, + libkf5kio-dev (>= 5.31.0~), libswscale-dev, pkg-config, pkg-kde-tools (>= 0.12), - qtbase5-dev -Standards-Version: 3.9.6 + qtbase5-dev (>= 5.6.1~) +Standards-Version: 3.9.8 Homepage: http://www.kde.org/ -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/applications/ffmpegthumbs.git -Vcs-Git: git://anonscm.debian.org/pkg-kde/applications/ffmpegthumbs.git +Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs +Vcs-Git: https://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs Package: ffmpegthumbs Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} +Breaks: ${kde-l10n:all} +Replaces: ${kde-l10n:all} Description: video thumbnail generator using ffmpeg FFMpegThumbs is a video thumbnail generator for KDE file managers like Dolphin and Konqueror. It enables them to show preview images diff -Nru ffmpegthumbs-15.12.3/debian/rules ffmpegthumbs-17.12.3/debian/rules --- ffmpegthumbs-15.12.3/debian/rules 2016-04-14 21:54:17.000000000 +0000 +++ ffmpegthumbs-17.12.3/debian/rules 2018-03-16 13:23:01.000000000 +0000 @@ -1,4 +1,7 @@ #!/usr/bin/make -f -include /usr/share/pkg-kde-tools/qt-kde-team/2/debian-qt-kde.mk +l10npkgs_firstversion_ok := 4:17.03.90-0~ + +include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk +include /usr/share/pkg-kde-tools/qt-kde-team/2/l10n-packages.mk diff -Nru ffmpegthumbs-15.12.3/debian/upstream/metadata ffmpegthumbs-17.12.3/debian/upstream/metadata --- ffmpegthumbs-15.12.3/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ ffmpegthumbs-17.12.3/debian/upstream/metadata 2018-03-16 13:23:01.000000000 +0000 @@ -0,0 +1,7 @@ +Name: ffmpegthumbs +Changelog: https://quickgit.kde.org/?p=ffmpegthumbs.git&a=log +Contact: kde-devel@kde.org +Donation: https://www.kde.org/community/donations/index.php +Repository: https://anongit.kde.org/ffmpegthumbs.git +Repository-Browse: https://quickgit.kde.org/?p=ffmpegthumbs.git +Security-Contact: security@kde.org diff -Nru ffmpegthumbs-15.12.3/debian/watch ffmpegthumbs-17.12.3/debian/watch --- ffmpegthumbs-15.12.3/debian/watch 2016-04-14 21:54:17.000000000 +0000 +++ ffmpegthumbs-17.12.3/debian/watch 2018-03-16 13:23:01.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -http://download.kde.org/unstable/applications/([\d.]+)/src/ffmpegthumbs-([\d.]+).tar.xz http://download.kde.org/stable/applications/([\d.]+)/src/ffmpegthumbs-([\d.]+).tar.xz diff -Nru ffmpegthumbs-15.12.3/ffmpegthumbnailer/moviedecoder.cpp ffmpegthumbs-17.12.3/ffmpegthumbnailer/moviedecoder.cpp --- ffmpegthumbs-15.12.3/ffmpegthumbnailer/moviedecoder.cpp 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/ffmpegthumbnailer/moviedecoder.cpp 2017-03-27 22:50:03.000000000 +0000 @@ -40,6 +40,10 @@ , m_FormatContextWasGiven(pavContext != NULL) , m_AllowSeek(true) , m_initialized(false) + , m_bufferSinkContext(nullptr) + , m_bufferSourceContext(nullptr) + , m_filterGraph(nullptr) + , m_filterFrame(nullptr) { initialize(filename); } @@ -51,6 +55,9 @@ void MovieDecoder::initialize(const QString& filename) { + m_lastWidth = -1; + m_lastHeight = -1; + m_lastPixfmt = AV_PIX_FMT_NONE; av_register_all(); avcodec_register_all(); @@ -67,7 +74,7 @@ } initializeVideo(); - m_pFrame = avcodec_alloc_frame(); + m_pFrame = av_frame_alloc(); if (m_pFrame) { m_initialized=true; @@ -82,6 +89,7 @@ void MovieDecoder::destroy() { + deleteFilterGraph(); if (m_pVideoCodecContext) { avcodec_close(m_pVideoCodecContext); m_pVideoCodecContext = NULL; @@ -93,13 +101,13 @@ } if (m_pPacket) { - av_free_packet(m_pPacket); + av_packet_unref(m_pPacket); delete m_pPacket; m_pPacket = NULL; } if (m_pFrame) { - av_free(m_pFrame); + av_frame_free(&m_pFrame); m_pFrame = NULL; } @@ -239,7 +247,7 @@ return false; } - avcodec_get_frame_defaults(m_pFrame); + av_frame_unref(m_pFrame); int frameFinished = 0; @@ -264,7 +272,7 @@ int attempts = 0; if (m_pPacket) { - av_free_packet(m_pPacket); + av_packet_unref(m_pPacket); delete m_pPacket; } @@ -275,7 +283,7 @@ if (framesAvailable) { frameDecoded = m_pPacket->stream_index == m_VideoStream; if (!frameDecoded) { - av_free_packet(m_pPacket); + av_packet_unref(m_pPacket); } } } @@ -283,15 +291,100 @@ return frameDecoded; } +void MovieDecoder::deleteFilterGraph() +{ + if (m_filterGraph) { + av_frame_free(&m_filterFrame); + avfilter_graph_free(&m_filterGraph); + m_filterGraph = nullptr; + } +} + +bool MovieDecoder::initFilterGraph(enum AVPixelFormat pixfmt, int width, int height) +{ + AVFilterInOut *inputs = nullptr, *outputs = nullptr; + + deleteFilterGraph(); + m_filterGraph = avfilter_graph_alloc(); + + QByteArray arguments("buffer="); + arguments += "video_size=" + QByteArray::number(width) + "x" + QByteArray::number(height) + ":"; + arguments += "pix_fmt=" + QByteArray::number(pixfmt) + ":"; + arguments += "time_base=1/1:pixel_aspect=0/1[in];"; + arguments += "[in]yadif[out];"; + arguments += "[out]buffersink"; + + int ret = avfilter_graph_parse2(m_filterGraph, arguments.constData(), &inputs, &outputs); + if (ret < 0) { + qWarning() << "Unable to parse filter graph"; + return false; + } + + if(inputs || outputs) + return -1; + + ret = avfilter_graph_config(m_filterGraph, nullptr); + if (ret < 0) { + qWarning() << "Unable to validate filter graph"; + return false; + } + + m_bufferSourceContext = avfilter_graph_get_filter(m_filterGraph, "Parsed_buffer_0"); + m_bufferSinkContext = avfilter_graph_get_filter(m_filterGraph, "Parsed_buffersink_2"); + if (!m_bufferSourceContext || !m_bufferSinkContext) { + qWarning() << "Unable to get source or sink"; + return false; + } + m_filterFrame = av_frame_alloc(); + m_lastWidth = width; + m_lastHeight = height; + m_lastPixfmt = pixfmt; + + return true; +} + +bool MovieDecoder::processFilterGraph(AVPicture *dst, const AVPicture *src, + enum AVPixelFormat pixfmt, int width, int height) +{ + if (!m_filterGraph || width != m_lastWidth || + height != m_lastHeight || pixfmt != m_lastPixfmt) { + + if (!initFilterGraph(pixfmt, width, height)) { + return false; + } + } + + memcpy(m_filterFrame->data, src->data, sizeof(src->data)); + memcpy(m_filterFrame->linesize, src->linesize, sizeof(src->linesize)); + m_filterFrame->width = width; + m_filterFrame->height = height; + m_filterFrame->format = pixfmt; + + int ret = av_buffersrc_add_frame(m_bufferSourceContext, m_filterFrame); + if (ret < 0) { + return false; + } + + ret = av_buffersink_get_frame(m_bufferSinkContext, m_filterFrame); + if (ret < 0) { + return false; + } + + av_picture_copy(dst, (const AVPicture *) m_filterFrame, pixfmt, width, height); + av_frame_unref(m_filterFrame); + + return true; +} + 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, + processFilterGraph((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 +395,7 @@ 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 +416,7 @@ 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 +448,9 @@ } } -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(av_malloc(numBytes)); diff -Nru ffmpegthumbs-15.12.3/ffmpegthumbnailer/moviedecoder.h ffmpegthumbs-17.12.3/ffmpegthumbnailer/moviedecoder.h --- ffmpegthumbs-15.12.3/ffmpegthumbnailer/moviedecoder.h 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/ffmpegthumbnailer/moviedecoder.h 2017-03-27 22:50:03.000000000 +0000 @@ -23,6 +23,9 @@ extern "C" { #include #include +#include +#include +#include } namespace ffmpegthumbnailer @@ -52,10 +55,14 @@ 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 deleteFilterGraph(); + bool initFilterGraph(enum AVPixelFormat pixfmt, int width, int height); + bool processFilterGraph(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pixfmt, int width, int height); + private: int m_VideoStream; AVFormatContext* m_pFormatContext; @@ -68,6 +75,13 @@ bool m_FormatContextWasGiven; bool m_AllowSeek; bool m_initialized; + AVFilterContext* m_bufferSinkContext; + AVFilterContext* m_bufferSourceContext; + AVFilterGraph* m_filterGraph; + AVFrame* m_filterFrame; + int m_lastWidth; + int m_lastHeight; + enum AVPixelFormat m_lastPixfmt; }; } diff -Nru ffmpegthumbs-15.12.3/ffmpegthumbnailer.cpp ffmpegthumbs-17.12.3/ffmpegthumbnailer.cpp --- ffmpegthumbs-15.12.3/ffmpegthumbnailer.cpp 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/ffmpegthumbnailer.cpp 2017-03-27 22:50:03.000000000 +0000 @@ -50,6 +50,6 @@ ThumbCreator::Flags FFMpegThumbnailer::flags() const { - return (Flags)(DrawFrame); + return (Flags)(None); } diff -Nru ffmpegthumbs-15.12.3/ffmpegthumbs.desktop ffmpegthumbs-17.12.3/ffmpegthumbs.desktop --- ffmpegthumbs-15.12.3/ffmpegthumbs.desktop 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/ffmpegthumbs.desktop 2017-03-27 22:50:03.000000000 +0000 @@ -30,6 +30,7 @@ Name[nb]=Videofiler (ffmpegthumbs) Name[nds]=Videodateien (ffmpeg-Vöransichten) Name[nl]=Videobestanden (ffmpeg-miniaturen) +Name[nn]=Videofiler (ffmpegthumbs) Name[pa]=ਵਿਡੀਓ ਫਾਇਲਾਂ (ffmpegthumbs) Name[pl]=Pliki filmów (ffmpegthumbs) Name[pt]=Ficheiros de Vídeo (ffmpegthumbs) diff -Nru ffmpegthumbs-15.12.3/tests/CMakeLists.txt ffmpegthumbs-17.12.3/tests/CMakeLists.txt --- ffmpegthumbs-15.12.3/tests/CMakeLists.txt 2015-11-07 18:53:05.000000000 +0000 +++ ffmpegthumbs-17.12.3/tests/CMakeLists.txt 2017-03-27 22:50:03.000000000 +0000 @@ -19,7 +19,7 @@ add_executable(ffmpegthumbtest ${ffmpegthumbtest_SRCS} ) -target_link_libraries(ffmpegthumbtest Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES}) +target_link_libraries(ffmpegthumbtest Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES})