[146293] trunk/dports/kde/ffmpegthumbs
nicos at macports.org
nicos at macports.org
Thu Mar 3 08:27:16 PST 2016
Revision: 146293
https://trac.macports.org/changeset/146293
Author: nicos at macports.org
Date: 2016-03-03 08:27:16 -0800 (Thu, 03 Mar 2016)
Log Message:
-----------
ffmpegthumbs: add variant to comply with changes in ffmpeg > 2.8 (ticket #50694)
Modified Paths:
--------------
trunk/dports/kde/ffmpegthumbs/Portfile
Added Paths:
-----------
trunk/dports/kde/ffmpegthumbs/files/
trunk/dports/kde/ffmpegthumbs/files/patch-deprecated.diff
trunk/dports/kde/ffmpegthumbs/files/patch-nodeinterlace.diff
Modified: trunk/dports/kde/ffmpegthumbs/Portfile
===================================================================
--- trunk/dports/kde/ffmpegthumbs/Portfile 2016-03-03 16:15:19 UTC (rev 146292)
+++ trunk/dports/kde/ffmpegthumbs/Portfile 2016-03-03 16:27:16 UTC (rev 146293)
@@ -25,6 +25,15 @@
depends_lib-append port:kdelibs4 \
path:lib/libavcodec.dylib:ffmpeg
+#The support for ffmpeg3 is kept is a variant, as it implies some
+#regressions (no deinterlace).
+#See https://git.reviewboard.kde.org/r/126992/ for an attempt to port the code,
+#but it is based on later git code, and for Qt5.
+variant ffmpeg3 description "Update code to comply with functions of ffmpeg > 2.8" {
+ patchfiles-append patch-deprecated.diff \
+ patch-nodeinterlace.diff
+}
+
pre-activate {
#Deactivate hack for when kdemultimedia4 port has been fragmented into small ports
if {[file exists ${prefix}/lib/kde4/ffmpegthumbs.so]
Added: trunk/dports/kde/ffmpegthumbs/files/patch-deprecated.diff
===================================================================
--- trunk/dports/kde/ffmpegthumbs/files/patch-deprecated.diff (rev 0)
+++ trunk/dports/kde/ffmpegthumbs/files/patch-deprecated.diff 2016-03-03 16:27:16 UTC (rev 146293)
@@ -0,0 +1,65 @@
+diff -ur ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.cpp ./ffmpegthumbnailer/moviedecoder.cpp
+--- ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.cpp 2014-08-16 06:04:31.000000000 +0900
++++ ./ffmpegthumbnailer/moviedecoder.cpp 2016-03-03 01:30:47.000000000 +0900
+@@ -67,7 +67,7 @@
+ }
+
+ initializeVideo();
+- m_pFrame = avcodec_alloc_frame();
++ m_pFrame = av_frame_alloc();
+
+ if (m_pFrame) {
+ m_initialized=true;
+@@ -239,7 +239,7 @@
+ return false;
+ }
+
+- avcodec_get_frame_defaults(m_pFrame);
++ av_frame_unref(m_pFrame);
+
+ int frameFinished = 0;
+
+@@ -291,7 +291,7 @@
+ }
+
+ 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 +302,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,
+@@ -355,9 +355,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<quint8*>(av_malloc(numBytes));
+diff -ur ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.h ./ffmpegthumbnailer/moviedecoder.h
+--- ../ffmpegthumbs-4.14.3-orig/ffmpegthumbnailer/moviedecoder.h 2014-08-16 06:04:31.000000000 +0900
++++ ./ffmpegthumbnailer/moviedecoder.h 2016-03-03 01:24:37.000000000 +0900
+@@ -52,8 +52,8 @@
+
+ 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);
+
+ private:
Added: trunk/dports/kde/ffmpegthumbs/files/patch-nodeinterlace.diff
===================================================================
--- trunk/dports/kde/ffmpegthumbs/files/patch-nodeinterlace.diff (rev 0)
+++ trunk/dports/kde/ffmpegthumbs/files/patch-nodeinterlace.diff 2016-03-03 16:27:16 UTC (rev 146293)
@@ -0,0 +1,17 @@
+--- ffmpegthumbnailer/moviedecoder.cpp.orig 2014-08-16 06:04:31.000000000 +0900
++++ ffmpegthumbnailer/moviedecoder.cpp 2016-03-03 01:37:23.000000000 +0900
+@@ -285,10 +285,10 @@
+
+ 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,
+- m_pVideoCodecContext->width, m_pVideoCodecContext->height);
+- }
++// if (m_pFrame->interlaced_frame) {
++// avpicture_deinterlace((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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160303/a85927f9/attachment.html>
More information about the macports-changes
mailing list