Merge ~panfaust/kubuntu-packaging/+git/ffmpegthumbs:work into ~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs:kubuntu_yakkety_archive

Proposed by Jose Manuel Santamaria Lema
Status: Merged
Merged at revision: 490801dfd449b25c4051ad3abd6e7193aec4e9f5
Proposed branch: ~panfaust/kubuntu-packaging/+git/ffmpegthumbs:work
Merge into: ~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs:kubuntu_yakkety_archive
Diff against target: 416 lines (+351/-4)
6 files modified
debian/changelog (+20/-2)
debian/control (+1/-1)
debian/patches/series (+1/-0)
debian/patches/upstream_port_to_libavfilter.patch (+321/-0)
debian/rules (+1/-1)
debian/upstream/metadata (+7/-0)
Reviewer Review Type Date Requested Status
Kubuntu Packagers Pending
Review via email: mp+300788@code.launchpad.net

Description of the change

Right now ffmpegthumbs 16.04.3 is failing to build in staging, there is an upstream patch for this included in debian which solves the issue.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 390a1ee..080d3e2 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -15,8 +15,18 @@ ffmpegthumbs (4:16.04.3-0ubuntu1) UNRELEASED; urgency=medium
6 * Removing patch ffmpeg_2.9.patch
7 * New upstream release (16.04.3)
8
9+ [ José Manuel Santamaría Lema ]
10+ * Merge with debian, fixing a FTBFS.
11+
12 -- Clive Johnston <clivejo@kubuntu.org> Fri, 08 Jul 2016 00:44:44 +0100
13
14+ffmpegthumbs (4:16.04.2-1) unstable; urgency=medium
15+
16+ [ Automatic packaging ]
17+ * Refresh patches
18+
19+ -- Maximiliano Curia <maxy@debian.org> Wed, 22 Jun 2016 16:18:03 +0200
20+
21 ffmpegthumbs (4:15.12.3-0ubuntu1) xenial; urgency=medium
22
23 * New upstream bugfix release
24@@ -36,12 +46,20 @@ ffmpegthumbs (4:15.12.1-0ubuntu1) xenial; urgency=medium
25
26 -- Clive Johnston <clivejo@aol.com> Wed, 09 Mar 2016 10:23:59 +0100
27
28-ffmpegthumbs (4:15.12.0-2~) UNRELEASED; urgency=medium
29+ffmpegthumbs (4:15.12.0-2) unstable; urgency=medium
30
31+ [ Maximiliano Curia ]
32 * Add new patch: ffmpeg2.9_support.patch (Closes: #803813) Thanks to
33 Andreas Cadhalpun
34+ * debian/control: Update Vcs-Browser and Vcs-Git fields
35+ * Add upstream metadata (DEP-12)
36+ * Use the newer debian-qt-kde.mk
37+ * Use upstream ffmpeg 2.9 patch
38+
39+ [ Automatic packaging ]
40+ * Bump Standards-Version to 3.9.8
41
42- -- Maximiliano Curia <maxy@debian.org> Fri, 05 Feb 2016 10:42:11 +0100
43+ -- Maximiliano Curia <maxy@debian.org> Sun, 29 May 2016 15:40:55 +0200
44
45 ffmpegthumbs (4:15.12.0-1) experimental; urgency=medium
46
47diff --git a/debian/control b/debian/control
48index 4cc4a18..0e0a3d2 100644
49--- a/debian/control
50+++ b/debian/control
51@@ -17,7 +17,7 @@ Build-Depends: cmake (>= 2.8.12~),
52 pkg-config,
53 pkg-kde-tools (>= 0.12),
54 qtbase5-dev (>= 5.2.0~)
55-Standards-Version: 3.9.6
56+Standards-Version: 3.9.8
57 Homepage: http://www.kde.org/
58 Vcs-Browser: https://code.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs
59 Vcs-Git: git://git.launchpad.net/~kubuntu-packagers/kubuntu-packaging/+git/ffmpegthumbs
60diff --git a/debian/patches/series b/debian/patches/series
61new file mode 100644
62index 0000000..b9788e9
63--- /dev/null
64+++ b/debian/patches/series
65@@ -0,0 +1 @@
66+upstream_port_to_libavfilter.patch
67diff --git a/debian/patches/upstream_port_to_libavfilter.patch b/debian/patches/upstream_port_to_libavfilter.patch
68new file mode 100644
69index 0000000..0bdc4c4
70--- /dev/null
71+++ b/debian/patches/upstream_port_to_libavfilter.patch
72@@ -0,0 +1,321 @@
73+From: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
74+Date: Wed, 15 Jun 2016 01:53:13 +0200
75+Subject: upstream_port_to_libavfilter
76+
77+commit 3978c762072b7bc16b2096819b7cfa2052deaf5e
78+Author: Martin T. H. Sandsmark <martin.sandsmark@kde.org>
79+Date: Fri May 27 22:29:11 2016 +0200
80+
81+ Port to libavfilter for deinterlacing.
82+
83+ Based on a patch from Andreas Cadhalpun
84+ <andreas.cadhalpun@googlemail.com>.
85+---
86+ CMakeLists.txt | 2 +-
87+ cmake/FindFFmpeg.cmake | 1 +
88+ ffmpegthumbnailer/moviedecoder.cpp | 117 +++++++++++++++++++++++++++++++++----
89+ ffmpegthumbnailer/moviedecoder.h | 18 +++++-
90+ tests/CMakeLists.txt | 2 +-
91+ 5 files changed, 124 insertions(+), 16 deletions(-)
92+
93+diff --git a/CMakeLists.txt b/CMakeLists.txt
94+index 7a025d4..1fab769 100644
95+--- a/CMakeLists.txt
96++++ b/CMakeLists.txt
97+@@ -36,7 +36,7 @@ set( ffmpegthumbs_PART_SRCS
98+
99+ add_library(ffmpegthumbs MODULE ${ffmpegthumbs_PART_SRCS})
100+
101+-target_link_libraries(ffmpegthumbs Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} )
102++target_link_libraries(ffmpegthumbs Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES} )
103+
104+ install(TARGETS ffmpegthumbs DESTINATION ${PLUGIN_INSTALL_DIR})
105+
106+diff --git a/cmake/FindFFmpeg.cmake b/cmake/FindFFmpeg.cmake
107+index 27c6b16..915ab5f 100644
108+--- a/cmake/FindFFmpeg.cmake
109++++ b/cmake/FindFFmpeg.cmake
110+@@ -99,6 +99,7 @@ if (NOT FFMPEG_LIBRARIES)
111+
112+ # Check for all possible component.
113+ find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
114++ find_component(AVFILTER libavfilter avfilter libavfilter/avfilter.h)
115+ find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
116+ find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
117+ find_component(AVUTIL libavutil avutil libavutil/avutil.h)
118+diff --git a/ffmpegthumbnailer/moviedecoder.cpp b/ffmpegthumbnailer/moviedecoder.cpp
119+index c8ae6d1..b2e7551 100644
120+--- a/ffmpegthumbnailer/moviedecoder.cpp
121++++ b/ffmpegthumbnailer/moviedecoder.cpp
122+@@ -40,6 +40,10 @@ MovieDecoder::MovieDecoder(const QString& filename, AVFormatContext* pavContext)
123+ , m_FormatContextWasGiven(pavContext != NULL)
124+ , m_AllowSeek(true)
125+ , m_initialized(false)
126++ , m_bufferSinkContext(nullptr)
127++ , m_bufferSourceContext(nullptr)
128++ , m_filterGraph(nullptr)
129++ , m_filterFrame(nullptr)
130+ {
131+ initialize(filename);
132+ }
133+@@ -51,6 +55,9 @@ MovieDecoder::~MovieDecoder()
134+
135+ void MovieDecoder::initialize(const QString& filename)
136+ {
137++ m_lastWidth = -1;
138++ m_lastHeight = -1;
139++ m_lastPixfmt = AV_PIX_FMT_NONE;
140+ av_register_all();
141+ avcodec_register_all();
142+
143+@@ -67,7 +74,7 @@ void MovieDecoder::initialize(const QString& filename)
144+ }
145+
146+ initializeVideo();
147+- m_pFrame = avcodec_alloc_frame();
148++ m_pFrame = av_frame_alloc();
149+
150+ if (m_pFrame) {
151+ m_initialized=true;
152+@@ -82,6 +89,7 @@ bool MovieDecoder::getInitialized()
153+
154+ void MovieDecoder::destroy()
155+ {
156++ deleteFilterGraph();
157+ if (m_pVideoCodecContext) {
158+ avcodec_close(m_pVideoCodecContext);
159+ m_pVideoCodecContext = NULL;
160+@@ -93,13 +101,13 @@ void MovieDecoder::destroy()
161+ }
162+
163+ if (m_pPacket) {
164+- av_free_packet(m_pPacket);
165++ av_packet_unref(m_pPacket);
166+ delete m_pPacket;
167+ m_pPacket = NULL;
168+ }
169+
170+ if (m_pFrame) {
171+- av_free(m_pFrame);
172++ av_frame_free(&m_pFrame);
173+ m_pFrame = NULL;
174+ }
175+
176+@@ -239,7 +247,7 @@ bool MovieDecoder::decodeVideoPacket()
177+ return false;
178+ }
179+
180+- avcodec_get_frame_defaults(m_pFrame);
181++ av_frame_unref(m_pFrame);
182+
183+ int frameFinished = 0;
184+
185+@@ -264,7 +272,7 @@ bool MovieDecoder::getVideoPacket()
186+ int attempts = 0;
187+
188+ if (m_pPacket) {
189+- av_free_packet(m_pPacket);
190++ av_packet_unref(m_pPacket);
191+ delete m_pPacket;
192+ }
193+
194+@@ -275,7 +283,7 @@ bool MovieDecoder::getVideoPacket()
195+ if (framesAvailable) {
196+ frameDecoded = m_pPacket->stream_index == m_VideoStream;
197+ if (!frameDecoded) {
198+- av_free_packet(m_pPacket);
199++ av_packet_unref(m_pPacket);
200+ }
201+ }
202+ }
203+@@ -283,15 +291,100 @@ bool MovieDecoder::getVideoPacket()
204+ return frameDecoded;
205+ }
206+
207++void MovieDecoder::deleteFilterGraph()
208++{
209++ if (m_filterGraph) {
210++ av_frame_free(&m_filterFrame);
211++ avfilter_graph_free(&m_filterGraph);
212++ m_filterGraph = nullptr;
213++ }
214++}
215++
216++bool MovieDecoder::initFilterGraph(enum AVPixelFormat pixfmt, int width, int height)
217++{
218++ AVFilterInOut *inputs = nullptr, *outputs = nullptr;
219++
220++ deleteFilterGraph();
221++ m_filterGraph = avfilter_graph_alloc();
222++
223++ QByteArray arguments("buffer=");
224++ arguments += "video_size=" + QByteArray::number(width) + "x" + QByteArray::number(height) + ":";
225++ arguments += "pix_fmt=" + QByteArray::number(pixfmt) + ":";
226++ arguments += "time_base=1/1:pixel_aspect=0/1[in];";
227++ arguments += "[in]yadif[out];";
228++ arguments += "[out]buffersink";
229++
230++ int ret = avfilter_graph_parse2(m_filterGraph, arguments.constData(), &inputs, &outputs);
231++ if (ret < 0) {
232++ qWarning() << "Unable to parse filter graph";
233++ return false;
234++ }
235++
236++ if(inputs || outputs)
237++ return -1;
238++
239++ ret = avfilter_graph_config(m_filterGraph, nullptr);
240++ if (ret < 0) {
241++ qWarning() << "Unable to validate filter graph";
242++ return false;
243++ }
244++
245++ m_bufferSourceContext = avfilter_graph_get_filter(m_filterGraph, "Parsed_buffer_0");
246++ m_bufferSinkContext = avfilter_graph_get_filter(m_filterGraph, "Parsed_buffersink_2");
247++ if (!m_bufferSourceContext || !m_bufferSinkContext) {
248++ qWarning() << "Unable to get source or sink";
249++ return false;
250++ }
251++ m_filterFrame = av_frame_alloc();
252++ m_lastWidth = width;
253++ m_lastHeight = height;
254++ m_lastPixfmt = pixfmt;
255++
256++ return true;
257++}
258++
259++bool MovieDecoder::processFilterGraph(AVPicture *dst, const AVPicture *src,
260++ enum AVPixelFormat pixfmt, int width, int height)
261++{
262++ if (!m_filterGraph || width != m_lastWidth ||
263++ height != m_lastHeight || pixfmt != m_lastPixfmt) {
264++
265++ if (!initFilterGraph(pixfmt, width, height)) {
266++ return false;
267++ }
268++ }
269++
270++ memcpy(m_filterFrame->data, src->data, sizeof(src->data));
271++ memcpy(m_filterFrame->linesize, src->linesize, sizeof(src->linesize));
272++ m_filterFrame->width = width;
273++ m_filterFrame->height = height;
274++ m_filterFrame->format = pixfmt;
275++
276++ int ret = av_buffersrc_add_frame(m_bufferSourceContext, m_filterFrame);
277++ if (ret < 0) {
278++ return false;
279++ }
280++
281++ ret = av_buffersink_get_frame(m_bufferSinkContext, m_filterFrame);
282++ if (ret < 0) {
283++ return false;
284++ }
285++
286++ av_picture_copy(dst, (const AVPicture *) m_filterFrame, pixfmt, width, height);
287++ av_frame_unref(m_filterFrame);
288++
289++ return true;
290++}
291++
292+ void MovieDecoder::getScaledVideoFrame(int scaledSize, bool maintainAspectRatio, VideoFrame& videoFrame)
293+ {
294+ if (m_pFrame->interlaced_frame) {
295+- avpicture_deinterlace((AVPicture*) m_pFrame, (AVPicture*) m_pFrame, m_pVideoCodecContext->pix_fmt,
296++ processFilterGraph((AVPicture*) m_pFrame, (AVPicture*) m_pFrame, m_pVideoCodecContext->pix_fmt,
297+ m_pVideoCodecContext->width, m_pVideoCodecContext->height);
298+ }
299+
300+ int scaledWidth, scaledHeight;
301+- convertAndScaleFrame(PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
302++ convertAndScaleFrame(AV_PIX_FMT_RGB24, scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
303+
304+ videoFrame.width = scaledWidth;
305+ videoFrame.height = scaledHeight;
306+@@ -302,7 +395,7 @@ void MovieDecoder::getScaledVideoFrame(int scaledSize, bool maintainAspectRatio,
307+ memcpy((&(videoFrame.frameData.front())), m_pFrame->data[0], videoFrame.lineSize * videoFrame.height);
308+ }
309+
310+-void MovieDecoder::convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
311++void MovieDecoder::convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight)
312+ {
313+ calculateDimensions(scaledSize, maintainAspectRatio, scaledWidth, scaledHeight);
314+ SwsContext* scaleContext = sws_getContext(m_pVideoCodecContext->width, m_pVideoCodecContext->height,
315+@@ -323,7 +416,7 @@ void MovieDecoder::convertAndScaleFrame(PixelFormat format, int scaledSize, bool
316+ convertedFrame->data, convertedFrame->linesize);
317+ sws_freeContext(scaleContext);
318+
319+- av_free(m_pFrame);
320++ av_frame_free(&m_pFrame);
321+ av_free(m_pFrameBuffer);
322+
323+ m_pFrame = convertedFrame;
324+@@ -355,9 +448,9 @@ void MovieDecoder::calculateDimensions(int squareSize, bool maintainAspectRatio,
325+ }
326+ }
327+
328+-void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format)
329++void MovieDecoder::createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format)
330+ {
331+- *avFrame = avcodec_alloc_frame();
332++ *avFrame = av_frame_alloc();
333+
334+ int numBytes = avpicture_get_size(format, width, height);
335+ *frameBuffer = reinterpret_cast<quint8*>(av_malloc(numBytes));
336+diff --git a/ffmpegthumbnailer/moviedecoder.h b/ffmpegthumbnailer/moviedecoder.h
337+index 2888926..788ce43 100644
338+--- a/ffmpegthumbnailer/moviedecoder.h
339++++ b/ffmpegthumbnailer/moviedecoder.h
340+@@ -23,6 +23,9 @@
341+ extern "C" {
342+ #include <libavcodec/avcodec.h>
343+ #include <libavformat/avformat.h>
344++#include <libavfilter/avfilter.h>
345++#include <libavfilter/buffersrc.h>
346++#include <libavfilter/buffersink.h>
347+ }
348+
349+ namespace ffmpegthumbnailer
350+@@ -52,10 +55,14 @@ private:
351+
352+ bool decodeVideoPacket();
353+ bool getVideoPacket();
354+- void convertAndScaleFrame(PixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
355+- void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, PixelFormat format);
356++ void convertAndScaleFrame(AVPixelFormat format, int scaledSize, bool maintainAspectRatio, int& scaledWidth, int& scaledHeight);
357++ void createAVFrame(AVFrame** avFrame, quint8** frameBuffer, int width, int height, AVPixelFormat format);
358+ void calculateDimensions(int squareSize, bool maintainAspectRatio, int& destWidth, int& destHeight);
359+
360++ void deleteFilterGraph();
361++ bool initFilterGraph(enum AVPixelFormat pixfmt, int width, int height);
362++ bool processFilterGraph(AVPicture *dst, const AVPicture *src, enum AVPixelFormat pixfmt, int width, int height);
363++
364+ private:
365+ int m_VideoStream;
366+ AVFormatContext* m_pFormatContext;
367+@@ -68,6 +75,13 @@ private:
368+ bool m_FormatContextWasGiven;
369+ bool m_AllowSeek;
370+ bool m_initialized;
371++ AVFilterContext* m_bufferSinkContext;
372++ AVFilterContext* m_bufferSourceContext;
373++ AVFilterGraph* m_filterGraph;
374++ AVFrame* m_filterFrame;
375++ int m_lastWidth;
376++ int m_lastHeight;
377++ enum AVPixelFormat m_lastPixfmt;
378+ };
379+
380+ }
381+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
382+index 1728fcd..b46169a 100644
383+--- a/tests/CMakeLists.txt
384++++ b/tests/CMakeLists.txt
385+@@ -19,7 +19,7 @@ set(ffmpegthumbtest_SRCS ffmpegthumbtest.cpp
386+
387+ add_executable(ffmpegthumbtest ${ffmpegthumbtest_SRCS} )
388+
389+-target_link_libraries(ffmpegthumbtest Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES})
390++target_link_libraries(ffmpegthumbtest Qt5::Gui KF5::KIOWidgets ${AVUTIL_LIBRARIES} ${AVFILTER_LIBRARIES} ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${SWSCALE_LIBRARIES})
391+
392+
393+
394diff --git a/debian/rules b/debian/rules
395index 169ddd7..4c9ce6a 100755
396--- a/debian/rules
397+++ b/debian/rules
398@@ -1,4 +1,4 @@
399 #!/usr/bin/make -f
400
401-include /usr/share/pkg-kde-tools/qt-kde-team/2/debian-qt-kde.mk
402+include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk
403
404diff --git a/debian/upstream/metadata b/debian/upstream/metadata
405new file mode 100644
406index 0000000..a03b122
407--- /dev/null
408+++ b/debian/upstream/metadata
409@@ -0,0 +1,7 @@
410+Name: ffmpegthumbs
411+Changelog: https://quickgit.kde.org/?p=ffmpegthumbs.git&a=log
412+Contact: kde-devel@kde.org
413+Donation: https://www.kde.org/community/donations/index.php
414+Repository: https://anongit.kde.org/ffmpegthumbs.git
415+Repository-Browse: https://quickgit.kde.org/?p=ffmpegthumbs.git
416+Security-Contact: security@kde.org

Subscribers

People subscribed via source and target branches