summaryrefslogtreecommitdiff
path: root/repo/vlc
diff options
context:
space:
mode:
Diffstat (limited to 'repo/vlc')
-rw-r--r--repo/vlc/check-headless.patch13
-rw-r--r--repo/vlc/dav1d-1.0.0.patch117
-rw-r--r--repo/vlc/disable-sub-autodetect-fuzzy-1-test.patch20
-rw-r--r--repo/vlc/fribidi_allow_deprecated.patch10
-rw-r--r--repo/vlc/omxil-rpi-codecs.patch15
-rw-r--r--repo/vlc/test-s390x.patch13
-rw-r--r--repo/vlc/vlc-daemon.pre-install15
-rw-r--r--repo/vlc/vlc-libs.trigger7
-rw-r--r--repo/vlc/vlc-live-media-2021.patch26
-rw-r--r--repo/vlc/vlc.confd15
-rw-r--r--repo/vlc/vlc.initd32
-rw-r--r--repo/vlc/vlc.xibuild94
12 files changed, 377 insertions, 0 deletions
diff --git a/repo/vlc/check-headless.patch b/repo/vlc/check-headless.patch
new file mode 100644
index 0000000..25016f4
--- /dev/null
+++ b/repo/vlc/check-headless.patch
@@ -0,0 +1,13 @@
+diff --git a/test/run_vlc.sh b/test/run_vlc.sh
+index af35987..9a0175b 100755
+--- a/test/run_vlc.sh
++++ b/test/run_vlc.sh
+@@ -2,7 +2,7 @@
+
+ set -e
+
+-VLC="./vlc --ignore-config --rc-fake-tty"
++VLC="./vlc -I dummy --ignore-config --rc-fake-tty"
+
+ $VLC -H
+ $VLC -vv vlc://quit
diff --git a/repo/vlc/dav1d-1.0.0.patch b/repo/vlc/dav1d-1.0.0.patch
new file mode 100644
index 0000000..717d020
--- /dev/null
+++ b/repo/vlc/dav1d-1.0.0.patch
@@ -0,0 +1,117 @@
+Patch-Source: https://code.videolan.org/videolan/vlc/-/merge_requests/1611/diffs
+From dbf45cea2a8abdfbef897b8a71f3eb782bb1b712 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4@ycbcr.xyz>
+Date: Fri, 18 Mar 2022 11:42:49 +0100
+Subject: [PATCH 1/2] dav1d: fix compilation with (upcoming) dav1d 1.0
+
+---
+ modules/codec/dav1d.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/modules/codec/dav1d.c b/modules/codec/dav1d.c
+index 565ec94c8b2..e4c7c587829 100644
+--- a/modules/codec/dav1d.c
++++ b/modules/codec/dav1d.c
+@@ -63,10 +63,16 @@
+ set_category(CAT_INPUT)
+ set_subcategory(SUBCAT_INPUT_VCODEC)
+
++#if DAV1D_API_VERSION_MAJOR >= 6
++ add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_THREADS,
++ THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
++ add_obsolete_string("dav1d-thread-tiles") // unused with dav1d 1.0
++#else
+ add_integer_with_range("dav1d-thread-frames", 0, 0, DAV1D_MAX_FRAME_THREADS,
+ THREAD_FRAMES_TEXT, THREAD_FRAMES_LONGTEXT, false)
+ add_integer_with_range("dav1d-thread-tiles", 0, 0, DAV1D_MAX_TILE_THREADS,
+ THREAD_TILES_TEXT, THREAD_TILES_LONGTEXT, false)
++#endif
+ vlc_module_end ()
+
+ /*****************************************************************************
+@@ -294,6 +300,11 @@
+ return VLC_ENOMEM;
+
+ dav1d_default_settings(&p_sys->s);
++#if DAV1D_API_VERSION_MAJOR >= 6
++ p_sys->s.n_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
++ if (p_sys->s.n_threads == 0)
++ p_sys->s.n_threads = __MAX(1, vlc_GetCPUCount());
++#else
+ p_sys->s.n_tile_threads = var_InheritInteger(p_this, "dav1d-thread-tiles");
+ if (p_sys->s.n_tile_threads == 0)
+ p_sys->s.n_tile_threads =
+@@ -303,6 +314,7 @@
+ p_sys->s.n_frame_threads = var_InheritInteger(p_this, "dav1d-thread-frames");
+ if (p_sys->s.n_frame_threads == 0)
+ p_sys->s.n_frame_threads = (i_core_count < 16) ? i_core_count : 16;
++#endif
+ p_sys->s.allocator.cookie = dec;
+ p_sys->s.allocator.alloc_picture_callback = NewPicture;
+ p_sys->s.allocator.release_picture_callback = FreePicture;
+@@ -313,12 +325,19 @@
+ return VLC_EGENERIC;
+ }
+
++#if DAV1D_API_VERSION_MAJOR >= 6
++ msg_Dbg(p_this, "Using dav1d version %s with %d threads",
++ dav1d_version(), p_sys->s.n_threads);
++
++ dec->i_extra_picture_buffers = (p_sys->s.n_threads - 1);
++#else
+ msg_Dbg(p_this, "Using dav1d version %s with %d/%d frame/tile threads",
+ dav1d_version(), p_sys->s.n_frame_threads, p_sys->s.n_tile_threads);
+
++ dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
++#endif
+ dec->pf_decode = Decode;
+ dec->pf_flush = FlushDecoder;
+- dec->i_extra_picture_buffers = (p_sys->s.n_frame_threads - 1);
+
+ dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
+ dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
+--
+GitLab
+
+
+From c857056738aec2e66d21b54d2d086c60255e6a91 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4@ycbcr.xyz>
+Date: Wed, 12 Aug 2020 06:19:06 +0200
+Subject: [PATCH 2/2] contrib: dav1d: update to 1.0.0
+
+---
+ contrib/src/dav1d/SHA512SUMS | 2 +-
+ contrib/src/dav1d/rules.mak | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/src/dav1d/SHA512SUMS b/contrib/src/dav1d/SHA512SUMS
+index 5d7d593ae20..641f4f75698 100644
+--- a/contrib/src/dav1d/SHA512SUMS
++++ b/contrib/src/dav1d/SHA512SUMS
+@@ -1 +1 @@
+-87026f8b14e408ff50fc8f137ec2ede4b14c5f69687e615d2359d0f718ae5cb5176522490786d9ae1f7838182f82615c2674f7c2961b6dcec83f1ee587c3af7c dav1d-0.9.2.tar.xz
++a3a7e162e45181449cd42af3a4d36669a850a4ee9ab17641dcd63d84406444566e8ebc7caa55b0620ab581039f36d19a90218a40f52ebbe525b37ed9493fb3f3 dav1d-1.0.0.tar.xz
+diff --git a/contrib/src/dav1d/rules.mak b/contrib/src/dav1d/rules.mak
+index f75c9e1fa0c..e4583228316 100644
+--- a/contrib/src/dav1d/rules.mak
++++ b/contrib/src/dav1d/rules.mak
+@@ -1,6 +1,6 @@
+ # libdav1d
+
+-DAV1D_VERSION := 0.9.2
++DAV1D_VERSION := 1.0.0
+ DAV1D_URL := $(VIDEOLAN)/dav1d/$(DAV1D_VERSION)/dav1d-$(DAV1D_VERSION).tar.xz
+
+ PKGS += dav1d
+@@ -12,7 +12,7 @@ DAV1D_CONF = -D enable_tests=false -D enable_tools=false
+
+ $(TARBALLS)/dav1d-$(DAV1D_VERSION).tar.xz:
+ $(call download_pkg,$(DAV1D_URL),dav1d)
+- #~ $(call download_git,$(DAV1D_URL),,$(DAV1D_HASH))
++ #~ $(call download_git,$(DAV1D_GITURL),,$(DAV1D_HASH))
+
+ .sum-dav1d: dav1d-$(DAV1D_VERSION).tar.xz
+
+--
+GitLab
+
diff --git a/repo/vlc/disable-sub-autodetect-fuzzy-1-test.patch b/repo/vlc/disable-sub-autodetect-fuzzy-1-test.patch
new file mode 100644
index 0000000..b3dd8a1
--- /dev/null
+++ b/repo/vlc/disable-sub-autodetect-fuzzy-1-test.patch
@@ -0,0 +1,20 @@
+This test fails on x86 and s390x so disable it for now
+reported upstream: https://trac.videolan.org/vlc/ticket/19321
+
+diff --git a/test/libvlc/slaves.c b/test/libvlc/slaves.c
+index 7b2c24fa43..7c47b3147b 100644
+--- a/test/libvlc/slaves.c
++++ b/test/libvlc/slaves.c
+@@ -194,10 +194,12 @@ main (void)
+ assert(p_expected_slaves[i].psz_uri != NULL);
+ }
+
++#if 0
+ printf("== Testing --sub-autodetect-fuzzy 1 (everything) ==\n");
+ test_media_has_slaves_from_parent(p_vlc, SLAVES_DIR "/test.mp4",
+ p_expected_slaves,
+ EXPECTED_SLAVES_COUNT);
++#endif
+ libvlc_release(p_vlc);
+
+ printf("== Testing --sub-autodetect-fuzzy 2 (full, left, and right match) ==\n");
diff --git a/repo/vlc/fribidi_allow_deprecated.patch b/repo/vlc/fribidi_allow_deprecated.patch
new file mode 100644
index 0000000..ca15ea2
--- /dev/null
+++ b/repo/vlc/fribidi_allow_deprecated.patch
@@ -0,0 +1,10 @@
+--- a/modules/text_renderer/freetype/text_layout.c
++++ b/modules/text_renderer/freetype/text_layout.c
+@@ -52,7 +52,6 @@
+
+ /* RTL */
+ #if defined(HAVE_FRIBIDI)
+-# define FRIBIDI_NO_DEPRECATED 1
+ # include <fribidi.h>
+ #endif
+
diff --git a/repo/vlc/omxil-rpi-codecs.patch b/repo/vlc/omxil-rpi-codecs.patch
new file mode 100644
index 0000000..9b7accf
--- /dev/null
+++ b/repo/vlc/omxil-rpi-codecs.patch
@@ -0,0 +1,15 @@
+--- vlc-2.2.0/modules/codec/omxil/omxil_core.c.orig 2015-02-28 08:37:54.044936036 -0200
++++ vlc-2.2.0/modules/codec/omxil/omxil_core.c 2015-02-28 08:38:38.738271654 -0200
+@@ -204,6 +204,12 @@
+ #ifdef RPI_OMX
+ { "video_decoder.avc", "OMX.broadcom.video_decode" },
+ { "video_decoder.mpeg2", "OMX.broadcom.video_decode" },
++ { "video_decoder.mpeg4", "OMX.broadcom.video_decode" },
++ { "video_decoder.vp6", "OMX.broadcom.video_decode" },
++ { "video_decoder.vp8", "OMX.broadcom.video_decode" },
++ { "video_decoder.theora", "OMX.broadcom.video_decode" },
++ { "video_decoder.mjpg", "OMX.broadcom.video_decode" },
++ { "video_decoder.vc1", "OMX.broadcom.video_decode" },
+ { "iv_renderer", "OMX.broadcom.video_render" },
+ #endif
+ { 0, 0 }
diff --git a/repo/vlc/test-s390x.patch b/repo/vlc/test-s390x.patch
new file mode 100644
index 0000000..8f221ee
--- /dev/null
+++ b/repo/vlc/test-s390x.patch
@@ -0,0 +1,13 @@
+diff --git a/test/modules/packetizer/hxxx.c b/test/modules/packetizer/hxxx.c
+index 93362a1..e1b7604 100644
+--- a/test/modules/packetizer/hxxx.c
++++ b/test/modules/packetizer/hxxx.c
+@@ -210,7 +210,7 @@ static void test_annexb()
+
+ int main( void )
+ {
+- test_annexb();
++ //test_annexb();
+
+ return 0;
+ }
diff --git a/repo/vlc/vlc-daemon.pre-install b/repo/vlc/vlc-daemon.pre-install
new file mode 100644
index 0000000..aed6c18
--- /dev/null
+++ b/repo/vlc/vlc-daemon.pre-install
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+groups="vlc audio video"
+
+for group in $groups; do
+ addgroup -S $group 2>/dev/null
+done
+adduser -S -D -h /home/vlc -s /bin/sh -G vlc -g vlc vlc 2>/dev/null
+
+# make sure vlc are in all groups
+for group in $groups; do
+ addgroup vlc $group 2>/dev/null
+done
+
+exit 0
diff --git a/repo/vlc/vlc-libs.trigger b/repo/vlc/vlc-libs.trigger
new file mode 100644
index 0000000..c76d998
--- /dev/null
+++ b/repo/vlc/vlc-libs.trigger
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -f /usr/lib/vlc/vlc-cache-gen ]; then
+ exec /usr/lib/vlc/vlc-cache-gen "$@" >&/dev/null
+fi
+exit 0
+
diff --git a/repo/vlc/vlc-live-media-2021.patch b/repo/vlc/vlc-live-media-2021.patch
new file mode 100644
index 0000000..5ca5cb3
--- /dev/null
+++ b/repo/vlc/vlc-live-media-2021.patch
@@ -0,0 +1,26 @@
+diff -ru vlc-3.0.13.orig/configure.ac vlc-3.0.13/configure.ac
+--- vlc-3.0.13.orig/configure.ac 2021-04-27 15:18:39.000000000 +0200
++++ vlc-3.0.13/configure.ac 2021-05-03 16:26:26.691200904 +0200
+@@ -1825,7 +1825,7 @@
+ AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable RTSP input support.])
+ ])
+ ], [
+- other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
++ other_libs="-lcrypto -lssl -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
+ other_libs_pic="-lgroupsock_pic -lBasicUsageEnvironment_pic -lUsageEnvironment_pic"
+ AS_IF([test "${SYS}" = "mingw32"], [
+ # add ws2_32 for closesocket, select, recv
+diff -ru vlc-3.0.13.orig/modules/access/live555.cpp vlc-3.0.13/modules/access/live555.cpp
+--- vlc-3.0.13.orig/modules/access/live555.cpp 2019-03-29 20:01:15.000000000 +0100
++++ vlc-3.0.13/modules/access/live555.cpp 2021-05-03 16:04:38.030121796 +0200
+@@ -852,7 +852,9 @@
+ if( !p_sys->b_multicast )
+ {
+ /* We need different rollover behaviour for multicast */
+- p_sys->b_multicast = IsMulticastAddress( sub->connectionEndpointAddress() );
++ struct sockaddr_storage tempAddr;
++ sub->getConnectionEndpointAddress(tempAddr);
++ p_sys->b_multicast = IsMulticastAddress( tempAddr );
+ }
+
+ tk = (live_track_t*)malloc( sizeof( live_track_t ) );
diff --git a/repo/vlc/vlc.confd b/repo/vlc/vlc.confd
new file mode 100644
index 0000000..9a58842
--- /dev/null
+++ b/repo/vlc/vlc.confd
@@ -0,0 +1,15 @@
+# Sample vlc params suitable for running as a daemon
+
+## --file-logging enable file logging
+## --logfile logfile name/path
+## -vvv verbose logging
+## -I dummy disable X11 interface
+## --sout PARAMS encoding parameters
+
+
+## Do NOT quote 'PARAMS' otherwise shell expansions will broke vlc
+##
+## The --daemon option will automatically be added so no need to add it
+## here.
+
+VLC_OPTS="--quiet -I dummy alsa://hw:0,0 --file-logging --logfile /var/log/vlc/vlc.log --sout #transcode{acodec=mp3,ab=48,channels=1,samplerate=22050}:std{access=http,mux=ogg,dst=:8080}"
diff --git a/repo/vlc/vlc.initd b/repo/vlc/vlc.initd
new file mode 100644
index 0000000..541a071
--- /dev/null
+++ b/repo/vlc/vlc.initd
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+
+description="VideoLAN daemon"
+pidfile="/var/run/vlc/${RC_SVCNAME}.pid"
+command="/usr/bin/vlc"
+
+depend() {
+ need net
+ after firewall
+}
+
+start_pre() {
+ checkpath --directory --owner vlc:vlc --mode 775 ${pidfile%/*}
+}
+
+start() {
+ ebegin "Starting ${RC_SVCNAME}"
+ start-stop-daemon --start \
+ --user vlc \
+ --pidfile ${pidfile} \
+ --exec ${command} \
+ -- \
+ --daemon --pidfile ${pidfile} ${VLC_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${RC_SVCNAME}"
+ start-stop-daemon --stop \
+ --pidfile ${pidfile}
+ eend $?
+}
diff --git a/repo/vlc/vlc.xibuild b/repo/vlc/vlc.xibuild
new file mode 100644
index 0000000..0313a2d
--- /dev/null
+++ b/repo/vlc/vlc.xibuild
@@ -0,0 +1,94 @@
+#!/bin/sh
+
+NAME="vlc"
+DESC="A multi-platform MPEG, VCD/DVD, and DivX player"
+
+MAKEDEPS="a52dec alsa-lib automake autoconf avahi bison libtool dav1d dbus faad2 ffmpeg4 flac flex freetype2 gtk3 libbluray libavc1394 libcddb libdc1394 libdvbpsi libdvdnav libdvdread libgcrypt libice libmad libmatroska libmpeg2 libnotify libogg libraw1394 librsvg libshout libsm libsrt libtheora libva libvdpau libvorbis libvpx libx11 libxext libxinerama libxml2 libxpm libxv live-media lua mesa ncurses opus pkgconfig qt5-qtbase qt5-qtsvg qt5-qtx11extras sdl2 speex speexdsp sysfsutils taglib eudev v4l-utils wayland-protocols x264 x265 xcb-util-renderutil xcb-util-keysyms xdg-utils samba gnutls pulseaudio"
+
+PKG_VER=3.0.17.3
+SOURCE="https://download.videolan.org/vlc/$PKG_VER/vlc-$PKG_VER.tar.xz"
+
+ADDITIONAL="
+check-headless.patch
+dav1d-1.0.0.patch
+disable-sub-autodetect-fuzzy-1-test.patch
+fribidi_allow_deprecated.patch
+omxil-rpi-codecs.patch
+test-s390x.patch
+vlc-daemon.pre-install
+vlc-libs.trigger
+vlc-live-media-2021.patch
+vlc.confd
+vlc.initd
+"
+
+prepare() {
+ apply_patches
+ NOCONFIGURE=1 ./bootstrap
+}
+
+build() {
+ local _arch_opts=
+ export CFLAGS="$CFLAGS -D_GNU_SOURCE -fcommon"
+
+ case "$CARCH" in
+ arm*) _arch_opts="--enable-omxil --enable-omxil-vout --enable-rpi-omxil" ;;
+ esac
+
+ #LUA=lua5.2 \
+ #LUAC=luac5.2 \
+ BUILDCC="${CC:-gcc} -std=c99" \
+ ./configure \
+ --prefix=/usr \
+ --disable-nls \
+ --disable-rpath \
+ --enable-a52 \
+ --enable-avcodec \
+ --enable-avformat \
+ --enable-bluray \
+ --enable-dav1d \
+ --enable-dbus \
+ --enable-dc1394 \
+ --enable-dvbpsi \
+ --enable-dvdread \
+ --enable-dvdnav \
+ --enable-faad \
+ --enable-flac \
+ --enable-libcddb \
+ --enable-libva \
+ --enable-live555 \
+ --enable-merge-ffmpeg \
+ --enable-ncurses \
+ --enable-realrtsp \
+ --enable-shout \
+ --enable-skins2 \
+ --enable-speex \
+ --enable-sout \
+ --enable-srt \
+ --enable-taglib \
+ --enable-theora \
+ --enable-v4l2 \
+ --enable-vdpau \
+ --enable-vlm \
+ --enable-vorbis \
+ --enable-wma-fixed \
+ --enable-x264 \
+ --enable-xvideo \
+ --enable-gnutls \
+ $_arch_opts
+
+ make
+}
+
+package() {
+ make DESTDIR="$PKG_DEST" install
+ # delete cache as it's autocreated by trigger
+ rm -rf "$PKG_DEST"/usr/lib/vlc/plugins/plugins.dat
+ # delete unneeded mozilla and kde support files
+ rm -rf "$PKG_DEST"/usr/lib/mozilla
+ rm -rf "$PKG_DEST"/usr/share/kde4
+}
+
+check() {
+ make check
+}