Hello community,
here is the log from the commit of package ffmpegthumbs for openSUSE:Factory checked in at 2016-08-22 10:07:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ffmpegthumbs (Old)
and /work/SRC/openSUSE:Factory/.ffmpegthumbs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ffmpegthumbs"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ffmpegthumbs/ffmpegthumbs.changes 2016-07-24 19:44:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ffmpegthumbs.new/ffmpegthumbs.changes 2016-08-22 10:07:26.000000000 +0200
@@ -1,0 +2,19 @@
+Fri Aug 12 10:02:56 UTC 2016 - tittiatcoke@gmail.com
+
+- Update to KDE Applications 16.08.0
+ * KDE Applications 16.08.0
+ * https://www.kde.org/announcements/announce-applications-16.08.0.php
+
+- Drop upstreamed patches:
+ * ffmpegthumbs-ffmpeg3.patch
+ * ffmpeg-buildrequires.patch
+
+-------------------------------------------------------------------
+Mon Aug 8 14:34:28 UTC 2016 - tittiatcoke@gmail.com
+
+- Update to KDE Applications 16.07.90
+ * KDE Applications 16.07.90 (16.08-RC)
+ * https://www.kde.org/announcements/announce-applications-16.07.90.php
+
+
+-------------------------------------------------------------------
Old:
----
ffmpeg-buildrequires.patch
ffmpegthumbs-16.04.3.tar.xz
ffmpegthumbs-ffmpeg3.patch
New:
----
ffmpegthumbs-16.08.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ffmpegthumbs.spec ++++++
--- /var/tmp/diff_new_pack.pNCFyW/_old 2016-08-22 10:07:27.000000000 +0200
+++ /var/tmp/diff_new_pack.pNCFyW/_new 2016-08-22 10:07:27.000000000 +0200
@@ -31,11 +31,9 @@
Summary: FFmpeg-based thumbnail creator for video files
License: LGPL-2.0+
Group: System/GUI/KDE
-Version: 16.04.3
+Version: 16.08.0
Release: 0
Source0: %{name}-%{version}.tar.xz
-Patch0: ffmpeg-buildrequires.patch
-Patch1: ffmpegthumbs-ffmpeg3.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -43,8 +41,6 @@
%prep
%setup
-%patch0 -p1
-%patch1
%build
%cmake_kf5 -d build
++++++ ffmpegthumbs-16.04.3.tar.xz -> ffmpegthumbs-16.08.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpegthumbs-16.04.3/CMakeLists.txt new/ffmpegthumbs-16.08.0/CMakeLists.txt
--- old/ffmpegthumbs-16.04.3/CMakeLists.txt 2016-05-29 22:15:06.000000000 +0200
+++ new/ffmpegthumbs-16.08.0/CMakeLists.txt 2016-05-29 22:18:26.000000000 +0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpegthumbs-16.04.3/cmake/FindFFmpeg.cmake new/ffmpegthumbs-16.08.0/cmake/FindFFmpeg.cmake
--- old/ffmpegthumbs-16.04.3/cmake/FindFFmpeg.cmake 2016-05-29 22:15:06.000000000 +0200
+++ new/ffmpegthumbs-16.08.0/cmake/FindFFmpeg.cmake 2016-05-29 22:18:26.000000000 +0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ffmpegthumbs-16.04.3/ffmpegthumbnailer/moviedecoder.cpp new/ffmpegthumbs-16.08.0/ffmpegthumbnailer/moviedecoder.cpp
--- old/ffmpegthumbs-16.04.3/ffmpegthumbnailer/moviedecoder.cpp 2016-05-29 22:15:06.000000000 +0200
+++ new/ffmpegthumbs-16.08.0/ffmpegthumbnailer/moviedecoder.cpp 2016-05-29 22:18:26.000000000 +0200
@@ -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