From 82f0a2f8f3f4546023239bcf79b3b759afad1890 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Tue, 22 Feb 2022 16:57:22 +0100 Subject: [PATCH] qmplay2: rebuild with ffmpeg5 --- .../qmplay2/patches/qmplay2-21.12.24.patchset | 73 +++++++++++++++++-- media-video/qmplay2/qmplay2-21.12.24.recipe | 13 ++-- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/media-video/qmplay2/patches/qmplay2-21.12.24.patchset b/media-video/qmplay2/patches/qmplay2-21.12.24.patchset index 790c9b12d..1c983a459 100644 --- a/media-video/qmplay2/patches/qmplay2-21.12.24.patchset +++ b/media-video/qmplay2/patches/qmplay2-21.12.24.patchset @@ -1,4 +1,4 @@ -From 7bd1b2f5bb03eb0569ae1e2d00b83cb6beac2a19 Mon Sep 17 00:00:00 2001 +From b8f87b0bf8795dbf815311f825a7f9f6ca5f42ff Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 18 Dec 2021 21:36:25 +1000 Subject: Add haiku support @@ -71,7 +71,7 @@ index 1360cba..73d4cd8 100644 return 0; } diff --git a/src/gui/MainWidget.cpp b/src/gui/MainWidget.cpp -index 884e1e5..dd223bf 100644 +index 7aa180a..a50e01c 100644 --- a/src/gui/MainWidget.cpp +++ b/src/gui/MainWidget.cpp @@ -150,7 +150,7 @@ MainWidget::MainWidget(QList> &arguments) @@ -746,7 +746,7 @@ index bac1b16..2bc3175 100644 m_priv->socketNotifier = new QSocketNotifier(m_priv->fd, QSocketNotifier::Read, this); connect(m_priv->socketNotifier, SIGNAL(activated(int)), this, SLOT(socketReadActive())); diff --git a/src/qmplay2/QMPlay2Core.cpp b/src/qmplay2/QMPlay2Core.cpp -index a8e2d65..137e18e 100644 +index 5cf15b9..aacaade 100644 --- a/src/qmplay2/QMPlay2Core.cpp +++ b/src/qmplay2/QMPlay2Core.cpp @@ -45,7 +45,7 @@ @@ -758,7 +758,7 @@ index a8e2d65..137e18e 100644 #include #include #endif -@@ -239,7 +239,7 @@ void QMPlay2CoreClass::init(bool loadModules, bool modulesInSubdirs, const QStri +@@ -243,7 +243,7 @@ void QMPlay2CoreClass::init(bool loadModules, bool modulesInSubdirs, const QStri } else { @@ -767,7 +767,7 @@ index a8e2d65..137e18e 100644 settingsDir = QFileInfo(QSettings(QSettings::IniFormat, QSettings::UserScope, QString()).fileName()).absolutePath() + "/QMPlay2/"; #elif defined(Q_OS_MACOS) settingsDir = Functions::cleanPath(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).value(0)); -@@ -487,6 +487,11 @@ QStringList QMPlay2CoreClass::getModules(const QString &type, int typeLen) const +@@ -491,6 +491,11 @@ QStringList QMPlay2CoreClass::getModules(const QString &type, int typeLen) const #elif defined Q_OS_WIN if (type == "videoWriters") defaultModules << "OpenGL 2" << "DirectDraw"; @@ -839,3 +839,66 @@ index 5659018..63256fa 100644 -- 2.30.2 + +From ec53a2afe9e2e59c2322f591a65894bd2fecadd6 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Tue, 22 Feb 2022 16:52:40 +0100 +Subject: ffmpeg5 build fix + + +diff --git a/src/modules/CUVID/CuvidDec.cpp b/src/modules/CUVID/CuvidDec.cpp +index 65a7b8d..b503ffb 100644 +--- a/src/modules/CUVID/CuvidDec.cpp ++++ b/src/modules/CUVID/CuvidDec.cpp +@@ -431,7 +431,7 @@ bool CuvidDec::open(StreamInfo &streamInfo) + if (streamInfo.codec_type != AVMEDIA_TYPE_VIDEO) + return false; + +- AVCodec *avCodec = avcodec_find_decoder_by_name(streamInfo.codec_name); ++ auto avCodec = const_cast(avcodec_find_decoder_by_name(streamInfo.codec_name)); + if (!avCodec) + return false; + +diff --git a/src/modules/CUVID/CuvidDec.hpp b/src/modules/CUVID/CuvidDec.hpp +index 972cbb5..6f7dc68 100644 +--- a/src/modules/CUVID/CuvidDec.hpp ++++ b/src/modules/CUVID/CuvidDec.hpp +@@ -26,6 +26,9 @@ + #include + #include + ++extern "C" { ++ #include ++} + class CuvidHWInterop; + class VideoWriter; + +diff --git a/src/modules/FFmpeg/FFDec.cpp b/src/modules/FFmpeg/FFDec.cpp +index 0b2dae2..571465a 100644 +--- a/src/modules/FFmpeg/FFDec.cpp ++++ b/src/modules/FFmpeg/FFDec.cpp +@@ -70,7 +70,7 @@ void FFDec::clearFrames() + + AVCodec *FFDec::init(StreamInfo &streamInfo) + { +- AVCodec *codec = avcodec_find_decoder_by_name(streamInfo.codec_name); ++ auto codec = const_cast(avcodec_find_decoder_by_name(streamInfo.codec_name)); + if (codec) + { + codec_ctx = avcodec_alloc_context3(codec); +diff --git a/src/modules/FFmpeg/FormatContext.cpp b/src/modules/FFmpeg/FormatContext.cpp +index 0996f9a..c241e7b 100644 +--- a/src/modules/FFmpeg/FormatContext.cpp ++++ b/src/modules/FFmpeg/FormatContext.cpp +@@ -687,7 +687,7 @@ bool FormatContext::open(const QString &_url, const QString ¶m) + if (scheme != "rtsp") + { + // It is needed for QMPlay2 schemes like "alsa://", "v4l2://", etc. +- inputFmt = av_find_input_format(scheme); ++ inputFmt = const_cast(av_find_input_format(scheme)); + if (inputFmt) + url = _url.right(_url.length() - scheme.length() - 3); + } +-- +2.30.2 + diff --git a/media-video/qmplay2/qmplay2-21.12.24.recipe b/media-video/qmplay2/qmplay2-21.12.24.recipe index d0ad0e0a2..f92c93b1f 100644 --- a/media-video/qmplay2/qmplay2-21.12.24.recipe +++ b/media-video/qmplay2/qmplay2-21.12.24.recipe @@ -6,7 +6,7 @@ MyFreeMP3 browser." HOMEPAGE="http://zaps166.sourceforge.net" COPYRIGHT="2010-2021 Błażej Szczygieł" LICENSE="GNU GPL v3" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/zaps166/QMPlay2/archive/$portVersion.tar.gz" CHECKSUM_SHA256="6fd7ff7eda4173f5467cc3dffbff26ce0b8a05b325db4531fd6000c9c05df958" SOURCE_DIR="QMPlay2-$portVersion" @@ -40,6 +40,7 @@ REQUIRES=" lib:libQt5Gui$secondaryArchSuffix lib:libQt5Widgets$secondaryArchSuffix lib:libsidplayfp$secondaryArchSuffix + lib:libstdc++$secondaryArchSuffix lib:libswresample$secondaryArchSuffix lib:libswscale$secondaryArchSuffix lib:libtag$secondaryArchSuffix @@ -49,9 +50,9 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libass$secondaryArchSuffix - devel:libavcodec$secondaryArchSuffix - devel:libavformat$secondaryArchSuffix - devel:libavutil$secondaryArchSuffix + devel:libavcodec$secondaryArchSuffix >= 59 + devel:libavformat$secondaryArchSuffix >= 59 + devel:libavutil$secondaryArchSuffix >= 57 devel:libcddb$secondaryArchSuffix devel:libcdio$secondaryArchSuffix >= 19 devel:libgme$secondaryArchSuffix @@ -61,8 +62,8 @@ BUILD_REQUIRES=" devel:libQt5Gui$secondaryArchSuffix devel:libQt5Widgets$secondaryArchSuffix devel:libsidplayfp$secondaryArchSuffix - devel:libswresample$secondaryArchSuffix - devel:libswscale$secondaryArchSuffix + devel:libswresample$secondaryArchSuffix >= 4 + devel:libswscale$secondaryArchSuffix >= 6 devel:libtag$secondaryArchSuffix devel:libz$secondaryArchSuffix "