diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2022-10-10 18:45:33 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2022-10-11 07:00:35 +0200 |
commit | 1af8dbc03d5185cb3d39c77677adbddadf86a05a (patch) | |
tree | c2509e377966d85492664291169635fdad65187f /source | |
parent | be4ce9e049b2e9e456da6a279d08ededc705b936 (diff) | |
download | current-1af8dbc03d5185cb3d39c77677adbddadf86a05a.tar.gz current-1af8dbc03d5185cb3d39c77677adbddadf86a05a.tar.xz |
Mon Oct 10 18:45:33 UTC 202220221010184533
ap/diffstat-1.65-x86_64-1.txz: Upgraded.
ap/moc-2.6_alpha3-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
kde/attica-5.99.0-x86_64-1.txz: Upgraded.
kde/baloo-5.99.0-x86_64-1.txz: Upgraded.
kde/bluez-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/breeze-icons-5.99.0-noarch-1.txz: Upgraded.
kde/digikam-7.8.0-x86_64-3.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
kde/extra-cmake-modules-5.99.0-x86_64-1.txz: Upgraded.
kde/ffmpegthumbs-22.08.1-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
kde/frameworkintegration-5.99.0-x86_64-1.txz: Upgraded.
kde/kactivities-5.99.0-x86_64-1.txz: Upgraded.
kde/kactivities-stats-5.99.0-x86_64-1.txz: Upgraded.
kde/kapidox-5.99.0-x86_64-1.txz: Upgraded.
kde/karchive-5.99.0-x86_64-1.txz: Upgraded.
kde/kauth-5.99.0-x86_64-1.txz: Upgraded.
kde/kbookmarks-5.99.0-x86_64-1.txz: Upgraded.
kde/kcalendarcore-5.99.0-x86_64-1.txz: Upgraded.
kde/kcmutils-5.99.0-x86_64-1.txz: Upgraded.
kde/kcodecs-5.99.0-x86_64-1.txz: Upgraded.
kde/kcompletion-5.99.0-x86_64-1.txz: Upgraded.
kde/kconfig-5.99.0-x86_64-1.txz: Upgraded.
kde/kconfigwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kcontacts-5.99.0-x86_64-1.txz: Upgraded.
kde/kcoreaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kcrash-5.99.0-x86_64-1.txz: Upgraded.
kde/kdav-5.99.0-x86_64-1.txz: Upgraded.
kde/kdbusaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kdeclarative-5.99.0-x86_64-1.txz: Upgraded.
kde/kded-5.99.0-x86_64-1.txz: Upgraded.
kde/kdelibs4support-5.99.0-x86_64-1.txz: Upgraded.
kde/kdesignerplugin-5.99.0-x86_64-1.txz: Upgraded.
kde/kdesu-5.99.0-x86_64-1.txz: Upgraded.
kde/kdewebkit-5.99.0-x86_64-1.txz: Upgraded.
kde/kdnssd-5.99.0-x86_64-1.txz: Upgraded.
kde/kdoctools-5.99.0-x86_64-1.txz: Upgraded.
kde/kemoticons-5.99.0-x86_64-1.txz: Upgraded.
kde/kfilemetadata-5.99.0-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
kde/kglobalaccel-5.99.0-x86_64-1.txz: Upgraded.
kde/kguiaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kholidays-5.99.0-x86_64-1.txz: Upgraded.
kde/khtml-5.99.0-x86_64-1.txz: Upgraded.
kde/ki18n-5.99.0-x86_64-1.txz: Upgraded.
kde/kiconthemes-5.99.0-x86_64-1.txz: Upgraded.
kde/kidletime-5.99.0-x86_64-1.txz: Upgraded.
kde/kimageformats-5.99.0-x86_64-1.txz: Upgraded.
kde/kinit-5.99.0-x86_64-1.txz: Upgraded.
kde/kio-5.99.0-x86_64-1.txz: Upgraded.
kde/kirigami2-5.99.0-x86_64-1.txz: Upgraded.
kde/kitemmodels-5.99.0-x86_64-1.txz: Upgraded.
kde/kitemviews-5.99.0-x86_64-1.txz: Upgraded.
kde/kjobwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kjs-5.99.0-x86_64-1.txz: Upgraded.
kde/kjsembed-5.99.0-x86_64-1.txz: Upgraded.
kde/kmediaplayer-5.99.0-x86_64-1.txz: Upgraded.
kde/knewstuff-5.99.0-x86_64-1.txz: Upgraded.
kde/knotifications-5.99.0-x86_64-1.txz: Upgraded.
kde/knotifyconfig-5.99.0-x86_64-1.txz: Upgraded.
kde/kpackage-5.99.0-x86_64-1.txz: Upgraded.
kde/kparts-5.99.0-x86_64-1.txz: Upgraded.
kde/kpeople-5.99.0-x86_64-1.txz: Upgraded.
kde/kplotting-5.99.0-x86_64-1.txz: Upgraded.
kde/kpty-5.99.0-x86_64-1.txz: Upgraded.
kde/kquickcharts-5.99.0-x86_64-1.txz: Upgraded.
kde/kross-5.99.0-x86_64-1.txz: Upgraded.
kde/krunner-5.99.0-x86_64-1.txz: Upgraded.
kde/kservice-5.99.0-x86_64-1.txz: Upgraded.
kde/ktexteditor-5.99.0-x86_64-1.txz: Upgraded.
kde/ktextwidgets-5.99.0-x86_64-1.txz: Upgraded.
kde/kunitconversion-5.99.0-x86_64-1.txz: Upgraded.
kde/kwallet-5.99.0-x86_64-1.txz: Upgraded.
kde/kwayland-5.99.0-x86_64-1.txz: Upgraded.
kde/kwidgetsaddons-5.99.0-x86_64-1.txz: Upgraded.
kde/kwindowsystem-5.99.0-x86_64-1.txz: Upgraded.
kde/kxmlgui-5.99.0-x86_64-1.txz: Upgraded.
kde/kxmlrpcclient-5.99.0-x86_64-1.txz: Upgraded.
kde/modemmanager-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/networkmanager-qt-5.99.0-x86_64-1.txz: Upgraded.
kde/oxygen-icons5-5.99.0-noarch-1.txz: Upgraded.
kde/plasma-framework-5.99.0-x86_64-1.txz: Upgraded.
kde/prison-5.99.0-x86_64-1.txz: Upgraded.
kde/purpose-5.99.0-x86_64-1.txz: Upgraded.
kde/qqc2-desktop-style-5.99.0-x86_64-1.txz: Upgraded.
kde/solid-5.99.0-x86_64-1.txz: Upgraded.
kde/sonnet-5.99.0-x86_64-1.txz: Upgraded.
kde/syndication-5.99.0-x86_64-1.txz: Upgraded.
kde/syntax-highlighting-5.99.0-x86_64-1.txz: Upgraded.
kde/threadweaver-5.99.0-x86_64-1.txz: Upgraded.
l/QtAV-20220226_fdc613dc-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
l/alsa-plugins-1.2.7.1-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/ffmpeg-5.1.2-x86_64-1.txz: Upgraded.
Shared library .so-version bump.
Enabled glslang and vulkan. Thanks to Heinz Wiesinger.
l/gegl-0.4.38-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/gst-plugins-libav-1.20.3-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/harfbuzz-5.3.0-x86_64-1.txz: Upgraded.
l/imagemagick-7.1.0_50-x86_64-1.txz: Upgraded.
l/libvncserver-0.9.13-x86_64-4.txz: Rebuilt.
Disabled ffmpeg support (not compatible with ffmpeg5).
l/mlt-7.8.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/opencv-4.6.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/pcre2-10.40-x86_64-2.txz: Rebuilt.
Moved shared libraries into /lib${LIBDIRSUFFIX}. Thanks to TommyC7.
l/pipewire-0.3.59-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
l/qt5-5.15.6_20220928_06b700dd-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
n/libgpg-error-1.46-x86_64-2.txz: Rebuilt.
Rebuilt with --enable-install-gpg-error-config to fix regression building
gpgme. Thanks to nobodino and ponce.
x/libva-utils-2.16.0-x86_64-1.txz: Upgraded.
x/wayland-protocols-1.27-noarch-1.txz: Upgraded.
xap/MPlayer-20221009-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
xap/audacious-plugins-4.2-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/ffmpegthumbnailer-2.2.2-x86_64-4.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/freerdp-2.8.0-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
xap/ssr-0.4.4-x86_64-1.txz: Upgraded.
Compiled against ffmpeg-5.1.2.
xap/xine-lib-1.2.12-x86_64-2.txz: Rebuilt.
Recompiled against ffmpeg-5.1.2.
Diffstat (limited to 'source')
48 files changed, 2349 insertions, 72 deletions
diff --git a/source/ap/diffstat/diffstat.SlackBuild b/source/ap/diffstat/diffstat.SlackBuild index 0b27a6c05..fa5c4428e 100755 --- a/source/ap/diffstat/diffstat.SlackBuild +++ b/source/ap/diffstat/diffstat.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=diffstat VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/ap/moc/0005-avcodec-include.patch b/source/ap/moc/0005-avcodec-include.patch new file mode 100644 index 000000000..5606df445 --- /dev/null +++ b/source/ap/moc/0005-avcodec-include.patch @@ -0,0 +1,25 @@ +From d75ef5832592c796b45018e81c939c375c1326b4 Mon Sep 17 00:00:00 2001 +From: John Fitzgerald <mocmaint@daper.net> +Date: Sat, 25 Jun 2022 13:15:37 +0300 +Subject: [PATCH 1/3] avcodec include + +Signed-off-by: Elimar Riesebieter <riesebie@lxtec.de> +--- + decoder_plugins/ffmpeg/ffmpeg.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/decoder_plugins/ffmpeg/ffmpeg.c b/decoder_plugins/ffmpeg/ffmpeg.c +index c043b5a..f5ea484 100644 +--- a/decoder_plugins/ffmpeg/ffmpeg.c ++++ b/decoder_plugins/ffmpeg/ffmpeg.c +@@ -32,6 +32,7 @@ + #include <stdint.h> + #include <errno.h> + ++#include <libavcodec/avcodec.h> + #include <libavformat/avformat.h> + #include <libavutil/mathematics.h> + #if HAVE_LIBAVUTIL_CHANNEL_LAYOUT_H +-- +2.36.1 + diff --git a/source/ap/moc/0006-uncast-warnings.patch b/source/ap/moc/0006-uncast-warnings.patch new file mode 100644 index 000000000..204742058 --- /dev/null +++ b/source/ap/moc/0006-uncast-warnings.patch @@ -0,0 +1,44 @@ +From 27fa391c6b3361ef781dbf0a045445ceabfaa07f Mon Sep 17 00:00:00 2001 +From: John Fitzgerald <mocmaint@daper.net> +Date: Sat, 25 Jun 2022 13:18:08 +0300 +Subject: [PATCH 2/3] uncast warnings + +Signed-off-by: Elimar Riesebieter <riesebie@lxtec.de> +--- + decoder_plugins/ffmpeg/ffmpeg.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/decoder_plugins/ffmpeg/ffmpeg.c b/decoder_plugins/ffmpeg/ffmpeg.c +index f5ea484..fd4582f 100644 +--- a/decoder_plugins/ffmpeg/ffmpeg.c ++++ b/decoder_plugins/ffmpeg/ffmpeg.c +@@ -79,7 +79,7 @@ struct ffmpeg_data + AVIOContext *pb; + AVStream *stream; + AVCodecContext *enc; +- AVCodec *codec; ++ const AVCodec *codec; + + char *remain_buf; + int remain_buf_len; +@@ -848,7 +848,7 @@ static int ffmpeg_can_decode (struct io_stream *stream) + { + int res; + AVProbeData probe_data; +- AVInputFormat *fmt; ++ const AVInputFormat *fmt; + char buf[8096 + AVPROBE_PADDING_SIZE] = {0}; + + res = io_peek (stream, buf, sizeof (buf)); +@@ -1411,7 +1411,7 @@ static int ffmpeg_our_format_ext (const char *ext) + + static int ffmpeg_our_format_mime (const char *mime_type) + { +- AVOutputFormat *fmt; ++ const AVOutputFormat *fmt; + + fmt = av_guess_format (NULL, NULL, mime_type); + return fmt ? 1 : 0; +-- +2.36.1 + diff --git a/source/ap/moc/0007-cur-dts.patch b/source/ap/moc/0007-cur-dts.patch new file mode 100644 index 000000000..cf65c5084 --- /dev/null +++ b/source/ap/moc/0007-cur-dts.patch @@ -0,0 +1,39 @@ +From dba3b4262b6187f688152126b4ca743f88e93c82 Mon Sep 17 00:00:00 2001 +From: John Fitzgerald <mocmaint@daper.net> +Date: Sat, 25 Jun 2022 13:20:46 +0300 +Subject: [PATCH 3/3] cur dts + +Signed-off-by: Elimar Riesebieter <riesebie@lxtec.de> +--- + decoder_plugins/ffmpeg/ffmpeg.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/decoder_plugins/ffmpeg/ffmpeg.c b/decoder_plugins/ffmpeg/ffmpeg.c +index fd4582f..64afe04 100644 +--- a/decoder_plugins/ffmpeg/ffmpeg.c ++++ b/decoder_plugins/ffmpeg/ffmpeg.c +@@ -1172,7 +1172,7 @@ static bool seek_in_stream (struct ffmpeg_data *data) + static bool seek_in_stream (struct ffmpeg_data *data, int sec) + #endif + { +- int rc, flags = AVSEEK_FLAG_ANY; ++ int rc; + int64_t seek_ts; + + #if SEEK_IN_DECODER +@@ -1198,10 +1198,8 @@ static bool seek_in_stream (struct ffmpeg_data *data, int sec) + seek_ts += data->stream->start_time; + } + +- if (data->stream->cur_dts > seek_ts) +- flags |= AVSEEK_FLAG_BACKWARD; +- +- rc = av_seek_frame (data->ic, data->stream->index, seek_ts, flags); ++ rc = av_seek_frame (data->ic, data->stream->index, seek_ts, ++ AVSEEK_FLAG_BACKWARD); + if (rc < 0) { + log_errno ("Seek error", rc); + return false; +-- +2.36.1 + diff --git a/source/ap/moc/moc-ffmpeg4.patch b/source/ap/moc/moc-ffmpeg4.patch deleted file mode 100644 index c1e43a7c2..000000000 --- a/source/ap/moc/moc-ffmpeg4.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: decoder_plugins/ffmpeg/ffmpeg.c -=================================================================== ---- decoder_plugins/ffmpeg/ffmpeg.c (revisión: 2963) -+++ decoder_plugins/ffmpeg/ffmpeg.c (copia de trabajo) -@@ -697,7 +697,7 @@ - * FFmpeg/LibAV in use. For some versions this will be caught in - * *_find_stream_info() above and misreported as an unfound codec - * parameters error. */ -- if (data->codec->capabilities & CODEC_CAP_EXPERIMENTAL) { -+ if (data->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) { - decoder_error (&data->error, ERROR_FATAL, 0, - "The codec is experimental and may damage MOC: %s", - data->codec->name); -@@ -705,8 +705,8 @@ - } - - set_downmixing (data); -- if (data->codec->capabilities & CODEC_CAP_TRUNCATED) -- data->enc->flags |= CODEC_FLAG_TRUNCATED; -+ if (data->codec->capabilities & AV_CODEC_CAP_TRUNCATED) -+ data->enc->flags |= AV_CODEC_FLAG_TRUNCATED; - - if (avcodec_open2 (data->enc, data->codec, NULL) < 0) - { -@@ -725,7 +725,7 @@ - - data->sample_width = sfmt_Bps (data->fmt); - -- if (data->codec->capabilities & CODEC_CAP_DELAY) -+ if (data->codec->capabilities & AV_CODEC_CAP_DELAY) - data->delay = true; - data->seek_broken = is_seek_broken (data); - data->timing_broken = is_timing_broken (data->ic); diff --git a/source/ap/moc/moc.SlackBuild b/source/ap/moc/moc.SlackBuild index 547687838..af49333e7 100755 --- a/source/ap/moc/moc.SlackBuild +++ b/source/ap/moc/moc.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2011, 2013, 2018, 2019 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2011, 2013, 2018, 2019, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=moc VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | rev | cut -f 2- -d -)} -BUILD=${BUILD:-8} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -78,9 +78,18 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ -zcat $CWD/moc-ffmpeg4.patch.gz | patch -p0 --verbose || exit 1 +zcat $CWD/0005-avcodec-include.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/0006-uncast-warnings.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/0007-cur-dts.patch.gz | patch -p1 --verbose || exit 1 # Configure: +if [ ! -r configure ]; then + if [ -x ./autogen.sh ]; then + NOCONFIGURE=1 ./autogen.sh + else + autoreconf -vif + fi +fi CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ diff --git a/source/ap/moc/svn-checkout.sh b/source/ap/moc/svn-checkout.sh new file mode 100755 index 000000000..a2f9a8084 --- /dev/null +++ b/source/ap/moc/svn-checkout.sh @@ -0,0 +1,14 @@ +# Clear the download area: +rm -rf moc + +svn checkout svn://svn.daper.net/moc/trunk moc + +( cd moc && find -name "\.svn" -type d -print0 | xargs -0 rm -rf ) + +# Tar it up: +VERSION="$(grep PROJECT_NUMBER moc/Doxyfile | cut -f 2 -d = | tr -d ' ' | tr - _)" +mv moc moc-${VERSION} +tar cf moc-${VERSION}.tar moc-${VERSION} +rm -f moc-${VERSION}.tar.lz +plzip -9 moc-${VERSION}.tar +rm -r moc-${VERSION} diff --git a/source/kde/kde/build/digikam b/source/kde/kde/build/digikam index 0cfbf0888..00750edc0 100644 --- a/source/kde/kde/build/digikam +++ b/source/kde/kde/build/digikam @@ -1 +1 @@ -2 +3 diff --git a/source/kde/kde/build/ffmpegthumbs b/source/kde/kde/build/ffmpegthumbs index d00491fd7..0cfbf0888 100644 --- a/source/kde/kde/build/ffmpegthumbs +++ b/source/kde/kde/build/ffmpegthumbs @@ -1 +1 @@ -1 +2 diff --git a/source/kde/kde/build/kfilemetadata b/source/kde/kde/build/kfilemetadata index 0cfbf0888..d00491fd7 100644 --- a/source/kde/kde/build/kfilemetadata +++ b/source/kde/kde/build/kfilemetadata @@ -1 +1 @@ -2 +1 diff --git a/source/kde/kde/patch/digikam.patch b/source/kde/kde/patch/digikam.patch new file mode 100644 index 000000000..89b423ada --- /dev/null +++ b/source/kde/kde/patch/digikam.patch @@ -0,0 +1 @@ +cat $CWD/patch/digikam/ffmpeg5.patch | patch -p1 --verbose || { touch ${SLACK_KDE_BUILD_DIR}/${PKGNAME}.failed ; continue ; } diff --git a/source/kde/kde/patch/digikam/ffmpeg5.patch b/source/kde/kde/patch/digikam/ffmpeg5.patch new file mode 100644 index 000000000..cbdd368b3 --- /dev/null +++ b/source/kde/kde/patch/digikam/ffmpeg5.patch @@ -0,0 +1,13 @@ +diff --git a/core/libs/threadimageio/video/videodecoder_p.h b/core/libs/threadimageio/video/videodecoder_p.h +index 251e092809..d82926b77e 100644 +--- a/core/libs/threadimageio/video/videodecoder_p.h ++++ b/core/libs/threadimageio/video/videodecoder_p.h +@@ -56,7 +56,7 @@ public: + AVFormatContext* pFormatContext; + AVCodecContext* pVideoCodecContext; + AVCodecParameters* pVideoCodecParameters; +- AVCodec* pVideoCodec; ++ const AVCodec* pVideoCodec; + AVStream* pVideoStream; + AVFrame* pFrame; + quint8* pFrameBuffer; diff --git a/source/l/FTBFSlog b/source/l/FTBFSlog index 5e9e89edb..98f4a837c 100644 --- a/source/l/FTBFSlog +++ b/source/l/FTBFSlog @@ -1,3 +1,6 @@ +Sun Oct 9 20:08:52 UTC 2022 + clucene: add #include <ctime>. Thanks to nobodino. ++--------------------------+ Tue Apr 12 00:21:44 UTC 2022 babl: fix to build with meson 0.62.0. Thanks to nobodino. +--------------------------+ diff --git a/source/l/QtAV/QtAV.SlackBuild b/source/l/QtAV/QtAV.SlackBuild index c393ee9ad..aab178574 100755 --- a/source/l/QtAV/QtAV.SlackBuild +++ b/source/l/QtAV/QtAV.SlackBuild @@ -86,6 +86,8 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +zcat $CWD/ffmpeg5.patch.gz | patch -p1 --verbose || exit 1 + export CFLAGS="$SLKCFLAGS" export CXXFLAGS="$SLKCFLAGS" export LDFLAGS="$SLKLDFLAGS" diff --git a/source/l/QtAV/ffmpeg5.patch b/source/l/QtAV/ffmpeg5.patch new file mode 100644 index 000000000..53e60b8ff --- /dev/null +++ b/source/l/QtAV/ffmpeg5.patch @@ -0,0 +1,947 @@ +diff --git a/src/AVCompat.cpp b/src/AVCompat.cpp +index befb3cd9..cf113f03 100644 +--- a/src/AVCompat.cpp ++++ b/src/AVCompat.cpp +@@ -391,7 +391,7 @@ const char *get_codec_long_name(enum AVCodecID id) + if (cd) + return cd->long_name; + av_log(NULL, AV_LOG_WARNING, "Codec 0x%x is not in the full list.\n", id); +- AVCodec *codec = avcodec_find_decoder(id); ++ const AVCodec *codec = avcodec_find_decoder(id); + if (codec) + return codec->long_name; + codec = avcodec_find_encoder(id); +diff --git a/src/AVDemuxer.cpp b/src/AVDemuxer.cpp +index 432c4f04..5b46afd3 100644 +--- a/src/AVDemuxer.cpp ++++ b/src/AVDemuxer.cpp +@@ -290,7 +290,7 @@ public: + //copy the info, not parse the file when constructed, then need member vars + QString file; + QString file_orig; +- AVInputFormat *input_format; ++ const AVInputFormat *input_format; + QString format_forced; + MediaIO *input; + +@@ -310,7 +310,11 @@ public: + // wanted_stream is REQUIRED. e.g. always set -1 to indicate the default stream, -2 to disable + int stream, wanted_stream; // -1 default, selected by ff + int index, wanted_index; // index in a kind of streams ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx; ++#else ++ AVCodecParameters *avctx; ++#endif + } StreamInfo; + StreamInfo astream, vstream, sstream; + +@@ -614,12 +618,14 @@ bool AVDemuxer::seek(qint64 pos) + if (upos <= startTime()) { + qDebug("************seek to beginning. started = false"); + d->started = false; //??? ++#if LIBAVCODEC_VERSION_MAJOR < 59 + if (d->astream.avctx) + d->astream.avctx->frame_number = 0; + if (d->vstream.avctx) + d->vstream.avctx->frame_number = 0; //TODO: why frame_number not changed after seek? + if (d->sstream.avctx) + d->sstream.avctx->frame_number = 0; ++#endif + } + return true; + } +@@ -1062,37 +1068,61 @@ QList<int> AVDemuxer::subtitleStreams() const + return d->subtitle_streams; + } + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext* AVDemuxer::audioCodecContext(int stream) const ++#else ++AVCodecParameters* AVDemuxer::audioCodecContext(int stream) const ++#endif + { + if (stream < 0) + return d->astream.avctx; + if (stream > (int)d->format_ctx->nb_streams) + return 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = d->format_ctx->streams[stream]->codec; ++#else ++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar; ++#endif + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) + return avctx; + return 0; + } + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext* AVDemuxer::videoCodecContext(int stream) const ++#else ++AVCodecParameters* AVDemuxer::videoCodecContext(int stream) const ++#endif + { + if (stream < 0) + return d->vstream.avctx; + if (stream > (int)d->format_ctx->nb_streams) + return 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = d->format_ctx->streams[stream]->codec; ++#else ++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar; ++#endif + if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) + return avctx; + return 0; + } + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext* AVDemuxer::subtitleCodecContext(int stream) const ++#else ++AVCodecParameters* AVDemuxer::subtitleCodecContext(int stream) const ++#endif + { + if (stream < 0) + return d->sstream.avctx; + if (stream > (int)d->format_ctx->nb_streams) + return 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = d->format_ctx->streams[stream]->codec; ++#else ++ AVCodecParameters *avctx = d->format_ctx->streams[stream]->codecpar; ++#endif + if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) + return avctx; + return 0; +@@ -1289,7 +1319,11 @@ bool AVDemuxer::Private::setStream(AVDemuxer::StreamType st, int streamValue) + // don't touch wanted index + si->stream = s; + si->wanted_stream = streamValue; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + si->avctx = format_ctx->streams[s]->codec; ++#else ++ si->avctx = format_ctx->streams[s]->codecpar; ++#endif + has_attached_pic = !!(format_ctx->streams[s]->disposition & AV_DISPOSITION_ATTACHED_PIC); + return true; + } +@@ -1302,7 +1336,11 @@ bool AVDemuxer::Private::prepareStreams() + return false; + AVMediaType type = AVMEDIA_TYPE_UNKNOWN; + for (unsigned int i = 0; i < format_ctx->nb_streams; ++i) { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + type = format_ctx->streams[i]->codec->codec_type; ++#else ++ type = format_ctx->streams[i]->codecpar->codec_type; ++#endif + if (type == AVMEDIA_TYPE_VIDEO) { + video_streams.push_back(i); + } else if (type == AVMEDIA_TYPE_AUDIO) { +diff --git a/src/AVMuxer.cpp b/src/AVMuxer.cpp +index b601afd8..4ff1463e 100644 +--- a/src/AVMuxer.cpp ++++ b/src/AVMuxer.cpp +@@ -81,7 +81,7 @@ public: + //copy the info, not parse the file when constructed, then need member vars + QString file; + QString file_orig; +- AVOutputFormat *format; ++ const AVOutputFormat *format; + QString format_forced; + MediaIO *io; + +@@ -94,7 +94,7 @@ public: + + AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codecName, AVCodecID codecId) + { +- AVCodec *codec = NULL; ++ const AVCodec *codec = NULL; + if (!codecName.isEmpty()) { + codec = avcodec_find_encoder_by_name(codecName.toUtf8().constData()); + if (!codec) { +@@ -120,7 +120,8 @@ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codec + // set by avformat if unset + s->id = ctx->nb_streams - 1; + s->time_base = kTB; +- AVCodecContext *c = s->codec; ++#if LIBAVCODEC_VERSION_MAJOR < 59 ++ AVCodec *c = s->codec; + c->codec_id = codec->id; + // Using codec->time_base is deprecated, but needed for older lavf. + c->time_base = s->time_base; +@@ -129,6 +130,7 @@ AVStream *AVMuxer::Private::addStream(AVFormatContext* ctx, const QString &codec + c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + // expose avctx to encoder and set properties in encoder? + // list codecs for a given format in ui ++#endif + return s; + } + +@@ -137,16 +139,24 @@ bool AVMuxer::Private::prepareStreams() + audio_streams.clear(); + video_streams.clear(); + subtitle_streams.clear(); +- AVOutputFormat* fmt = format_ctx->oformat; ++ const AVOutputFormat* fmt = format_ctx->oformat; + if (venc) { + AVStream *s = addStream(format_ctx, venc->codecName(), fmt->video_codec); + if (s) { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *c = s->codec; ++#else ++ AVCodecParameters *c = s->codecpar; ++#endif + c->bit_rate = venc->bitRate(); + c->width = venc->width(); + c->height = venc->height(); + /// MUST set after encoder is open to ensure format is valid and the same ++#if LIBAVCODEC_VERSION_MAJOR < 59 + c->pix_fmt = (AVPixelFormat)VideoFormat::pixelFormatToFFmpeg(venc->pixelFormat()); ++#else ++ c->format = (AVPixelFormat)VideoFormat::pixelFormatToFFmpeg(venc->pixelFormat()); ++#endif + + // Set avg_frame_rate based on encoder frame_rate + s->avg_frame_rate = av_d2q(venc->frameRate(), venc->frameRate()*1001.0+2); +@@ -157,11 +167,19 @@ bool AVMuxer::Private::prepareStreams() + if (aenc) { + AVStream *s = addStream(format_ctx, aenc->codecName(), fmt->audio_codec); + if (s) { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *c = s->codec; ++#else ++ AVCodecParameters *c = s->codecpar; ++#endif + c->bit_rate = aenc->bitRate(); + /// MUST set after encoder is open to ensure format is valid and the same + c->sample_rate = aenc->audioFormat().sampleRate(); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + c->sample_fmt = (AVSampleFormat)aenc->audioFormat().sampleFormatFFmpeg(); ++#else ++ c->format = (AVSampleFormat)aenc->audioFormat().sampleFormatFFmpeg(); ++#endif + c->channel_layout = aenc->audioFormat().channelLayoutFFmpeg(); + c->channels = aenc->audioFormat().channels(); + c->bits_per_raw_sample = aenc->audioFormat().bytesPerSample()*8; // need?? +diff --git a/src/AVPlayerPrivate.cpp b/src/AVPlayerPrivate.cpp +index 84f079ef..d3bf09f1 100644 +--- a/src/AVPlayerPrivate.cpp ++++ b/src/AVPlayerPrivate.cpp +@@ -55,7 +55,11 @@ int computeNotifyPrecision(qint64 duration, qreal fps) + } + } // namespace Internal + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + static bool correct_audio_channels(AVCodecContext *ctx) { ++#else ++static bool correct_audio_channels(AVCodecParameters *ctx) { ++#endif + if (ctx->channels <= 0) { + if (ctx->channel_layout) { + ctx->channels = av_get_channel_layout_nb_channels(ctx->channel_layout); +@@ -251,7 +255,11 @@ void AVPlayer::Private::initBaseStatistics() + updateNotifyInterval(); + } + ++#if LIBAVCODEC_VERSION_MAJOR < 59 + void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCodecContext *avctx) ++#else ++void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCodecParameters *avctx) ++#endif + { + AVFormatContext *fmt_ctx = demuxer.formatContext(); + if (!fmt_ctx) { +@@ -288,7 +296,11 @@ void AVPlayer::Private::initCommonStatistics(int s, Statistics::Common *st, AVCo + + void AVPlayer::Private::initAudioStatistics(int s) + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = demuxer.audioCodecContext(); ++#else ++ AVCodecParameters *avctx = demuxer.audioCodecContext(); ++#endif + statistics.audio = Statistics::Common(); + statistics.audio_only = Statistics::AudioOnly(); + if (!avctx) +@@ -306,14 +318,22 @@ void AVPlayer::Private::initAudioStatistics(int s) + // nb_channels -1: will use av_get_channel_layout_nb_channels + av_get_channel_layout_string(cl, sizeof(cl), avctx->channels, avctx->channel_layout); + statistics.audio_only.channel_layout = QLatin1String(cl); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + statistics.audio_only.sample_fmt = QLatin1String(av_get_sample_fmt_name(avctx->sample_fmt)); ++#else ++ statistics.audio_only.sample_fmt = QLatin1String(av_get_sample_fmt_name(static_cast<AVSampleFormat>(avctx->format))); ++#endif + statistics.audio_only.frame_size = avctx->frame_size; + statistics.audio_only.sample_rate = avctx->sample_rate; + } + + void AVPlayer::Private::initVideoStatistics(int s) + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = demuxer.videoCodecContext(); ++#else ++ AVCodecParameters *avctx = demuxer.videoCodecContext(); ++#endif + statistics.video = Statistics::Common(); + statistics.video_only = Statistics::VideoOnly(); + if (!avctx) +@@ -324,10 +344,20 @@ void AVPlayer::Private::initVideoStatistics(int s) + statistics.video.decoder = vdec->name(); + statistics.video.decoder_detail = vdec->description(); + } ++#if LIBAVCODEC_VERSION_MAJOR < 59 + statistics.video_only.coded_height = avctx->coded_height; + statistics.video_only.coded_width = avctx->coded_width; + statistics.video_only.gop_size = avctx->gop_size; + statistics.video_only.pix_fmt = QLatin1String(av_get_pix_fmt_name(avctx->pix_fmt)); ++#else ++ // FIXME we can't really get coded_height, coded_width and gop_size from Parameters ++ // At some point we should make an effort to get the real codec context; in the mean ++ // time, this should be close enough... ++ statistics.video_only.coded_height = avctx->height; ++ statistics.video_only.coded_width = avctx->width; ++ statistics.video_only.gop_size = 0; ++ statistics.video_only.pix_fmt = QLatin1String(av_get_pix_fmt_name(static_cast<AVPixelFormat>(avctx->format))); ++#endif + statistics.video_only.height = avctx->height; + statistics.video_only.width = avctx->width; + statistics.video_only.rotate = 0; +@@ -354,7 +384,11 @@ bool AVPlayer::Private::setupAudioThread(AVPlayer *player) + athread->setDecoder(0); + athread->setOutput(0); + } ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = ademuxer->audioCodecContext(); ++#else ++ AVCodecParameters *avctx = ademuxer->audioCodecContext(); ++#endif + if (!avctx) { + // TODO: close ao? //TODO: check pulseaudio perapp control if closed + return false; +@@ -384,7 +418,11 @@ bool AVPlayer::Private::setupAudioThread(AVPlayer *player) + correct_audio_channels(avctx); + AudioFormat af; + af.setSampleRate(avctx->sample_rate); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + af.setSampleFormatFFmpeg(avctx->sample_fmt); ++#else ++ af.setSampleFormatFFmpeg(avctx->format); ++#endif + af.setChannelLayoutFFmpeg(avctx->channel_layout); + if (!af.isValid()) { + qWarning("invalid audio format. audio stream will be disabled"); +@@ -466,7 +504,11 @@ QVariantList AVPlayer::Private::getTracksInfo(AVDemuxer *demuxer, AVDemuxer::Str + t[QStringLiteral("stream_index")] = QVariant(s); + + AVStream *stream = demuxer->formatContext()->streams[s]; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *ctx = stream->codec; ++#else ++ AVCodecParameters *ctx = stream->codecpar; ++#endif + if (ctx) { + t[QStringLiteral("codec")] = QByteArray(avcodec_descriptor_get(ctx->codec_id)->name); + if (ctx->extradata) +@@ -494,7 +536,11 @@ bool AVPlayer::Private::applySubtitleStream(int n, AVPlayer *player) + { + if (!demuxer.setStreamIndex(AVDemuxer::SubtitleStream, n)) + return false; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *ctx = demuxer.subtitleCodecContext(); ++#else ++ AVCodecParameters *ctx = demuxer.subtitleCodecContext(); ++#endif + if (!ctx) + return false; + // FIXME: AVCodecDescriptor.name and AVCodec.name are different! +@@ -512,7 +558,11 @@ bool AVPlayer::Private::tryApplyDecoderPriority(AVPlayer *player) + // TODO: add an option to apply the new decoder even if not available + qint64 pos = player->position(); + VideoDecoder *vd = NULL; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = demuxer.videoCodecContext(); ++#else ++ AVCodecParameters *avctx = demuxer.videoCodecContext(); ++#endif + foreach(VideoDecoderId vid, vc_ids) { + qDebug("**********trying video decoder: %s...", VideoDecoder::name(vid)); + vd = VideoDecoder::create(vid); +@@ -560,7 +610,11 @@ bool AVPlayer::Private::setupVideoThread(AVPlayer *player) + vthread->packetQueue()->clear(); + vthread->setDecoder(0); + } ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *avctx = demuxer.videoCodecContext(); ++#else ++ AVCodecParameters *avctx = demuxer.videoCodecContext(); ++#endif + if (!avctx) { + return false; + } +diff --git a/src/AVPlayerPrivate.h b/src/AVPlayerPrivate.h +index e404b9bf..f0f90fd1 100644 +--- a/src/AVPlayerPrivate.h ++++ b/src/AVPlayerPrivate.h +@@ -29,6 +29,10 @@ + #include "AVDemuxThread.h" + #include "utils/Logger.h" + ++extern "C" { ++#include <libavcodec/avcodec.h> ++} ++ + namespace QtAV { + + static const qint64 kInvalidPosition = std::numeric_limits<qint64>::max(); +@@ -43,7 +47,11 @@ public: + void applyFrameRate(); + void initStatistics(); + void initBaseStatistics(); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + void initCommonStatistics(int s, Statistics::Common* st, AVCodecContext* avctx); ++#else ++ void initCommonStatistics(int s, Statistics::Common* st, AVCodecParameters* avctx); ++#endif + void initAudioStatistics(int s); + void initVideoStatistics(int s); + void initSubtitleStatistics(int s); +diff --git a/src/QtAV/AVDemuxer.h b/src/QtAV/AVDemuxer.h +index 3b720f5d..688c82f9 100644 +--- a/src/QtAV/AVDemuxer.h ++++ b/src/QtAV/AVDemuxer.h +@@ -28,6 +28,10 @@ + #include <QtCore/QObject> + #include <QtCore/QScopedPointer> + ++extern "C" { ++#include <libavcodec/avcodec.h> ++} ++ + struct AVFormatContext; + struct AVCodecContext; + QT_BEGIN_NAMESPACE +@@ -151,9 +155,15 @@ public: + int subtitleStream() const; + QList<int> subtitleStreams() const; + //codec. stream < 0: the stream going to play (or the stream set by setStreamIndex()) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext* audioCodecContext(int stream = -1) const; + AVCodecContext* videoCodecContext(int stream = -1) const; + AVCodecContext* subtitleCodecContext(int stream = -1) const; ++#else ++ AVCodecParameters* audioCodecContext(int stream = -1) const; ++ AVCodecParameters* videoCodecContext(int stream = -1) const; ++ AVCodecParameters* subtitleCodecContext(int stream = -1) const; ++#endif + /** + * @brief getInterruptTimeout return the interrupt timeout + */ +diff --git a/src/QtAV/private/AVDecoder_p.h b/src/QtAV/private/AVDecoder_p.h +index 2382974e..5e952ea8 100644 +--- a/src/QtAV/private/AVDecoder_p.h ++++ b/src/QtAV/private/AVDecoder_p.h +@@ -78,7 +78,7 @@ class Q_AV_PRIVATE_EXPORT AVDecoderPrivate : public DPtrPrivate<AVDecoder> + { + public: + static const char* getProfileName(AVCodecID id, int profile) { +- AVCodec *c = avcodec_find_decoder(id); ++ const AVCodec *c = avcodec_find_decoder(id); + if (!c) + return "Unknow"; + return av_get_profile_name(c, profile); +diff --git a/src/VideoFormat.cpp b/src/VideoFormat.cpp +index b9c7b4f0..5e7901f1 100644 +--- a/src/VideoFormat.cpp ++++ b/src/VideoFormat.cpp +@@ -702,7 +702,11 @@ bool VideoFormat::hasPalette() const + + bool VideoFormat::isPseudoPaletted() const + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + return (d->flags() & AV_PIX_FMT_FLAG_PSEUDOPAL) == AV_PIX_FMT_FLAG_PSEUDOPAL; ++#else ++ return hasPalette(); ++#endif + } + + bool VideoFormat::isBitStream() const +diff --git a/src/VideoFrameExtractor.cpp b/src/VideoFrameExtractor.cpp +index 8e4a843e..ecaa079e 100644 +--- a/src/VideoFrameExtractor.cpp ++++ b/src/VideoFrameExtractor.cpp +@@ -192,7 +192,11 @@ public: + if (!vd) + continue; + decoder.reset(vd); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *cctx = demuxer.videoCodecContext(); ++#else ++ AVCodecParameters *cctx = demuxer.videoCodecContext(); ++#endif + if (cctx) decoder->setCodecContext(demuxer.videoCodecContext()); + if (!cctx || !decoder->open()) { + decoder.reset(0); +diff --git a/src/codec/AVDecoder.cpp b/src/codec/AVDecoder.cpp +index 440504d0..bc9cc278 100644 +--- a/src/codec/AVDecoder.cpp ++++ b/src/codec/AVDecoder.cpp +@@ -27,7 +27,7 @@ + + namespace QtAV { + +-static AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid) ++static const AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid) + { + QString fullname(name); + if (name.isEmpty()) { +@@ -35,7 +35,7 @@ static AVCodec* get_codec(const QString &name, const QString& hwa, AVCodecID cid + return avcodec_find_decoder(cid); + fullname = QString("%1_%2").arg(avcodec_get_name(cid)).arg(hwa); + } +- AVCodec *codec = avcodec_find_decoder_by_name(fullname.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_decoder_by_name(fullname.toUtf8().constData()); + if (codec) + return codec; + const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(fullname.toUtf8().constData()); +@@ -76,7 +76,7 @@ bool AVDecoder::open() + return false; + } + const QString hwa = property("hwaccel").toString(); +- AVCodec* codec = get_codec(codecName(), hwa, d.codec_ctx->codec_id); ++ const AVCodec* codec = get_codec(codecName(), hwa, d.codec_ctx->codec_id); + if (!codec) { // TODO: can be null for none-ffmpeg based decoders + QString es(tr("No codec could be found for '%1'")); + if (d.codec_name.isEmpty()) { +@@ -153,6 +153,8 @@ void AVDecoder::flush() + avcodec_flush_buffers(d_func().codec_ctx); + } + ++static QMap<AVCodecParameters*,AVCodecContext*> ccs; ++ + /* + * do nothing if equal + * close the old one. the codec context can not be shared in more than 1 decoder. +@@ -160,9 +162,17 @@ void AVDecoder::flush() + void AVDecoder::setCodecContext(void *codecCtx) + { + DPTR_D(AVDecoder); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AVCodecContext *ctx = (AVCodecContext*)codecCtx; +- if (d.codec_ctx == ctx) ++ if (d.codec_ctx == codecCtx) + return; ++#else ++ AVCodecParameters *ctx = (AVCodecParameters*)codecCtx; ++ if(ccs.contains(ctx)) { ++ d.codec_ctx = ccs.value(ctx); ++ return; ++ } ++#endif + if (isOpen()) { + qWarning("Can not copy codec properties when it's open"); + close(); // +@@ -180,7 +190,12 @@ void AVDecoder::setCodecContext(void *codecCtx) + qWarning("avcodec_alloc_context3 failed"); + return; + } ++ ccs.insert(ctx, d.codec_ctx); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AV_ENSURE_OK(avcodec_copy_context(d.codec_ctx, ctx)); ++#else ++ AV_ENSURE_OK(avcodec_parameters_to_context(d.codec_ctx, ctx)); ++#endif + } + + //TODO: reset other parameters? +diff --git a/src/codec/AVEncoder.cpp b/src/codec/AVEncoder.cpp +index 455539c7..5be64db2 100644 +--- a/src/codec/AVEncoder.cpp ++++ b/src/codec/AVEncoder.cpp +@@ -146,7 +146,13 @@ void AVEncoder::copyAVCodecContext(void* ctx) + AVCodecContext* c = static_cast<AVCodecContext*>(ctx); + if (d.avctx) { + // dest should be avcodec_alloc_context3(NULL) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + AV_ENSURE_OK(avcodec_copy_context(d.avctx, c)); ++#else ++ AVCodecParameters *par; ++ avcodec_parameters_from_context(par, c); ++ AV_ENSURE_OK(avcodec_parameters_to_context(d.avctx, par)); ++#endif + d.is_open = false; + return; + } +diff --git a/src/codec/audio/AudioDecoderFFmpeg.cpp b/src/codec/audio/AudioDecoderFFmpeg.cpp +index d783588a..7c5188fc 100644 +--- a/src/codec/audio/AudioDecoderFFmpeg.cpp ++++ b/src/codec/audio/AudioDecoderFFmpeg.cpp +@@ -100,10 +100,34 @@ bool AudioDecoderFFmpeg::decode(const Packet &packet) + av_init_packet(&eofpkt); + eofpkt.data = NULL; + eofpkt.size = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt); ++#else ++ ret = avcodec_receive_frame(d.codec_ctx, d.frame); ++ if (ret == AVERROR(EAGAIN)) ++ return false; ++ else if (ret < 0) { ++ qWarning("[AudioDecoder] %s", av_err2str(ret)); ++ return false; ++ } ++ got_frame_ptr = (ret == 0); ++ ret = avcodec_send_packet(d.codec_ctx, &eofpkt); ++#endif + } else { + // const AVPacket*: ffmpeg >= 1.0. no libav ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ret = avcodec_decode_audio4(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket()); ++#else ++ ret = avcodec_receive_frame(d.codec_ctx, d.frame); ++ if (ret == AVERROR(EAGAIN)) ++ return false; ++ else if (ret < 0) { ++ qWarning("[AudioDecoder] %s", av_err2str(ret)); ++ return false; ++ } ++ got_frame_ptr = (ret == 0); ++ ret = avcodec_send_packet(d.codec_ctx, (AVPacket*)packet.asAVPacket()); ++#endif + } + d.undecoded_size = qMin(packet.data.size() - ret, packet.data.size()); + if (ret == AVERROR(EAGAIN)) { +@@ -145,7 +169,11 @@ AudioFrame AudioDecoderFFmpeg::frame() + f.setBytesPerLine(d.frame->linesize[0], 0); // for correct alignment + f.setSamplesPerChannel(d.frame->nb_samples); + // TODO: ffplay check AVFrame.pts, pkt_pts, last_pts+nb_samples. move to AudioFrame::from(AVFrame*) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + f.setTimestamp((double)d.frame->pkt_pts/1000.0); ++#else ++ f.setTimestamp((double)d.frame->pts/1000.0); ++#endif + f.setAudioResampler(d.resampler); // TODO: remove. it's not safe if frame is shared. use a pool or detach if ref >1 + return f; + } +diff --git a/src/codec/audio/AudioEncoderFFmpeg.cpp b/src/codec/audio/AudioEncoderFFmpeg.cpp +index 3811e11a..c338aae3 100644 +--- a/src/codec/audio/AudioEncoderFFmpeg.cpp ++++ b/src/codec/audio/AudioEncoderFFmpeg.cpp +@@ -54,7 +54,9 @@ public: + AudioEncoderFFmpegPrivate() + : AudioEncoderPrivate() + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + avcodec_register_all(); ++#endif + // NULL: codec-specific defaults won't be initialized, which may result in suboptimal default settings (this is important mainly for encoders, e.g. libx264). + avctx = avcodec_alloc_context3(NULL); + } +@@ -68,11 +70,11 @@ bool AudioEncoderFFmpegPrivate::open() + { + if (codec_name.isEmpty()) { + // copy ctx from muxer by copyAVCodecContext +- AVCodec *codec = avcodec_find_encoder(avctx->codec_id); ++ const AVCodec *codec = avcodec_find_encoder(avctx->codec_id); + AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false); + return true; + } +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if (!codec) { + const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(codec_name.toUtf8().constData()); + if (cd) { +@@ -204,7 +206,13 @@ bool AudioEncoderFFmpeg::encode(const AudioFrame &frame) + pkt.data = (uint8_t*)d.buffer.constData(); //NULL + pkt.size = d.buffer.size(); //0 + int got_packet = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + int ret = avcodec_encode_audio2(d.avctx, &pkt, f, &got_packet); ++#else ++ int ret = avcodec_send_frame(d.avctx, f); ++ got_packet = (ret == 0); ++ ret = avcodec_receive_packet(d.avctx, &pkt); ++#endif + av_frame_free(&f); + if (ret < 0) { + //qWarning("error avcodec_encode_audio2: %s" ,av_err2str(ret)); +diff --git a/src/codec/video/VideoDecoderCUDA.cpp b/src/codec/video/VideoDecoderCUDA.cpp +index 844a3ae6..8015b4f9 100644 +--- a/src/codec/video/VideoDecoderCUDA.cpp ++++ b/src/codec/video/VideoDecoderCUDA.cpp +@@ -46,6 +46,10 @@ + #include "utils/Logger.h" + #include "SurfaceInteropCUDA.h" + ++extern "C" { ++#include <libavcodec/bsf.h> ++} ++ + //decode error if not floating context + + namespace QtAV { +@@ -184,7 +188,7 @@ public: + } + ~VideoDecoderCUDAPrivate() { + if (bsf) +- av_bitstream_filter_close(bsf); ++ av_bsf_free(&bsf); + if (!can_load) + return; + if (!isLoaded()) //cuda_api +@@ -320,7 +324,7 @@ public: + int nb_dec_surface; + QString description; + +- AVBitStreamFilterContext *bsf; //TODO: rename bsf_ctx ++ AVBSFContext *bsf; //TODO: rename bsf_ctx + + VideoDecoderCUDA::CopyMode copy_mode; + cuda::InteropResourcePtr interop_res; //may be still used in video frames when decoder is destroyed +@@ -391,9 +395,7 @@ bool VideoDecoderCUDA::decode(const Packet &packet) + if (d.bsf) { + // h264_mp4toannexb_filter does not use last parameter 'keyFrame', so just set 0 + //return: 0: not changed, no outBuf allocated. >0: ok. <0: fail +- filtered = av_bitstream_filter_filter(d.bsf, d.codec_ctx, NULL, &outBuf, &outBufSize +- , (const uint8_t*)packet.data.constData(), packet.data.size() +- , 0);//d.is_keyframe); ++ filtered = av_bsf_receive_packet(d.bsf, (AVPacket*)packet.asAVPacket());//d.is_keyframe); + //qDebug("%s @%d filtered=%d outBuf=%p, outBufSize=%d", __FUNCTION__, __LINE__, filtered, outBuf, outBufSize); + if (filtered < 0) { + qDebug("failed to filter: %s", av_err2str(filtered)); +@@ -780,15 +782,17 @@ void VideoDecoderCUDAPrivate::setBSF(AVCodecID codec) + { + if (codec == QTAV_CODEC_ID(H264)) { + if (!bsf) +- bsf = av_bitstream_filter_init("h264_mp4toannexb"); ++ av_bsf_alloc(av_bsf_get_by_name("h264_mp4toannexb"), &bsf); ++ av_bsf_init(bsf); + Q_ASSERT(bsf && "h264_mp4toannexb bsf not found"); + } else if (codec == QTAV_CODEC_ID(HEVC)) { + if (!bsf) +- bsf = av_bitstream_filter_init("hevc_mp4toannexb"); ++ av_bsf_alloc(av_bsf_get_by_name("hevc_mp4toannexb"), &bsf); ++ av_bsf_init(bsf); + Q_ASSERT(bsf && "hevc_mp4toannexb bsf not found"); + } else { + if (bsf) { +- av_bitstream_filter_close(bsf); ++ av_bsf_free(&bsf); + bsf = 0; + } + } +diff --git a/src/codec/video/VideoDecoderFFmpegBase.cpp b/src/codec/video/VideoDecoderFFmpegBase.cpp +index e344c5cb..49cebb94 100644 +--- a/src/codec/video/VideoDecoderFFmpegBase.cpp ++++ b/src/codec/video/VideoDecoderFFmpegBase.cpp +@@ -30,12 +30,21 @@ extern ColorRange colorRangeFromFFmpeg(AVColorRange cr); + + static void SetColorDetailsByFFmpeg(VideoFrame *f, AVFrame* frame, AVCodecContext* codec_ctx) + { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ColorSpace cs = colorSpaceFromFFmpeg(av_frame_get_colorspace(frame)); + if (cs == ColorSpace_Unknown) ++#else ++ ColorSpace ++#endif + cs = colorSpaceFromFFmpeg(codec_ctx->colorspace); + f->setColorSpace(cs); ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ColorRange cr = colorRangeFromFFmpeg(av_frame_get_color_range(frame)); + if (cr == ColorRange_Unknown) { ++#else ++ ColorRange cr; ++ if (1) { ++#endif + // check yuvj format. TODO: deprecated, check only for old ffmpeg? + const AVPixelFormat pixfmt = (AVPixelFormat)frame->format; + switch (pixfmt) { +@@ -125,9 +134,21 @@ bool VideoDecoderFFmpegBase::decode(const Packet &packet) + av_init_packet(&eofpkt); + eofpkt.data = NULL; + eofpkt.size = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, &eofpkt); ++#else ++ ret = avcodec_receive_frame(d.codec_ctx, d.frame); ++ got_frame_ptr = (ret == 0); ++ ret = avcodec_send_packet(d.codec_ctx, &eofpkt); ++#endif + } else { ++#if LIBAVCODEC_VERSION_MAJOR < 59 + ret = avcodec_decode_video2(d.codec_ctx, d.frame, &got_frame_ptr, (AVPacket*)packet.asAVPacket()); ++#else ++ ret = avcodec_receive_frame(d.codec_ctx, d.frame); ++ got_frame_ptr = (ret == 0); ++ ret = avcodec_send_packet(d.codec_ctx, (AVPacket*)packet.asAVPacket()); ++#endif + } + //qDebug("pic_type=%c", av_get_picture_type_char(d.frame->pict_type)); + d.undecoded_size = qMin(packet.data.size() - ret, packet.data.size()); +@@ -159,7 +180,11 @@ VideoFrame VideoDecoderFFmpegBase::frame() + frame.setBits(d.frame->data); + frame.setBytesPerLine(d.frame->linesize); + // in s. TODO: what about AVFrame.pts? av_frame_get_best_effort_timestamp? move to VideoFrame::from(AVFrame*) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + frame.setTimestamp((double)d.frame->pkt_pts/1000.0); ++#else ++ frame.setTimestamp((double)d.frame->pts/1000.0); ++#endif + frame.setMetaData(QStringLiteral("avbuf"), QVariant::fromValue(AVFrameBuffersRef(new AVFrameBuffers(d.frame)))); + d.updateColorDetails(&frame); + if (frame.format().hasPalette()) { +diff --git a/src/codec/video/VideoDecoderFFmpegHW.cpp b/src/codec/video/VideoDecoderFFmpegHW.cpp +index c17c8b28..17d663e6 100644 +--- a/src/codec/video/VideoDecoderFFmpegHW.cpp ++++ b/src/codec/video/VideoDecoderFFmpegHW.cpp +@@ -328,7 +328,11 @@ VideoFrame VideoDecoderFFmpegHW::copyToFrame(const VideoFormat& fmt, int surface + // TODO: buffer pool and create VideoFrame when needed to avoid copy? also for other va + frame = frame.clone(); + } ++#if LIBAVCODEC_VERSION_MAJOR < 59 + frame.setTimestamp(double(d.frame->pkt_pts)/1000.0); ++#else ++ frame.setTimestamp(double(d.frame->pts)/1000.0); ++#endif + frame.setDisplayAspectRatio(d.getDAR(d.frame)); + d.updateColorDetails(&frame); + return frame; +diff --git a/src/codec/video/VideoDecoderVAAPI.cpp b/src/codec/video/VideoDecoderVAAPI.cpp +index a91caf92..0c8ce016 100644 +--- a/src/codec/video/VideoDecoderVAAPI.cpp ++++ b/src/codec/video/VideoDecoderVAAPI.cpp +@@ -27,9 +27,11 @@ + #include <QtCore/QMetaEnum> + #include <QtCore/QStringList> + #include <QtCore/QThread> ++#if LIBAVCODEC_VERSION_MAJOR < 59 + extern "C" { + #include <libavcodec/vaapi.h> + } ++#endif + #include "QtAV/private/AVCompat.h" + #include "QtAV/private/factory.h" + #include "vaapi/SurfaceInteropVAAPI.h" +@@ -84,7 +86,7 @@ FACTORY_REGISTER(VideoDecoder, VAAPI, "VAAPI") + + const char* getProfileName(AVCodecID id, int profile) + { +- AVCodec *c = avcodec_find_decoder(id); ++ const AVCodec *c = avcodec_find_decoder(id); + if (!c) + return "Unknow"; + return av_get_profile_name(c, profile); +diff --git a/src/codec/video/VideoEncoderFFmpeg.cpp b/src/codec/video/VideoEncoderFFmpeg.cpp +index c0c902cb..a352c533 100644 +--- a/src/codec/video/VideoEncoderFFmpeg.cpp ++++ b/src/codec/video/VideoEncoderFFmpeg.cpp +@@ -116,11 +116,11 @@ bool VideoEncoderFFmpegPrivate::open() + nb_encoded = 0LL; + if (codec_name.isEmpty()) { + // copy ctx from muxer by copyAVCodecContext +- AVCodec *codec = avcodec_find_encoder(avctx->codec_id); ++ const AVCodec *codec = avcodec_find_encoder(avctx->codec_id); + AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false); + return true; + } +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if (!codec) { + const AVCodecDescriptor* cd = avcodec_descriptor_get_by_name(codec_name.toUtf8().constData()); + if (cd) { +@@ -247,7 +247,7 @@ bool VideoEncoderFFmpegPrivate::open() + applyOptionsForContext(); + AV_ENSURE_OK(avcodec_open2(avctx, codec, &dict), false); + // from mpv ao_lavc +- const int buffer_size = qMax<int>(qMax<int>(width*height*6+200, AV_INPUT_BUFFER_MIN_SIZE), sizeof(AVPicture));//?? ++ const int buffer_size = qMax<int>(qMax<int>(width*height*6+200, AV_INPUT_BUFFER_MIN_SIZE), av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1));//?? + buffer.resize(buffer_size); + return true; + } +@@ -373,7 +373,13 @@ bool VideoEncoderFFmpeg::encode(const VideoFrame &frame) + pkt.data = (uint8_t*)d.buffer.constData(); + pkt.size = d.buffer.size(); + int got_packet = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + int ret = avcodec_encode_video2(d.avctx, &pkt, f.data(), &got_packet); ++#else ++ int ret = avcodec_send_frame(d.avctx, f.data()); ++ got_packet = (ret == 0); ++ ret = avcodec_receive_packet(d.avctx, &pkt); ++#endif + if (ret < 0) { + qWarning("error avcodec_encode_video2: %s" ,av_err2str(ret)); + return false; //false +diff --git a/src/filter/LibAVFilter.cpp b/src/filter/LibAVFilter.cpp +index 8993a91f..d770ddc3 100644 +--- a/src/filter/LibAVFilter.cpp ++++ b/src/filter/LibAVFilter.cpp +@@ -84,7 +84,9 @@ public: + filter_graph = 0; + in_filter_ctx = 0; + out_filter_ctx = 0; ++#if LIBAVCODEC_VERSION_MAJOR < 59 + avfilter_register_all(); ++#endif + #endif //QTAV_HAVE(AVFILTER) + } + ~Private() { +@@ -204,7 +206,9 @@ QString LibAVFilter::filterDescription(const QString &filterName) + { + QString s; + #if QTAV_HAVE(AVFILTER) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + avfilter_register_all(); ++#endif + const AVFilter *f = avfilter_get_by_name(filterName.toUtf8().constData()); + if (!f) + return s; +@@ -283,11 +287,18 @@ QStringList LibAVFilter::registeredFilters(int type) + { + QStringList filters; + #if QTAV_HAVE(AVFILTER) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + avfilter_register_all(); ++#endif + const AVFilter* f = NULL; + AVFilterPad* fp = NULL; // no const in avfilter_pad_get_name() for ffmpeg<=1.2 libav<=9 + #if AV_MODULE_CHECK(LIBAVFILTER, 3, 8, 0, 53, 100) ++#if LIBAVCODEC_VERSION_MAJOR < 59 + while ((f = avfilter_next(f))) { ++#else ++ void** ff = NULL; ++ while (f = av_filter_iterate(ff)) { ++#endif + #else + AVFilter** ff = NULL; + while ((ff = av_filter_next(ff)) && *ff) { +diff --git a/src/subtitle/SubtitleProcessorFFmpeg.cpp b/src/subtitle/SubtitleProcessorFFmpeg.cpp +index 83e53e7c..50ccc31e 100644 +--- a/src/subtitle/SubtitleProcessorFFmpeg.cpp ++++ b/src/subtitle/SubtitleProcessorFFmpeg.cpp +@@ -249,7 +249,7 @@ bool SubtitleProcessorFFmpeg::processHeader(const QByteArray &codec, const QByte + if (codec_ctx) { + avcodec_free_context(&codec_ctx); + } +- AVCodec *c = avcodec_find_decoder_by_name(codec.constData()); ++ const AVCodec *c = avcodec_find_decoder_by_name(codec.constData()); + if (!c) { + qDebug("subtitle avcodec_descriptor_get_by_name %s", codec.constData()); + const AVCodecDescriptor *desc = avcodec_descriptor_get_by_name(codec.constData()); +@@ -370,8 +370,15 @@ bool SubtitleProcessorFFmpeg::processSubtitle() + qWarning("no subtitle stream found"); + return false; + } ++#if LIBAVCODEC_VERSION_MAJOR < 59 + codec_ctx = m_reader.subtitleCodecContext(); +- AVCodec *dec = avcodec_find_decoder(codec_ctx->codec_id); ++ const AVCodec *dec = avcodec_find_decoder(codec_ctx->codec_id); ++#else ++ AVCodecParameters *par = m_reader.subtitleCodecContext(); ++ const AVCodec *dec = avcodec_find_decoder(par->codec_id); ++ codec_ctx = avcodec_alloc_context3(dec); ++ avcodec_parameters_to_context(codec_ctx, par); ++#endif + const AVCodecDescriptor *dec_desc = avcodec_descriptor_get(codec_ctx->codec_id); + if (!dec) { + if (dec_desc) diff --git a/source/l/alsa-plugins/alsa-plugins.SlackBuild b/source/l/alsa-plugins/alsa-plugins.SlackBuild index 96b3bb654..f349bca92 100755 --- a/source/l/alsa-plugins/alsa-plugins.SlackBuild +++ b/source/l/alsa-plugins/alsa-plugins.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=alsa-plugins VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} diff --git a/source/l/clucene/clucene.SlackBuild b/source/l/clucene/clucene.SlackBuild index f616dc495..cb2b42a0c 100755 --- a/source/l/clucene/clucene.SlackBuild +++ b/source/l/clucene/clucene.SlackBuild @@ -86,6 +86,9 @@ zcat $CWD/clucene.pkgconfig.patch.gz | patch -p1 --verbose || exit 1 # Fix contrib-libs installation: zcat $CWD/clucene.install_contribs_lib.diff.gz | patch -p1 --verbose || exit 1 +# Fix FTBFS: +zcat $CWD/clucene.ctime.diff.gz | patch -p1 --verbose || exit 1 + chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ diff --git a/source/l/clucene/clucene.ctime.diff b/source/l/clucene/clucene.ctime.diff new file mode 100644 index 000000000..408895fe6 --- /dev/null +++ b/source/l/clucene/clucene.ctime.diff @@ -0,0 +1,10 @@ +--- ./src/core/CLucene/document/DateTools.cpp.orig 2011-03-16 19:21:07.000000000 -0500 ++++ ./src/core/CLucene/document/DateTools.cpp 2022-10-09 15:08:11.827250428 -0500 +@@ -8,6 +8,7 @@ + + #include "DateTools.h" + #include "CLucene/util/Misc.h" ++#include <ctime> + + CL_NS_USE(util) + CL_NS_DEF(document) diff --git a/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch b/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch new file mode 100644 index 000000000..20ea725da --- /dev/null +++ b/source/l/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch @@ -0,0 +1,31 @@ +diff '--color=auto' -rupN ffmpeg.orig/libavformat/avformat.h ffmpeg/libavformat/avformat.h +--- ffmpeg.orig/libavformat/avformat.h 2022-08-19 17:42:47.323422603 +0200 ++++ ffmpeg/libavformat/avformat.h 2022-08-19 17:42:51.347130436 +0200 +@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_g + */ + int64_t av_stream_get_end_pts(const AVStream *st); + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st); ++// Chromium: We use the internal field first_dts ^^^ ++ + #define AV_PROGRAM_RUNNING 1 + + /** +diff '--color=auto' -rupN ffmpeg.orig/libavformat/mux_utils.c ffmpeg/libavformat/mux_utils.c +--- ffmpeg.orig/libavformat/mux_utils.c 2022-08-19 17:42:47.346758108 +0200 ++++ ffmpeg/libavformat/mux_utils.c 2022-08-19 17:47:28.549589002 +0200 +@@ -37,6 +37,13 @@ int64_t av_stream_get_end_pts(const AVSt + return AV_NOPTS_VALUE; + } + ++// Chromium: We use the internal field first_dts vvv ++int64_t av_stream_get_first_dts(const AVStream *st) ++{ ++ return cffstream(st)->first_dts; ++} ++// Chromium: We use the internal field first_dts ^^^ ++ + int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, + int std_compliance) + { diff --git a/source/l/ffmpeg/ffmpeg.SlackBuild b/source/l/ffmpeg/ffmpeg.SlackBuild index 49bfcc602..c4c89d998 100755 --- a/source/l/ffmpeg/ffmpeg.SlackBuild +++ b/source/l/ffmpeg/ffmpeg.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for ffmpeg # Copyright 2010-2017 Heinz Wiesinger, Amsterdam, The Netherlands -# Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2017, 2018, 2022 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -46,10 +46,10 @@ PKG=$TMP/package-$PKGNAM NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" + SLKCFLAGS="-O2 -march=i586 -mtune=i686 -fPIC" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" + SLKCFLAGS="-O2 -march=i686 -mtune=i686 -fPIC" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" @@ -131,8 +131,6 @@ ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \ decklink="" ; [ "${DECKLINK:-no}" != "no" ] && \ { decklink="--enable-decklink" ; \ SLKCFLAGS="$SLKCFLAGS -I/usr/include/decklink" ; } -vulkan="" ; [ "${VULKAN:-no}" != "no" ] && vulkan="--enable-vulkan" -libglslang="" ; [ "${GLSLANG:-no}" != "no" ] && libglslang="--enable-libglslang" liblensfun="" ; [ "${LENSFUN:-no}" != "no" ] && liblensfun="--enable-liblensfun" # Default enabled features: @@ -163,6 +161,8 @@ libvidstab="" ; [ "${VIDSTAB:-yes}" != "no" ] && libvidstab="--enable-libvid libxml2="" ; [ "${LIBXML2:-yes}" != "no" ] && libxml2="--enable-libxml2" librsvg="" ; [ "${LIBRSVG:-yes}" != "no" ] && librsvg="--enable-librsvg" libdrm="" ; [ "${LIBDRM:-yes}" != "no" ] && libdrm="--enable-libdrm" +libglslang="" ; [ "${GLSLANG:-yes}" != "no" ] && libglslang="--enable-libglslang" +vulkan="" ; [ "${VULKAN:-yes}" != "no" ] && vulkan="--enable-vulkan" # No default patent encumbered features: aac="" ; [ "${AAC:-no}" = "no" ] && aac="--disable-encoder=aac" @@ -181,9 +181,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ -# Fix linking with flite: -sed -i "s| -lflite\"| -lflite -lm -lasound\"|" \ - ./configure +# Restore missing function needed by Chromium and qt-webengine: +zcat $CWD/add-av_stream_get_first_dts-for-chromium.patch.gz | patch -p1 --verbose || exit 1 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -198,7 +197,6 @@ CXXFLAGS="$SLKCFLAGS" \ --disable-static \ --enable-gpl \ --enable-version3 \ - --enable-avresample \ --arch=$ARCH \ $non_free \ $aac \ diff --git a/source/l/gegl/gegl.SlackBuild b/source/l/gegl/gegl.SlackBuild index 673123432..8f17c84aa 100755 --- a/source/l/gegl/gegl.SlackBuild +++ b/source/l/gegl/gegl.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=gegl VERSION=${VERSION:-$(echo gegl-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild b/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild index fce74fbe7..6c06c0622 100755 --- a/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild +++ b/source/l/gst-plugins-libav/gst-plugins-libav.SlackBuild @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=gst-plugins-libav VERSION=${VERSION:-$(echo gst-libav-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/l/harfbuzz/harfbuzz.url b/source/l/harfbuzz/harfbuzz.url index 29ce27a5a..359c726db 100644 --- a/source/l/harfbuzz/harfbuzz.url +++ b/source/l/harfbuzz/harfbuzz.url @@ -1 +1,2 @@ -https://github.com/harfbuzz/harfbuzz/releases +#https://github.com/harfbuzz/harfbuzz/releases +https://github.com/harfbuzz/harfbuzz/tags diff --git a/source/l/imagemagick/imagemagick.url b/source/l/imagemagick/imagemagick.url index 5378667d1..c3266033e 100644 --- a/source/l/imagemagick/imagemagick.url +++ b/source/l/imagemagick/imagemagick.url @@ -1 +1 @@ -https://github.com/ImageMagick/ImageMagick +https://github.com/ImageMagick/ImageMagick/tags diff --git a/source/l/libvncserver/libvncserver.SlackBuild b/source/l/libvncserver/libvncserver.SlackBuild index ea858caf2..082b28d39 100755 --- a/source/l/libvncserver/libvncserver.SlackBuild +++ b/source/l/libvncserver/libvncserver.SlackBuild @@ -28,7 +28,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=libvncserver VERSION=${VERSION:-$(echo LibVNCServer-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} @@ -102,6 +102,7 @@ cd cmake-build -DCMAKE_INSTALL_LIBDIR="lib$LIBDIRSUFFIX" \ -DDOC_INSTALL_DIR="doc" \ -DMAN_INSTALL_DIR=/usr/man \ + -DWITH_FFMPEG=OFF \ .. || exit 1 make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 diff --git a/source/l/mlt/mlt.SlackBuild b/source/l/mlt/mlt.SlackBuild index 66c34e9bd..8a688f399 100755 --- a/source/l/mlt/mlt.SlackBuild +++ b/source/l/mlt/mlt.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=mlt VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch b/source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch new file mode 100644 index 000000000..eb0d193ad --- /dev/null +++ b/source/l/opencv/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch @@ -0,0 +1,20 @@ +From: Jochen Sprickerhof <jspricke@debian.org> +Date: Mon, 8 Aug 2022 21:10:13 +0200 +Subject: Add missing header for LIBAVCODEC_VERSION_INT + +--- + modules/videoio/src/ffmpeg_codecs.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/modules/videoio/src/ffmpeg_codecs.hpp b/modules/videoio/src/ffmpeg_codecs.hpp +index 61788e0..faad259 100644 +--- a/modules/videoio/src/ffmpeg_codecs.hpp ++++ b/modules/videoio/src/ffmpeg_codecs.hpp +@@ -60,6 +60,7 @@ extern "C" { + #include <errno.h> + #endif + ++#include <libavcodec/version.h> + #include <libavformat/avformat.h> + + #ifdef __cplusplus diff --git a/source/l/opencv/opencv.SlackBuild b/source/l/opencv/opencv.SlackBuild index cf8d59f4a..04fea2dd0 100755 --- a/source/l/opencv/opencv.SlackBuild +++ b/source/l/opencv/opencv.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=opencv VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -88,6 +88,8 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +zcat $CWD/0004-Add-missing-header-for-LIBAVCODEC_VERSION_INT.patch.gz | patch -p1 --verbose || exit 1 + # Configure, build, and install: mkdir cmake-build cd cmake-build diff --git a/source/l/pcre2/pcre2.SlackBuild b/source/l/pcre2/pcre2.SlackBuild index 8811c0e4e..07bfdd6b8 100755 --- a/source/l/pcre2/pcre2.SlackBuild +++ b/source/l/pcre2/pcre2.SlackBuild @@ -27,7 +27,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=pcre2 VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -100,6 +100,16 @@ make install DESTDIR=$PKG || exit 1 # Don't ship .la files: rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la +# Move libraries, as they might be needed before /usr is available: +mkdir $PKG/lib${LIBDIRSUFFIX} +( cd $PKG/usr/lib${LIBDIRSUFFIX} + for file in lib*.so.?.* ; do + mv $file ../../lib${LIBDIRSUFFIX} + ln -sf ../../lib${LIBDIRSUFFIX}/$file . + done + cp -a lib*.so.? ../../lib${LIBDIRSUFFIX} +) + find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true diff --git a/source/l/pipewire/fetch-media-session.sh b/source/l/pipewire/fetch-media-session.sh new file mode 100755 index 000000000..bd2e30e58 --- /dev/null +++ b/source/l/pipewire/fetch-media-session.sh @@ -0,0 +1,38 @@ +#!/bin/sh + +# Copyright 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -o errexit + +# Clear download area: +rm -rf media-session media-session.tar media-session.tar.lz + +# Clone repository: +git clone https://gitlab.freedesktop.org/pipewire/media-session.git + +# Cleanup. We're not packing up the whole git repo. +rm -rf media-session/.git* +tar cf media-session.tar media-session +plzip -9 -n 6 -f media-session.tar +rm -rf media-session +echo +echo "media-session source repo packaged" +echo diff --git a/source/l/pipewire/pipewire.SlackBuild b/source/l/pipewire/pipewire.SlackBuild index 940febef9..50a817c2a 100755 --- a/source/l/pipewire/pipewire.SlackBuild +++ b/source/l/pipewire/pipewire.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=pipewire VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -86,6 +86,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Add media-session: +( cd subprojects ; tar xf $CWD/media-session.tar.lz ) + # Configure, build, and install: export CFLAGS="$SLKCFLAGS" export CXXFLAGS="$SLKCFLAGS" diff --git a/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch b/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch new file mode 100644 index 000000000..58e51d0f4 --- /dev/null +++ b/source/l/qt5/patches/qt5-webengine-ffmpeg5.patch @@ -0,0 +1,150 @@ +diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h +index 2734a485cbd..70b1877a43c 100644 +--- a/chromium/media/ffmpeg/ffmpeg_common.h ++++ b/chromium/media/ffmpeg/ffmpeg_common.h +@@ -29,6 +29,7 @@ extern "C" { + #include <libavformat/avformat.h> + #include <libavformat/avio.h> + #include <libavutil/avutil.h> ++#include <libavutil/channel_layout.h> + #include <libavutil/imgutils.h> + #include <libavutil/log.h> + #include <libavutil/mastering_display_metadata.h> +diff --git a/chromium/media/filters/audio_file_reader.cc b/chromium/media/filters/audio_file_reader.cc +index cb81d920def..bd73908d0ca 100644 +--- a/chromium/media/filters/audio_file_reader.cc ++++ b/chromium/media/filters/audio_file_reader.cc +@@ -85,7 +85,7 @@ bool AudioFileReader::OpenDemuxer() { + } + + bool AudioFileReader::OpenDecoder() { +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); + if (codec) { + // MP3 decodes to S16P which we don't support, tell it to use S16 instead. + if (codec_context_->sample_fmt == AV_SAMPLE_FMT_S16P) +diff --git a/chromium/media/filters/ffmpeg_audio_decoder.cc b/chromium/media/filters/ffmpeg_audio_decoder.cc +index 0d825ed791b..72fac6167ef 100644 +--- a/chromium/media/filters/ffmpeg_audio_decoder.cc ++++ b/chromium/media/filters/ffmpeg_audio_decoder.cc +@@ -329,7 +329,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder(const AudioDecoderConfig& config) { + } + } + +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); + if (!codec || + avcodec_open2(codec_context_.get(), codec, &codec_options) < 0) { + DLOG(ERROR) << "Could not initialize audio decoder: " +diff --git a/chromium/media/filters/ffmpeg_demuxer.cc b/chromium/media/filters/ffmpeg_demuxer.cc +index d34db63f3ef..427565b00c1 100644 +--- a/chromium/media/filters/ffmpeg_demuxer.cc ++++ b/chromium/media/filters/ffmpeg_demuxer.cc +@@ -98,12 +98,12 @@ static base::TimeDelta ExtractStartTime(AVStream* stream) { + + // Next try to use the first DTS value, for codecs where we know PTS == DTS + // (excludes all H26x codecs). The start time must be returned in PTS. +- if (stream->first_dts != kNoFFmpegTimestamp && ++ if (av_stream_get_first_dts(stream) != kNoFFmpegTimestamp && + stream->codecpar->codec_id != AV_CODEC_ID_HEVC && + stream->codecpar->codec_id != AV_CODEC_ID_H264 && + stream->codecpar->codec_id != AV_CODEC_ID_MPEG4) { + const base::TimeDelta first_pts = +- ConvertFromTimeBase(stream->time_base, stream->first_dts); ++ ConvertFromTimeBase(stream->time_base, av_stream_get_first_dts(stream)); + if (first_pts < start_time) + start_time = first_pts; + } +@@ -408,11 +408,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { + scoped_refptr<DecoderBuffer> buffer; + + if (type() == DemuxerStream::TEXT) { +- int id_size = 0; ++ size_t id_size = 0; + uint8_t* id_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size); + +- int settings_size = 0; ++ size_t settings_size = 0; + uint8_t* settings_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size); + +@@ -424,7 +424,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { + buffer = DecoderBuffer::CopyFrom(packet->data, packet->size, + side_data.data(), side_data.size()); + } else { +- int side_data_size = 0; ++ size_t side_data_size = 0; + uint8_t* side_data = av_packet_get_side_data( + packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size); + +@@ -485,7 +485,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) { + packet->size - data_offset); + } + +- int skip_samples_size = 0; ++ size_t skip_samples_size = 0; + const uint32_t* skip_samples_ptr = + reinterpret_cast<const uint32_t*>(av_packet_get_side_data( + packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size)); +diff --git a/chromium/media/filters/ffmpeg_glue.cc b/chromium/media/filters/ffmpeg_glue.cc +index 0ef3521473d..8483ecc348f 100644 +--- a/chromium/media/filters/ffmpeg_glue.cc ++++ b/chromium/media/filters/ffmpeg_glue.cc +@@ -59,7 +59,6 @@ static int64_t AVIOSeekOperation(void* opaque, int64_t offset, int whence) { + } + + void FFmpegGlue::InitializeFFmpeg() { +- av_register_all(); + } + + static void LogContainer(bool is_local_file, +@@ -95,9 +94,6 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol* protocol) { + // Enable fast, but inaccurate seeks for MP3. + format_context_->flags |= AVFMT_FLAG_FAST_SEEK; + +- // Ensures we can read out various metadata bits like vp8 alpha. +- format_context_->flags |= AVFMT_FLAG_KEEP_SIDE_DATA; +- + // Ensures format parsing errors will bail out. From an audit on 11/2017, all + // instances were real failures. Solves bugs like http://crbug.com/710791. + format_context_->error_recognition |= AV_EF_EXPLODE; +diff --git a/chromium/media/filters/ffmpeg_video_decoder.cc b/chromium/media/filters/ffmpeg_video_decoder.cc +index ef12477ee89..7996606f5f9 100644 +--- a/chromium/media/filters/ffmpeg_video_decoder.cc ++++ b/chromium/media/filters/ffmpeg_video_decoder.cc +@@ -391,7 +391,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder(const VideoDecoderConfig& config, + if (decode_nalus_) + codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS; + +- AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); ++ const AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id); + if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) { + ReleaseFFmpegResources(); + return false; +diff --git a/chromium/media/filters/media_file_checker.cc b/chromium/media/filters/media_file_checker.cc +index 59c2a2fc618..1a9872c7acb 100644 +--- a/chromium/media/filters/media_file_checker.cc ++++ b/chromium/media/filters/media_file_checker.cc +@@ -68,7 +68,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) { + auto context = AVStreamToAVCodecContext(format_context->streams[i]); + if (!context) + continue; +- AVCodec* codec = avcodec_find_decoder(cp->codec_id); ++ const AVCodec* codec = avcodec_find_decoder(cp->codec_id); + if (codec && avcodec_open2(context.get(), codec, nullptr) >= 0) { + auto loop = std::make_unique<FFmpegDecodingLoop>(context.get()); + stream_contexts[i] = {std::move(context), std::move(loop)}; +diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +index 9002b874611..d12fade8b63 100644 +--- a/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc ++++ b/chromium/third_party/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +@@ -203,7 +203,7 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings, + // a pointer |this|. + av_context_->opaque = this; + +- AVCodec* codec = avcodec_find_decoder(av_context_->codec_id); ++ const AVCodec* codec = avcodec_find_decoder(av_context_->codec_id); + if (!codec) { + // This is an indication that FFmpeg has not been initialized or it has not + // been compiled/initialized with the correct set of codecs. diff --git a/source/l/qt5/qt5.SlackBuild b/source/l/qt5/qt5.SlackBuild index c8cf9cf13..2edffbfaf 100755 --- a/source/l/qt5/qt5.SlackBuild +++ b/source/l/qt5/qt5.SlackBuild @@ -140,6 +140,11 @@ cd qtwebengine/src/3rdparty zcat $CWD/patches/qt5-webengine-gcc12.patch.gz | patch -p1 --verbose || exit 1 cd - 1>/dev/null +# Fix build with ffmpeg-5: +cd qtwebengine/src/3rdparty + zcat $CWD/patches/qt5-webengine-ffmpeg5.patch.gz | patch -p1 --verbose || exit 1 +cd - 1>/dev/null + # CMake generates wrong -isystem /usr/include compilations flags with Qt5::Gui # and for it breaks KWin compilation with: # /usr/include/c++/9.1.0/cstdlib:75:15: fatal error: stdlib.h: No such file or directory diff --git a/source/n/libgpg-error/libgpg-error.SlackBuild b/source/n/libgpg-error/libgpg-error.SlackBuild index 5fb69ab71..22e4fa82e 100755 --- a/source/n/libgpg-error/libgpg-error.SlackBuild +++ b/source/n/libgpg-error/libgpg-error.SlackBuild @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 2006, 2009 Robby Workman, Northport, AL, USA -# Copyright 2007, 2008, 2009, 2010, 2015, 2017, 2018, 2019, 2020 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2007, 2008, 2009, 2010, 2015, 2017, 2018, 2019, 2020, 2022 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=libgpg-error VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -87,6 +87,7 @@ CXXFLAGS="$SLKCFLAGS" \ --docdir=/usr/doc/$PKGNAM-$VERSION \ --enable-shared=yes \ --enable-static=no \ + --enable-install-gpg-error-config \ --build=$ARCH-slackware-linux \ --host=$ARCH-slackware-linux || exit 1 diff --git a/source/x/libva-utils/libva-utils.url b/source/x/libva-utils/libva-utils.url index 0b9042411..1ee8c3ac3 100644 --- a/source/x/libva-utils/libva-utils.url +++ b/source/x/libva-utils/libva-utils.url @@ -1 +1 @@ -https://github.com/intel/libva-utils +https://github.com/intel/libva-utils/tags diff --git a/source/xap/FTBFSlog b/source/xap/FTBFSlog index 859555ed5..8e7c7926e 100644 --- a/source/xap/FTBFSlog +++ b/source/xap/FTBFSlog @@ -1,3 +1,6 @@ +Sun Oct 9 20:11:17 UTC 2022 + blackbox: Add #include <ctime>. Thanks to nobodino. ++--------------------------+ Mon Feb 7 20:57:55 UTC 2022 All packages tested and found to compile properly. +--------------------------+ diff --git a/source/xap/MPlayer/MPlayer.SlackBuild b/source/xap/MPlayer/MPlayer.SlackBuild index 7becb7598..718d48c97 100755 --- a/source/xap/MPlayer/MPlayer.SlackBuild +++ b/source/xap/MPlayer/MPlayer.SlackBuild @@ -25,7 +25,7 @@ # Set initial variables: PKGNAM=MPlayer -VERSION=${VERSION:-20210418} +VERSION=${VERSION:-20221009} # Need to build trunk until there's a stable branch compatible with the # latest ffmpeg stable release: #BRANCH=${BRANCH:-1.3} # leave empty if you want to build MPlayer trunk diff --git a/source/xap/audacious-plugins/audacious-plugins.SlackBuild b/source/xap/audacious-plugins/audacious-plugins.SlackBuild index 3e3de478b..65d939a21 100755 --- a/source/xap/audacious-plugins/audacious-plugins.SlackBuild +++ b/source/xap/audacious-plugins/audacious-plugins.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=audacious-plugins VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Whether to include faad/aac support: FAAD=${FAAD:---disable-aac} diff --git a/source/xap/blackbox/blackbox.SlackBuild b/source/xap/blackbox/blackbox.SlackBuild index 8f99f5c60..5157533a0 100755 --- a/source/xap/blackbox/blackbox.SlackBuild +++ b/source/xap/blackbox/blackbox.SlackBuild @@ -92,6 +92,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Fix FTBFS: +zcat $CWD/blackbox.ctime.diff.gz | patch -p1 --verbose || exit 1 + autoreconf -vif # Configure: diff --git a/source/xap/blackbox/blackbox.ctime.diff b/source/xap/blackbox/blackbox.ctime.diff new file mode 100644 index 000000000..0b816f2ac --- /dev/null +++ b/source/xap/blackbox/blackbox.ctime.diff @@ -0,0 +1,10 @@ +--- ./src/Toolbar.cc.orig 2013-09-24 12:20:15.000000000 -0500 ++++ ./src/Toolbar.cc 2022-10-09 15:10:31.085253543 -0500 +@@ -38,6 +38,7 @@ + #include <X11/Xutil.h> + #include <sys/time.h> + #include <assert.h> ++#include <ctime> + + + long nextTimeout(int resolution) diff --git a/source/xap/ffmpegthumbnailer/198.patch b/source/xap/ffmpegthumbnailer/198.patch new file mode 100644 index 000000000..25a4a5f0c --- /dev/null +++ b/source/xap/ffmpegthumbnailer/198.patch @@ -0,0 +1,320 @@ +From 67be4abd22b726e277c4b67bfb3abf5a65cfd9b5 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:23:23 +1000 +Subject: [PATCH 1/9] lib/moviedecoder: remove unused variable + +--- + libffmpegthumbnailer/moviedecoder.cpp | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 290e212..aa44adf 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -570,8 +570,6 @@ bool MovieDecoder::getVideoPacket() + bool framesAvailable = true; + bool frameDecoded = false; + +- int attempts = 0; +- + if (m_pPacket) + { + av_packet_unref(m_pPacket); + +From 66f64668e7a063e790813c7733ca438ab112af89 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:42:07 +1000 +Subject: [PATCH 2/9] lib/moviedecoder: clang-tidy fixes + +--- + libffmpegthumbnailer/moviedecoder.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index aa44adf..79c950b 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -503,12 +503,12 @@ void MovieDecoder::seek(int timeInSeconds) + avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec); + + int keyFrameAttempts = 0; +- bool gotFrame = 0; ++ bool gotFrame; + + do + { + int count = 0; +- gotFrame = 0; ++ gotFrame = false; + + while (!gotFrame && count < 20) + { + +From 96c22aa66719846854895afcb72962862d5a4ffd Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 20:39:32 +1000 +Subject: [PATCH 3/9] lib/moviedecoder: remove SilenceLogLevel + +Was unused. +--- + libffmpegthumbnailer/moviedecoder.cpp | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 79c950b..21df096 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -41,11 +41,6 @@ using namespace std; + namespace ffmpegthumbnailer + { + +-struct SilenceLogLevel +-{ +- SilenceLogLevel() { av_log_set_level(AV_LOG_QUIET); } +-}; +- + MovieDecoder::MovieDecoder(AVFormatContext* pavContext) + : m_VideoStream(-1) + , m_pFormatContext(pavContext) + +From 664680f4bfeb89923f485eba270f9e49a8d02bfc Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:25:40 +1000 +Subject: [PATCH 4/9] lib/moviedecoder: remove registration calls + +They're not needed anymore. +--- + libffmpegthumbnailer/moviedecoder.cpp | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 21df096..ac3e5b9 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -65,8 +65,6 @@ MovieDecoder::~MovieDecoder() + + void MovieDecoder::initialize(const string& filename, bool preferEmbeddedMetadata) + { +- av_register_all(); +- avcodec_register_all(); + avformat_network_init(); + + string inputFile = filename == "-" ? "pipe:" : filename; +@@ -386,8 +384,6 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std:: + auto del = [] (AVBufferSinkParams* p) { av_freep(p); }; + std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del); + +- avfilter_register_all(); +- + m_pFilterGraph = avfilter_graph_alloc(); + assert(m_pFilterGraph); + + +From 1ae42e664e1f3c915d186ae00aa2c8018b998708 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:30:21 +1000 +Subject: [PATCH 5/9] lib/moviedecoder: remove use of AVBufferSinkParams + +--- + libffmpegthumbnailer/moviedecoder.cpp | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index ac3e5b9..dece668 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -379,11 +379,6 @@ std::string MovieDecoder::createScaleString(const std::string& sizeString, bool + + void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std::string& size, bool maintainAspectRatio) + { +- static const AVPixelFormat pixelFormats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; +- +- auto del = [] (AVBufferSinkParams* p) { av_freep(p); }; +- std::unique_ptr<AVBufferSinkParams, decltype(del)> buffersinkParams(av_buffersink_params_alloc(), del); +- + m_pFilterGraph = avfilter_graph_alloc(); + assert(m_pFilterGraph); + +@@ -395,10 +390,8 @@ void MovieDecoder::initializeFilterGraph(const AVRational& timeBase, const std:: + + checkRc(avfilter_graph_create_filter(&m_pFilterSource, avfilter_get_by_name("buffer"), "thumb_buffer", ss.str().c_str(), nullptr, m_pFilterGraph), + "Failed to create filter source"); +- buffersinkParams->pixel_fmts = pixelFormats; +- checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, buffersinkParams.get(), m_pFilterGraph), ++ checkRc(avfilter_graph_create_filter(&m_pFilterSink, avfilter_get_by_name("buffersink"), "thumb_buffersink", nullptr, nullptr, m_pFilterGraph), + "Failed to create filter sink"); +- buffersinkParams.release(); + + AVFilterContext* yadifFilter = nullptr; + if (m_pFrame->interlaced_frame != 0) + +From 19675349662a4ea4455d7d13b01cca28ab585762 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:39:58 +1000 +Subject: [PATCH 6/9] lib/moviedecoder: use m_pVideoCodecContext instead of + AVStream::codec + +--- + libffmpegthumbnailer/moviedecoder.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index dece668..0b7a280 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -484,7 +484,7 @@ void MovieDecoder::seek(int timeInSeconds) + } + + checkRc(av_seek_frame(m_pFormatContext, -1, timestamp, 0), "Seeking in video failed"); +- avcodec_flush_buffers(m_pFormatContext->streams[m_VideoStream]->codec); ++ avcodec_flush_buffers(m_pVideoCodecContext); + + int keyFrameAttempts = 0; + bool gotFrame; + +From 4f74f83a009fa2b3f3d546adb24d4f1406910007 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:49:03 +1000 +Subject: [PATCH 7/9] lib/moviedecoder: codec -> codecpar + +--- + libffmpegthumbnailer/moviedecoder.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index 0b7a280..e58904e 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -145,10 +145,10 @@ int32_t MovieDecoder::findPreferedVideoStream(bool preferEmbeddedMetadata) + for (unsigned int i = 0; i < m_pFormatContext->nb_streams; ++i) + { + AVStream *stream = m_pFormatContext->streams[i]; +- auto ctx = m_pFormatContext->streams[i]->codec; +- if (ctx->codec_type == AVMEDIA_TYPE_VIDEO) ++ auto par = m_pFormatContext->streams[i]->codecpar; ++ if (par->codec_type == AVMEDIA_TYPE_VIDEO) + { +- if (!preferEmbeddedMetadata || !isStillImageCodec(ctx->codec_id)) ++ if (!preferEmbeddedMetadata || !isStillImageCodec(par->codec_id)) + { + videoStreams.push_back(i); + continue; + +From 3ffdd65cbda6ef21d36c96013db1b0f4dc9fc57b Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 17:52:01 +1000 +Subject: [PATCH 8/9] lib/movedecoder: don't rely on avformat to allocate a + context + +--- + libffmpegthumbnailer/moviedecoder.cpp | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index e58904e..da5f32a 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -90,8 +90,7 @@ void MovieDecoder::destroy() + { + if (m_pVideoCodecContext) + { +- avcodec_close(m_pVideoCodecContext); +- m_pVideoCodecContext = nullptr; ++ avcodec_free_context(&m_pVideoCodecContext); + } + + if ((!m_FormatContextWasGiven) && m_pFormatContext) +@@ -196,8 +195,7 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata) + } + + m_pVideoStream = m_pFormatContext->streams[m_VideoStream]; +- m_pVideoCodecContext = m_pVideoStream->codec; +- m_pVideoCodec = avcodec_find_decoder(m_pVideoCodecContext->codec_id); ++ m_pVideoCodec = avcodec_find_decoder(m_pVideoStream->codecpar->codec_id); + + if (m_pVideoCodec == nullptr) + { +@@ -207,6 +205,20 @@ void MovieDecoder::initializeVideo(bool preferEmbeddedMetadata) + throw logic_error("Video Codec not found"); + } + ++ m_pVideoCodecContext = avcodec_alloc_context3(m_pVideoCodec); ++ ++ if (m_pVideoCodecContext == nullptr) ++ { ++ destroy(); ++ throw logic_error("Could not allocate video codec context"); ++ } ++ ++ if (avcodec_parameters_to_context(m_pVideoCodecContext, m_pVideoStream->codecpar) < 0) ++ { ++ destroy(); ++ throw logic_error("Could not configure video codec context"); ++ } ++ + m_pVideoCodecContext->workaround_bugs = 1; + + if (avcodec_open2(m_pVideoCodecContext, m_pVideoCodec, nullptr) < 0) + +From f9273852c8e3d7af77d6c8929b1ac6c8a26eca50 Mon Sep 17 00:00:00 2001 +From: Zane van Iperen <zane@zanevaniperen.com> +Date: Mon, 15 Mar 2021 20:57:45 +1000 +Subject: [PATCH 9/9] lib/moviedecoder: replace avcodec_decode_video2() usage + +--- + libffmpegthumbnailer/moviedecoder.cpp | 31 +++++++++++++++++++++------ + 1 file changed, 24 insertions(+), 7 deletions(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.cpp b/libffmpegthumbnailer/moviedecoder.cpp +index da5f32a..f32577a 100644 +--- a/libffmpegthumbnailer/moviedecoder.cpp ++++ b/libffmpegthumbnailer/moviedecoder.cpp +@@ -548,17 +548,33 @@ bool MovieDecoder::decodeVideoPacket() + return false; + } + +- av_frame_unref(m_pFrame); +- +- int frameFinished; ++ int rc = avcodec_send_packet(m_pVideoCodecContext, m_pPacket); ++ if(rc == AVERROR(EAGAIN)) ++ { ++ rc = 0; ++ } + +- int bytesDecoded = avcodec_decode_video2(m_pVideoCodecContext, m_pFrame, &frameFinished, m_pPacket); +- if (bytesDecoded < 0) ++ if(rc == AVERROR_EOF) ++ { ++ return false; ++ } ++ else if(rc < 0) + { +- throw logic_error("Failed to decode video frame: bytesDecoded < 0"); ++ throw logic_error("Failed to decode video frame: avcodec_send_packet() < 0"); + } + +- return frameFinished > 0; ++ rc = avcodec_receive_frame(m_pVideoCodecContext, m_pFrame); ++ switch(rc) ++ { ++ case 0: ++ return true; ++ ++ case AVERROR(EAGAIN): ++ return false; ++ ++ default: ++ throw logic_error("Failed to decode video frame: avcodec_receive_frame() < 0"); ++ } + } + + bool MovieDecoder::getVideoPacket() +@@ -574,6 +590,7 @@ bool MovieDecoder::getVideoPacket() + + m_pPacket = new AVPacket(); + ++ + while (framesAvailable && !frameDecoded) + { + framesAvailable = av_read_frame(m_pFormatContext, m_pPacket) >= 0; diff --git a/source/xap/ffmpegthumbnailer/efb5b618.patch b/source/xap/ffmpegthumbnailer/efb5b618.patch new file mode 100644 index 000000000..81e57aab1 --- /dev/null +++ b/source/xap/ffmpegthumbnailer/efb5b618.patch @@ -0,0 +1,22 @@ +From efb5b618f1c1471c1a7900aed3a59d851ea9a210 Mon Sep 17 00:00:00 2001 +From: Paul Jonkins <paul.ionkin@gmail.com> +Date: Wed, 23 Jun 2021 17:53:55 +0200 +Subject: [PATCH] Constify AVCodec + +--- + libffmpegthumbnailer/moviedecoder.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libffmpegthumbnailer/moviedecoder.h b/libffmpegthumbnailer/moviedecoder.h +index 3ef5f12..fb6add2 100644 +--- a/libffmpegthumbnailer/moviedecoder.h ++++ b/libffmpegthumbnailer/moviedecoder.h +@@ -78,7 +78,7 @@ class MovieDecoder + int m_VideoStream;
+ AVFormatContext* m_pFormatContext;
+ AVCodecContext* m_pVideoCodecContext;
+- AVCodec* m_pVideoCodec;
++ const AVCodec* m_pVideoCodec;
+ AVFilterGraph* m_pFilterGraph;
+ AVFilterContext* m_pFilterSource;
+ AVFilterContext* m_pFilterSink;
diff --git a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild index b590ee79e..bc46b59cc 100755 --- a/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild +++ b/source/xap/ffmpegthumbnailer/ffmpegthumbnailer.SlackBuild @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=ffmpegthumbnailer VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -87,6 +87,10 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Fix build with ffmpeg-5: +zcat $CWD/198.patch.gz | patch -p1 --verbose || exit 1 +zcat $CWD/efb5b618.patch.gz | patch -p1 --verbose || exit 1 + # Configure, build, and install: mkdir cmake-build cd cmake-build @@ -98,10 +102,10 @@ cd cmake-build -DCMAKE_INSTALL_MANDIR="man" \ -DENABLE_GIO="yes" \ -DENABLE_THUMBNAILER="yes" \ - .. + .. || exit 1 - make VERBOSE=1 - make install DESTDIR=$PKG + make VERBOSE=1 || exit 1 + make install DESTDIR=$PKG || exit 1 cd .. # Strip binaries: diff --git a/source/xap/freerdp/freerdp.SlackBuild b/source/xap/freerdp/freerdp.SlackBuild index 21e78ee05..6252d5db3 100755 --- a/source/xap/freerdp/freerdp.SlackBuild +++ b/source/xap/freerdp/freerdp.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=freerdp VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch b/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch new file mode 100644 index 000000000..1b40715d6 --- /dev/null +++ b/source/xap/ssr/0003-Fix-build-with-ffmpeg-5.0.patch @@ -0,0 +1,237 @@ +From: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= <bero@lindev.ch> +Date: Sun, 16 Jan 2022 02:40:04 +0100 +Subject: Fix build with ffmpeg 5.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Adapt to ffmpeg 5.0 requiring more const-ness for AVCodec. + +Signed-off-by: Bernhard Rosenkränzer <bero@lindev.ch> +--- + src/AV/Output/AudioEncoder.cpp | 6 +++--- + src/AV/Output/AudioEncoder.h | 4 ++-- + src/AV/Output/BaseEncoder.cpp | 4 ++-- + src/AV/Output/BaseEncoder.h | 4 ++-- + src/AV/Output/Muxer.cpp | 12 ++++++------ + src/AV/Output/Muxer.h | 4 ++-- + src/AV/Output/VideoEncoder.cpp | 6 +++--- + src/AV/Output/VideoEncoder.h | 4 ++-- + 8 files changed, 22 insertions(+), 22 deletions(-) + +diff --git a/src/AV/Output/AudioEncoder.cpp b/src/AV/Output/AudioEncoder.cpp +index 34d015c..cefc2e0 100644 +--- a/src/AV/Output/AudioEncoder.cpp ++++ b/src/AV/Output/AudioEncoder.cpp +@@ -34,7 +34,7 @@ const std::vector<AudioEncoder::SampleFormatData> AudioEncoder::SUPPORTED_SAMPLE + + const unsigned int AudioEncoder::DEFAULT_FRAME_SAMPLES = 1024; + +-AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, AVCodec* codec, AVDictionary** options) ++AudioEncoder::AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext *codec_context, const AVCodec* codec, AVDictionary** options) + : BaseEncoder(muxer, stream, codec_context, codec, options) { + + #if !SSR_USE_AVCODEC_ENCODE_AUDIO2 +@@ -77,7 +77,7 @@ unsigned int AudioEncoder::GetSampleRate() { + } + + bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) + return false; + if(!av_codec_is_encoder(codec)) +@@ -93,7 +93,7 @@ bool AudioEncoder::AVCodecIsSupported(const QString& codec_name) { + return false; + } + +-void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, ++void AudioEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) { + + if(channels == 0) { +diff --git a/src/AV/Output/AudioEncoder.h b/src/AV/Output/AudioEncoder.h +index c93278c..ae9c82e 100644 +--- a/src/AV/Output/AudioEncoder.h ++++ b/src/AV/Output/AudioEncoder.h +@@ -40,7 +40,7 @@ private: + #endif + + public: +- AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ AudioEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + ~AudioEncoder(); + + // Returns the required frame size, i.e. the number of samples (for each channel). +@@ -57,7 +57,7 @@ public: + + public: + static bool AVCodecIsSupported(const QString& codec_name); +- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, ++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate); + + private: +diff --git a/src/AV/Output/BaseEncoder.cpp b/src/AV/Output/BaseEncoder.cpp +index 7c01ef3..4780aaf 100644 +--- a/src/AV/Output/BaseEncoder.cpp ++++ b/src/AV/Output/BaseEncoder.cpp +@@ -42,7 +42,7 @@ double ParseCodecOptionDouble(const QString& key, const QString& value, double m + return clamp(value_double, min, max) * multiply; + } + +-BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options) { ++BaseEncoder::BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options) { + + m_muxer = muxer; + m_stream = stream; +@@ -157,7 +157,7 @@ void BaseEncoder::IncrementPacketCounter() { + ++lock->m_total_packets; + } + +-void BaseEncoder::Init(AVCodec* codec, AVDictionary** options) { ++void BaseEncoder::Init(const AVCodec* codec, AVDictionary** options) { + + // open codec + if(avcodec_open2(m_codec_context, codec, options) < 0) { +diff --git a/src/AV/Output/BaseEncoder.h b/src/AV/Output/BaseEncoder.h +index 3d92f29..7f02bbd 100644 +--- a/src/AV/Output/BaseEncoder.h ++++ b/src/AV/Output/BaseEncoder.h +@@ -51,7 +51,7 @@ private: + std::atomic<bool> m_should_stop, m_should_finish, m_is_done, m_error_occurred; + + protected: +- BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ BaseEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + + public: + virtual ~BaseEncoder(); // encoders will be deleted by Muxer, don't delete them yourself! +@@ -117,7 +117,7 @@ protected: + void IncrementPacketCounter(); + + private: +- void Init(AVCodec* codec, AVDictionary** options); ++ void Init(const AVCodec* codec, AVDictionary** options); + void Free(); + + void EncoderThread(); +diff --git a/src/AV/Output/Muxer.cpp b/src/AV/Output/Muxer.cpp +index ad58380..1094dcc 100644 +--- a/src/AV/Output/Muxer.cpp ++++ b/src/AV/Output/Muxer.cpp +@@ -87,7 +87,7 @@ Muxer::~Muxer() { + + VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) { +- AVCodec *codec = FindCodec(codec_name); ++ const AVCodec *codec = FindCodec(codec_name); + AVCodecContext *codec_context = NULL; + AVStream *stream = AddStream(codec, &codec_context); + VideoEncoder *encoder; +@@ -111,7 +111,7 @@ VideoEncoder* Muxer::AddVideoEncoder(const QString& codec_name, const std::vecto + + AudioEncoder* Muxer::AddAudioEncoder(const QString& codec_name, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int channels, unsigned int sample_rate) { +- AVCodec *codec = FindCodec(codec_name); ++ const AVCodec *codec = FindCodec(codec_name); + AVCodecContext *codec_context = NULL; + AVStream *stream = AddStream(codec, &codec_context); + AudioEncoder *encoder; +@@ -194,7 +194,7 @@ unsigned int Muxer::GetQueuedPacketCount(unsigned int stream_index) { + void Muxer::Init() { + + // get the format we want (this is just a pointer, we don't have to free this) +- AVOutputFormat *format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL); ++ auto format = av_guess_format(m_container_name.toUtf8().constData(), NULL, NULL); + if(format == NULL) { + Logger::LogError("[Muxer::Init] " + Logger::tr("Error: Can't find chosen output format!")); + throw LibavException(); +@@ -261,8 +261,8 @@ void Muxer::Free() { + } + } + +-AVCodec* Muxer::FindCodec(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++const AVCodec* Muxer::FindCodec(const QString& codec_name) { ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) { + Logger::LogError("[Muxer::FindCodec] " + Logger::tr("Error: Can't find codec!")); + throw LibavException(); +@@ -270,7 +270,7 @@ AVCodec* Muxer::FindCodec(const QString& codec_name) { + return codec; + } + +-AVStream* Muxer::AddStream(AVCodec* codec, AVCodecContext** codec_context) { ++AVStream* Muxer::AddStream(const AVCodec* codec, AVCodecContext** codec_context) { + assert(!m_started); + assert(m_format_context->nb_streams < MUXER_MAX_STREAMS); + +diff --git a/src/AV/Output/Muxer.h b/src/AV/Output/Muxer.h +index d72347d..b104bcb 100644 +--- a/src/AV/Output/Muxer.h ++++ b/src/AV/Output/Muxer.h +@@ -114,8 +114,8 @@ private: + void Init(); + void Free(); + +- AVCodec* FindCodec(const QString& codec_name); +- AVStream* AddStream(AVCodec* codec, AVCodecContext** codec_context); ++ const AVCodec* FindCodec(const QString& codec_name); ++ AVStream* AddStream(const AVCodec* codec, AVCodecContext** codec_context); + + void MuxerThread(); + +diff --git a/src/AV/Output/VideoEncoder.cpp b/src/AV/Output/VideoEncoder.cpp +index 8087e8e..fc8b5d1 100644 +--- a/src/AV/Output/VideoEncoder.cpp ++++ b/src/AV/Output/VideoEncoder.cpp +@@ -34,7 +34,7 @@ const std::vector<VideoEncoder::PixelFormatData> VideoEncoder::SUPPORTED_PIXEL_F + {"rgb", AV_PIX_FMT_RGB24, false}, + }; + +-VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options) ++VideoEncoder::VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options) + : BaseEncoder(muxer, stream, codec_context, codec, options) { + + #if !SSR_USE_AVCODEC_ENCODE_VIDEO2 +@@ -95,7 +95,7 @@ unsigned int VideoEncoder::GetFrameRate() { + } + + bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) { +- AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); ++ const AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData()); + if(codec == NULL) + return false; + if(!av_codec_is_encoder(codec)) +@@ -111,7 +111,7 @@ bool VideoEncoder::AVCodecIsSupported(const QString& codec_name) { + return false; + } + +-void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, ++void VideoEncoder::PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate) { + + if(width == 0 || height == 0) { +diff --git a/src/AV/Output/VideoEncoder.h b/src/AV/Output/VideoEncoder.h +index cb7ca27..68d872e 100644 +--- a/src/AV/Output/VideoEncoder.h ++++ b/src/AV/Output/VideoEncoder.h +@@ -40,7 +40,7 @@ private: + #endif + + public: +- VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options); ++ VideoEncoder(Muxer* muxer, AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options); + ~VideoEncoder(); + + // Returns the required pixel format. +@@ -55,7 +55,7 @@ public: + + public: + static bool AVCodecIsSupported(const QString& codec_name); +- static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, ++ static void PrepareStream(AVStream* stream, AVCodecContext* codec_context, const AVCodec* codec, AVDictionary** options, const std::vector<std::pair<QString, QString> >& codec_options, + unsigned int bit_rate, unsigned int width, unsigned int height, unsigned int frame_rate); + + private: diff --git a/source/xap/ssr/ssr.SlackBuild b/source/xap/ssr/ssr.SlackBuild index 1d151b6d0..583d2a105 100755 --- a/source/xap/ssr/ssr.SlackBuild +++ b/source/xap/ssr/ssr.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2020 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2020, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -85,6 +85,8 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +zcat $CWD/0003-Fix-build-with-ffmpeg-5.0.patch.gz | patch -p1 --verbose || exit 1 + # Configure, build, and install: mkdir cmake-build cd cmake-build diff --git a/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch b/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch new file mode 100644 index 000000000..baa21b2f0 --- /dev/null +++ b/source/xap/xine-lib/020-xine-lib-ffmpeg-5.1-fix.patch @@ -0,0 +1,330 @@ +--- a/m4/decoders.m4 ++++ b/m4/decoders.m4 +@@ -134,13 +134,36 @@ a52_init (); + AC_DEFINE([HAVE_FFMPEG], 1, [Define this if you have the ffmpeg library]) + dnl Check presence of ffmpeg/avutil.h to see if it's old or new + dnl style for headers. The new style would be preferred actually... ++ dnl Sigh. at least some 09/2022 ffmpeg version does violate the basic ++ dnl "get directly what you use directly" rule. especially, ++ dnl libavformat/avformat.h includes libavcodec/packet.h which uses ++ dnl (but not includes) libavutil/avutil.h. this means that a mere ++ dnl AC_CHECK_HEADERS([libavformat/avformat.h]) will fail strangely :-/ + ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $FFMPEG_CFLAGS" + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CFLAGS $FFMPEG_CFLAGS $AVUTIL_CFLAGS" +- AC_CHECK_HEADERS([ffmpeg/avutil.h]) +- AC_CHECK_HEADERS([libavutil/avutil.h]) +- AC_CHECK_HEADERS([libavutil/sha1.h]) +- AC_CHECK_HEADERS([libavutil/sha.h]) ++ AC_CHECK_HEADERS([ffmpeg/avutil.h libavutil/avutil.h libavutil/sha1.h libavutil/mem.h libavutil/sha.h]) ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#include <libavutil/avutil.h> ++#include <libavcodec/avcodec.h> ++ ]],[[]])], [have_avutil_avcodec_h=yes], [have_avutil_avcodec_h=no]) ++ test x"$have_avutil_avcodec_h" == x"yes" && AC_DEFINE([HAVE_AVUTIL_AVCODEC_H],[1], ++ [Define this if you have libavutil/avutil.h and libavcodec/avcodec.h.]) ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#include <libavutil/avutil.h> ++#include <libavcodec/avcodec.h> ++#include <libavformat/avformat.h> ++ ]],[[]])], [have_avformat_avformat_h=yes], [have_avformat_avformat_h=no]) ++ test x"$have_avformat_avformat_h" == x"yes" && AC_DEFINE([HAVE_AVFORMAT_AVFORMAT_H],[1], ++ [Define this if you have libavformat/avformat.h.]) ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ++#include <libavutil/avutil.h> ++#include <libavcodec/avcodec.h> ++#include <libavformat/avformat.h> ++#include <libavformat/avio.h> ++ ]],[[]])], [have_avformat_avio_h=yes], [have_avformat_avio_h=no]) ++ test x"$have_avformat_avio_h" == x"yes" && AC_DEFINE([HAVE_AVFORMAT_AVIO_H],[1], ++ [Define this if you have libavformat/avformat.h.]) + if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then + AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!]) + fi +--- a/m4/input.m4 ++++ b/m4/input.m4 +@@ -229,6 +229,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ + fi + if test x"$have_avformat" = x"yes"; then + AC_DEFINE([HAVE_AVFORMAT], 1, [Define this if you have libavformat installed]) ++ AC_CHECK_HEADERS([libavformat/avformat.h]) + fi + fi + AM_CONDITIONAL([ENABLE_AVFORMAT], [test x"$have_avformat" = x"yes"]) +--- a/src/combined/ffmpeg/demux_avformat.c ++++ b/src/combined/ffmpeg/demux_avformat.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2013-2021 the xine project ++ * Copyright (C) 2013-2022 the xine project + * Copyright (C) 2013-2020 Petri Hintukainen <phintuka@users.sourceforge.net> + * + * This file is part of xine, a free video player. +@@ -29,6 +29,8 @@ + #include <pthread.h> + #include <errno.h> + ++#include <libavutil/avutil.h> ++#include <libavcodec/avcodec.h> + #include <libavformat/avformat.h> + #include <libavformat/avio.h> + +@@ -922,3 +924,4 @@ void *init_avformat_demux_plugin (xine_t + (void)data; + return (demux_class_t *)&this; + } ++ +--- a/src/combined/ffmpeg/ff_audio_decoder.c ++++ b/src/combined/ffmpeg/ff_audio_decoder.c +@@ -31,13 +31,20 @@ + #include <pthread.h> + #include <math.h> + +-#ifdef HAVE_FFMPEG_AVUTIL_H +-# include <avcodec.h> +-#else +-# include <libavcodec/avcodec.h> ++#if defined(HAVE_LIBAVUTIL_AVUTIL_H) ++# include <libavutil/avutil.h> ++#endif ++ ++#if defined(HAVE_LIBAVUTIL_MEM_H) + # include <libavutil/mem.h> + #endif + ++#if defined(HAVE_AVUTIL_AVCODEC_H) ++# include <libavcodec/avcodec.h> ++#else ++# include <avcodec.h> ++#endif ++ + #define LOG_MODULE "ffmpeg_audio_dec" + #define LOG_VERBOSE + /* +--- a/src/combined/ffmpeg/ffmpeg_compat.h ++++ b/src/combined/ffmpeg/ffmpeg_compat.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2000-2021 the xine project ++ * Copyright (C) 2000-2022 the xine project + * + * This file is part of xine, a unix video player. + * +@@ -25,22 +25,24 @@ + + #define XFF_INT_VERSION(major,minor,micro) ((major<<16)|(minor<<8)|micro) + +-#ifndef LIBAVCODEC_VERSION_INT +-# if defined(LIBAVCODEC_VERSION_MAJOR) && defined(LIBAVCODEC_VERSION_MINOR) +-# define LIBAVCODEC_VERSION_INT XFF_INT_VERSION(LIBAVCODEC_VERSION_MAJOR,LIBAVCODEC_VERSION_MINOR,0) +-# else +-# error ffmpeg headers must be included first ! +-# endif ++/** NOTE: since 2022-09-01, ffmpeg headers are more detached from each other. ++ * this goes that far: ++ * libavformat/avformat.h includes libavcodec/packet.h which uses ++ * (but not includes) libavutil/avutil.h :-/ */ ++ ++#if !defined(LIBAVUTIL_VERSION_INT) && defined(LIBAVUTIL_VERSION_MAJOR) && defined(LIBAVUTIL_VERSION_MINOR) ++# define LIBAVUTIL_VERSION_INT XFF_INT_VERSION(LIBAVUTIL_VERSION_MAJOR,LIBAVUTIL_VERSION_MINOR,0) ++#endif ++#if !defined(LIBAVUTIL_VERSION_INT) ++# error avutil.h must be included first ! + #endif + +-#ifndef LIBAVUTIL_VERSION_INT +-# if defined(LIBAVUTIL_VERSION_MAJOR) && defined(LIBAVUTIL_VERSION_MINOR) +-# define LIBAVUTIL_VERSION_INT XFF_INT_VERSION(LIBAVUTIL_VERSION_MAJOR,LIBAVUTIL_VERSION_MINOR,0) +-# else +-# error ffmpeg headers must be included first ! +-# endif ++#if !defined(LIBAVCODEC_VERSION_INT) && defined(LIBAVCODEC_VERSION_MAJOR) && defined(LIBAVCODEC_VERSION_MINOR) ++# define LIBAVCODEC_VERSION_INT XFF_INT_VERSION(LIBAVCODEC_VERSION_MAJOR,LIBAVCODEC_VERSION_MINOR,0) + #endif + ++#if defined(LIBAVCODEC_VERSION_INT) ++ + #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(52,0,0) + # define bits_per_sample bits_per_coded_sample + #endif +@@ -136,38 +138,6 @@ + # define XFF_VAAPI 2 /** << libavutil/hwcontext.h, libavutil/hwcontext_vaapi.h */ + #endif + +-#if LIBAVUTIL_VERSION_INT >= XFF_INT_VERSION(52,0,0) +-# define PIX_FMT_NONE AV_PIX_FMT_NONE +-# define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P +-# define PIX_FMT_YUVJ420P AV_PIX_FMT_YUVJ420P +-# define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P +-# define PIX_FMT_YUVJ444P AV_PIX_FMT_YUVJ444P +-# define PIX_FMT_YUV410P AV_PIX_FMT_YUV410P +-# define PIX_FMT_YUV411P AV_PIX_FMT_YUV411P +-# define PIX_FMT_ARGB AV_PIX_FMT_ARGB +-# define PIX_FMT_BGRA AV_PIX_FMT_BGRA +-# define PIX_FMT_RGB24 AV_PIX_FMT_RGB24 +-# define PIX_FMT_BGR24 AV_PIX_FMT_BGR24 +-# define PIX_FMT_RGB555BE AV_PIX_FMT_RGB555BE +-# define PIX_FMT_RGB555LE AV_PIX_FMT_RGB555LE +-# define PIX_FMT_RGB565BE AV_PIX_FMT_RGB565BE +-# define PIX_FMT_RGB565LE AV_PIX_FMT_RGB565LE +-# define PIX_FMT_PAL8 AV_PIX_FMT_PAL8 +-# define PixelFormat AVPixelFormat +-/* video_out/video_out_vaapi */ +-# if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,0,100) /** << revise this */ +-# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI_VLD +-# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI_IDCT +-# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI_MOCO +-# else +-# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI +-# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI +-# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI +-# endif +- +-# define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT +-#endif +- + #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(54,25,0) + /* dxr3/ffmpeg_encoder */ + # define CODEC_ID_MPEG1VIDEO AV_CODEC_ID_MPEG1VIDEO +@@ -194,10 +164,6 @@ + /* ff_*_decoder mapping is already handled by mkcodeclists.pl */ + #endif + +-#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE +-# define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 +-#endif +- + #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(55,0,100) + # define XFF_AV_BUFFER 1 + #endif +@@ -290,5 +256,51 @@ + # define XFF_AVCODEC_REGISTER_ALL() do {} while(0) + #endif + ++#if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,24,100) ++# define XFF_AUDIO_CHANNEL_LAYOUT 1 /* AVCodecContext.channels, .channel_leyout */ ++#else ++# define XFF_AUDIO_CHANNEL_LAYOUT 2 /* AVCodecContext.ch_layout.nb_channels, .ch_layout.u.mask */ ++#endif ++ ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++# define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 ++#endif ++ ++#if LIBAVUTIL_VERSION_INT >= XFF_INT_VERSION(52,0,0) ++# define PIX_FMT_NONE AV_PIX_FMT_NONE ++# define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P ++# define PIX_FMT_YUVJ420P AV_PIX_FMT_YUVJ420P ++# define PIX_FMT_YUV444P AV_PIX_FMT_YUV444P ++# define PIX_FMT_YUVJ444P AV_PIX_FMT_YUVJ444P ++# define PIX_FMT_YUV410P AV_PIX_FMT_YUV410P ++# define PIX_FMT_YUV411P AV_PIX_FMT_YUV411P ++# define PIX_FMT_ARGB AV_PIX_FMT_ARGB ++# define PIX_FMT_BGRA AV_PIX_FMT_BGRA ++# define PIX_FMT_RGB24 AV_PIX_FMT_RGB24 ++# define PIX_FMT_BGR24 AV_PIX_FMT_BGR24 ++# define PIX_FMT_RGB555BE AV_PIX_FMT_RGB555BE ++# define PIX_FMT_RGB555LE AV_PIX_FMT_RGB555LE ++# define PIX_FMT_RGB565BE AV_PIX_FMT_RGB565BE ++# define PIX_FMT_RGB565LE AV_PIX_FMT_RGB565LE ++# define PIX_FMT_PAL8 AV_PIX_FMT_PAL8 ++# define PixelFormat AVPixelFormat ++/* video_out/video_out_vaapi */ ++# if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,0,100) /** << revise this */ ++# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI_VLD ++# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI_IDCT ++# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI_MOCO ++# else ++# define PIX_FMT_VAAPI_VLD AV_PIX_FMT_VAAPI ++# define PIX_FMT_VAAPI_IDCT AV_PIX_FMT_VAAPI ++# define PIX_FMT_VAAPI_MOCO AV_PIX_FMT_VAAPI ++# endif ++ ++# define CODEC_FLAG_BITEXACT AV_CODEC_FLAG_BITEXACT ++#endif ++ ++#else /* defined(LIBAVCODEC_VERSION_INT) */ ++# error avcodec.h must be included first ! ++#endif /* defined(LIBAVCODEC_VERSION_INT) */ ++ + #endif /* XINE_AVCODEC_COMPAT_H */ + +--- a/src/combined/ffmpeg/ffmpeg_decoder.c ++++ b/src/combined/ffmpeg/ffmpeg_decoder.c 2022-09-13 23:43:40.255615724 -0300 +@@ -26,12 +26,20 @@ + + #include <pthread.h> + +-#ifdef HAVE_FFMPEG_AVUTIL_H +-# include <avcodec.h> +-#else +-# include <libavcodec/avcodec.h> ++#if defined(HAVE_LIBAVUTIL_AVUTIL_H) ++# include <libavutil/avutil.h> ++#endif ++ ++#if defined(HAVE_LIBAVUTIL_MEM_H) + # include <libavutil/mem.h> + #endif ++ ++#if defined(HAVE_AVUTIL_AVCODEC_H) ++# include <libavcodec/avcodec.h> ++#else ++# include <avcodec.h> ++#endif ++ + #ifdef HAVE_AVFORMAT + # include <libavformat/avformat.h> // av_register_all() + #endif +--- a/src/combined/ffmpeg/ff_video_decoder.c ++++ b/src/combined/ffmpeg/ff_video_decoder.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2001-2021 the xine project ++ * Copyright (C) 2001-2022 the xine project + * + * This file is part of xine, a free video player. + * +@@ -32,13 +32,20 @@ + #include <math.h> + #include <assert.h> + +-#ifdef HAVE_FFMPEG_AVUTIL_H +-# include <avcodec.h> +-#else +-# include <libavcodec/avcodec.h> ++#if defined(HAVE_LIBAVUTIL_AVUTIL_H) ++# include <libavutil/avutil.h> ++#endif ++ ++#if defined(HAVE_LIBAVUTIL_MEM_H) + # include <libavutil/mem.h> + #endif + ++#if defined(HAVE_AVUTIL_AVCODEC_H) ++# include <libavcodec/avcodec.h> ++#else ++# include <avcodec.h> ++#endif ++ + #define LOG_MODULE "ffmpeg_video_dec" + #define LOG_VERBOSE + /* +--- a/src/combined/ffmpeg/input_avio.c ++++ b/src/combined/ffmpeg/input_avio.c 2022-09-13 23:43:40.255615724 -0300 +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2013-2020 the xine project ++ * Copyright (C) 2013-2022 the xine project + * Copyright (C) 2013-2020 Petri Hintukainen <phintuka@users.sourceforge.net> + * + * This file is part of xine, a free video player. +@@ -28,6 +28,8 @@ + #include <string.h> + #include <pthread.h> + ++#include <libavutil/avutil.h> ++#include <libavcodec/avcodec.h> + #include <libavformat/avio.h> + + #define LOG_MODULE "libavio" diff --git a/source/xap/xine-lib/xine-lib.SlackBuild b/source/xap/xine-lib/xine-lib.SlackBuild index 22aa68adf..8c637e783 100755 --- a/source/xap/xine-lib/xine-lib.SlackBuild +++ b/source/xap/xine-lib/xine-lib.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2012, 2017, 2018, 2019 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2012, 2017, 2018, 2019, 2022 Patrick J. Volkerding, Sebeka, MN, USA # Copyright 2011, 2012 Eric Hameleers, Eindhoven, NL # Copyright 2017 Heinz Wiesinger, Amsterdam, NL # All rights reserved. @@ -32,7 +32,7 @@ DIRVER=1.2.12 # Version used for the Slackware package PKGVER=1.2.12 -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -90,6 +90,15 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Fix build with ffmpeg-5.1: +zcat $CWD/020-xine-lib-ffmpeg-5.1-fix.patch.gz | patch -p1 --verbose || exit 1 +if ! grep -wq HAVE_AVUTIL_AVCODEC_H include/configure.h.in ; then + echo "#define HAVE_AVUTIL_AVCODEC_H 1" >> include/configure.h.in +fi + +# Fix build with binutils 2.39: +sed '/xine_set_flags/s/XINE_PROTECTED//' -i include/xine.h + XINE_BUILD=$TARGET \ ./configure \ --prefix=/usr \ |