aboutsummaryrefslogtreecommitdiffstats
path: root/community/ffmpeg
diff options
context:
space:
mode:
Diffstat (limited to 'community/ffmpeg')
-rw-r--r--community/ffmpeg/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch55
-rw-r--r--community/ffmpeg/APKBUILD242
-rw-r--r--community/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch43
-rw-r--r--community/ffmpeg/riscv-compliant-rvv.patch86
-rw-r--r--community/ffmpeg/v4l-ioctl.patch51
5 files changed, 373 insertions, 104 deletions
diff --git a/community/ffmpeg/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch b/community/ffmpeg/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
deleted file mode 100644
index 9cc6fdfcff8..00000000000
--- a/community/ffmpeg/0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From ab11be0becb90542f10d5713659b559842c53af2 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Tue, 29 Mar 2016 15:15:17 +0200
-Subject: [PATCH] libavutil: clean up unused FF_SYMVER macro
-
-There is nothing using it since commit d63443b9 (lavc: drop the
-av_fast_{re,m}alloc compatibility wrappers).
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- libavutil/internal.h | 28 ----------------------------
- 1 file changed, 28 deletions(-)
-
-diff --git a/libavutil/internal.h b/libavutil/internal.h
-index 61784b5..69d63d5 100644
---- a/libavutil/internal.h
-+++ b/libavutil/internal.h
-@@ -187,34 +187,6 @@
- #endif
-
- /**
-- * Define a function with only the non-default version specified.
-- *
-- * On systems with ELF shared libraries, all symbols exported from
-- * FFmpeg libraries are tagged with the name and major version of the
-- * library to which they belong. If a function is moved from one
-- * library to another, a wrapper must be retained in the original
-- * location to preserve binary compatibility.
-- *
-- * Functions defined with this macro will never be used to resolve
-- * symbols by the build-time linker.
-- *
-- * @param type return type of function
-- * @param name name of function
-- * @param args argument list of function
-- * @param ver version tag to assign function
-- */
--#if HAVE_SYMVER_ASM_LABEL
--# define FF_SYMVER(type, name, args, ver) \
-- type ff_##name args __asm__ (EXTERN_PREFIX #name "@" ver); \
-- type ff_##name args
--#elif HAVE_SYMVER_GNU_ASM
--# define FF_SYMVER(type, name, args, ver) \
-- __asm__ (".symver ff_" #name "," EXTERN_PREFIX #name "@" ver); \
-- type ff_##name args; \
-- type ff_##name args
--#endif
--
--/**
- * Return NULL if a threading library has not been enabled.
- * Used to disable threading functions in AVCodec definitions
- * when not needed.
---
-2.7.4
-
diff --git a/community/ffmpeg/APKBUILD b/community/ffmpeg/APKBUILD
index 8c79bee8c72..ec4418f9d0b 100644
--- a/community/ffmpeg/APKBUILD
+++ b/community/ffmpeg/APKBUILD
@@ -3,23 +3,31 @@
# Contributor: Jakub Skrzypnik <j.skrzypnik@openmailbox.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ffmpeg
-pkgver=4.4.1
-pkgrel=2
+pkgver=6.1.1
+pkgrel=6
pkgdesc="Complete and free Internet live audio and video broadcasting solution for Linux/Unix"
url="https://ffmpeg.org/"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
-options="!check" # tests/data/hls-lists.append.m3u8 fails
-subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
makedepends="
alsa-lib-dev
aom-dev
bzip2-dev
coreutils
- gnutls-dev
+ dav1d-dev
+ fontconfig-dev
+ freetype-dev
+ fribidi-dev
+ harfbuzz-dev
imlib2-dev
+ ladspa-dev
lame-dev
libass-dev
+ libbluray-dev
+ libdrm-dev
+ libopenmpt-dev
+ libplacebo-dev
+ librist-dev
libsrt-dev
libssh-dev
libtheora-dev
@@ -29,27 +37,59 @@ makedepends="
libvpx-dev
libwebp-dev
libxfixes-dev
+ libxml2-dev
+ lilv-dev
+ nasm
+ openssl-dev
opus-dev
perl-dev
+ pulseaudio-dev
+ rav1e-dev
sdl2-dev
soxr-dev
v4l-utils-dev
+ vidstab-dev
+ vulkan-loader-dev
x264-dev
x265-dev
xvidcore-dev
- yasm
+ zeromq-dev
+ zimg-dev
zlib-dev
- dav1d-dev
- vidstab-dev
- vulkan-loader-dev
"
checkdepends="rsync"
+subpackages="
+ ffplay
+ $pkgname-dev
+ $pkgname-doc
+ $pkgname-libavcodec
+ $pkgname-libavdevice
+ $pkgname-libavfilter
+ $pkgname-libavformat
+ $pkgname-libavutil
+ $pkgname-libpostproc
+ $pkgname-libswresample
+ $pkgname-libswscale
+ $pkgname-libs
+ "
source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
- 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
0001-ffbuild-libversion.sh-add-shebang.patch
+ add-av_stream_get_first_dts-for-chromium.patch
+ v4l-ioctl.patch
+ riscv-compliant-rvv.patch
"
+options="!check" # tests/data/hls-lists.append.m3u8 fails
# secfixes:
+# 6.1-r0:
+# - CVE-2023-47470
+# - CVE-2023-46407
+# 6.0.1-r0:
+# - CVE-2023-47342
+# 6.0-r0:
+# - CVE-2022-3965
+# 5.1-r1:
+# - ALPINE-14094
# 4.4.1-r0:
# - CVE-2020-20446
# - CVE-2020-20453
@@ -135,60 +175,95 @@ source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
# - CVE-2017-14223
# - CVE-2017-14225
-# This is a huge library of audio/video codecs; performance matters,
-# compiling it with -Os doesn't make sense.
-export CFLAGS=${CFLAGS/-Os/}
-export CPPFLAGS=${CPPFLAGS/-Os/}
-export CXXFLAGS=${CXXFLAGS/-Os/}
+case "$CARCH" in
+x86|armhf|armv7)
+ ;;
+*)
+ makedepends="$makedepends svt-av1-dev"
+ _svt_av1="--enable-libsvtav1"
+ ;;
+esac
-build() {
- local _dbg="--disable-debug"
- local _asm=""
- [ -n "$DEBUG" ] && _dbg="--enable-debug"
+case "$CARCH" in
+s390x)
+ ;;
+*)
+ makedepends="$makedepends libjxl-dev"
+ _jxl="--enable-libjxl"
+ ;;
+esac
+case "$CARCH" in
+x86_64)
+ makedepends="$makedepends onevpl-dev"
+ _onevpl="--enable-libvpl"
+ ;;
+esac
+
+build() {
case "$CARCH" in
- x86) _asm="--disable-asm" ;;
- mips*) _asm="--disable-asm --disable-inline-asm --disable-mipsdsp --disable-mipsdspr2 --disable-msa --disable-msa2 --disable-mipsfpu --disable-mips64r6 --disable-mips64r2" ;;
+ x86) local asm="--disable-asm" ;;
esac
./configure \
--prefix=/usr \
- --enable-avresample \
+ --disable-librtmp \
+ --disable-lzma \
+ --disable-static \
+ --disable-stripping \
--enable-avfilter \
- --enable-gnutls \
--enable-gpl \
+ --enable-ladspa \
+ --enable-libaom \
--enable-libass \
+ --enable-libbluray \
+ --enable-libdav1d \
+ --enable-libdrm \
+ --enable-libfontconfig \
+ --enable-libfreetype \
+ --enable-libfribidi \
+ --enable-libharfbuzz \
--enable-libmp3lame \
+ --enable-libopenmpt \
+ --enable-libopus \
+ --enable-libplacebo \
+ --enable-libpulse \
+ --enable-librav1e \
+ --enable-librist \
+ --enable-libsoxr \
+ --enable-libsrt \
+ --enable-libssh \
+ --enable-libtheora \
+ --enable-libv4l2 \
+ --enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
- --enable-libxvid \
+ --enable-libwebp \
--enable-libx264 \
--enable-libx265 \
- --enable-libtheora \
- --enable-libv4l2 \
- --enable-libdav1d \
- --enable-postproc \
+ --enable-libxcb \
+ --enable-libxml2 \
+ --enable-libxvid \
+ --enable-libzimg \
+ --enable-libzmq \
+ --enable-lto=auto \
+ --enable-lv2 \
+ --enable-openssl \
--enable-pic \
+ --enable-postproc \
--enable-pthreads \
--enable-shared \
- --enable-libxcb \
- --enable-libsrt \
- --enable-libssh \
- --enable-libvidstab \
- --disable-stripping \
- --disable-static \
- --disable-librtmp \
- --enable-libaom \
- --enable-libopus \
- --enable-libsoxr \
- --enable-libwebp \
--enable-vaapi \
--enable-vdpau \
+ --enable-version3 \
--enable-vulkan \
- $_asm $_dbg
+ --optflags="-O3" \
+ $_jxl \
+ $asm \
+ $_svt_av1 \
+ $_onevpl
make
- ${CC:-gcc} -o tools/qt-faststart $CFLAGS tools/qt-faststart.c
- make doc/ffmpeg.1 doc/ffplay.1
+ ${CC:-gcc} -o tools/qt-faststart $CFLAGS $LDFLAGS tools/qt-faststart.c
}
# https://ffmpeg.org/fate.html
@@ -203,18 +278,87 @@ check() {
package() {
make DESTDIR="$pkgdir" install install-man
install -D -m755 tools/qt-faststart "$pkgdir/usr/bin/qt-faststart"
-# strip --strip-debug "$pkgdir"/usr/lib/*.a
+}
+
+doc() {
+ default_doc
+
+ amove usr/share/ffmpeg/examples
+}
+
+libavcodec() {
+ pkgdesc="$pkgdesc (libavcodec library)"
+
+ amove usr/lib/libavcodec.so.*
+}
+
+libavdevice() {
+ pkgdesc="$pkgdesc (libavdevice library)"
+
+ amove usr/lib/libavdevice.so.*
+}
+
+libavfilter() {
+ pkgdesc="$pkgdesc (libavfilter library)"
+
+ amove usr/lib/libavfilter.so.*
+}
+
+libavformat() {
+ pkgdesc="$pkgdesc (libavformat library)"
+
+ amove usr/lib/libavformat.so.*
+}
+
+libavutil() {
+ pkgdesc="$pkgdesc (libavutil library)"
+
+ amove usr/lib/libavutil.so.*
+}
+
+libpostproc() {
+ pkgdesc="$pkgdesc (libpostproc library)"
+
+ amove usr/lib/libpostproc.so.*
+}
+
+libswresample() {
+ pkgdesc="$pkgdesc (libswresample library)"
+
+ amove usr/lib/libswresample.so.*
+}
+
+libswscale() {
+ pkgdesc="$pkgdesc (libswscale library)"
+
+ amove usr/lib/libswscale.so.*
}
libs() {
- pkgdesc="Libraries for ffmpeg"
- replaces="ffmpeg"
- mkdir -p "$subpkgdir"/usr
- mv "$pkgdir"/usr/lib "$subpkgdir"/usr
+ pkgdesc="compat hack for all ffmpeg libs"
+
+ mkdir -p "$subpkgdir"
+ depends="
+ $pkgname-libavcodec=$pkgver-r$pkgrel
+ $pkgname-libavdevice=$pkgver-r$pkgrel
+ $pkgname-libavfilter=$pkgver-r$pkgrel
+ $pkgname-libavformat=$pkgver-r$pkgrel
+ $pkgname-libavutil=$pkgver-r$pkgrel
+ $pkgname-libpostproc=$pkgver-r$pkgrel
+ $pkgname-libswresample=$pkgver-r$pkgrel
+ $pkgname-libswscale=$pkgver-r$pkgrel
+ "
+}
+
+ffplay() {
+ pkgdesc="$pkgdesc (example media player)"
+ amove usr/bin/ffplay
}
sha512sums="
-c651c120b71db6991ffc54abc291986e7d35d776203af327f9a28853d1d0af468ca0956e2d3d893f55a211f70a40c041d5aa9aa9664ef581302b27494be9374e ffmpeg-4.4.1.tar.xz
-1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
+fca3f8635f29182e3ae0fe843a8a53614e4b47e22c11508df3ff7cdbafbb4b5ee0d82d9b3332871f7c1032033b1cad2f67557d7c5f7f7d85e2adadca122965d5 ffmpeg-6.1.1.tar.xz
38443b570cf32b2ba8ffa9ecc5480425c7da9f93f9773fbb3f9ec5f603b369b6225f4329a1b1f34d0ef30b2c9730f25ff9cff31315ed0a89a600df8e53bd54bf 0001-ffbuild-libversion.sh-add-shebang.patch
+2804a3317a9c5fbc793af1dc7b9c13113bf8fd232f14a580ad98f25d848edf93015fd08c0aad0316e3a5439aef88ef15be3520dcbfe844791a5f03490a4c7f0b add-av_stream_get_first_dts-for-chromium.patch
+c73d751e5d2a8214f0beb1b48fac6829903d46ad7db0dddddf47013193efce487825de495a24408d9a8e3c7f78f15fe62a6c14b54efc80e63dde9903cf08e918 v4l-ioctl.patch
+f3d824511a880bf6971f35271c8f8e7001053a93be212a732b49738e990d3d4ac99a302f28002f588e2cb5a2c01d22db159c1990853f3a201bca56a32ba6924e riscv-compliant-rvv.patch
"
diff --git a/community/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch b/community/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch
new file mode 100644
index 00000000000..1f3303c2ff8
--- /dev/null
+++ b/community/ffmpeg/add-av_stream_get_first_dts-for-chromium.patch
@@ -0,0 +1,43 @@
+Patch-Source: https://github.com/archlinux/svntogit-packages/blob/afdf00ac125851675c1599ab46545f6c58cfb655/trunk/add-av_stream_get_first_dts-for-chromium.patch
+From 95aab0fd83619408995720ce53d7a74790580220 Mon Sep 17 00:00:00 2001
+From: "liberato@chromium.org" <liberato@chromium.org>
+Date: Wed, 7 Jul 2021 19:01:22 -0700
+Subject: [PATCH] Add av_stream_get_first_dts for Chromium
+
+[foutrelis: adjust for new FFStream struct replacing AVStreamInternal]
+---
+ libavformat/avformat.h | 4 ++++
+ libavformat/utils.c | 7 +++++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/libavformat/avformat.h b/libavformat/avformat.h
+index cd7b0d941c..b4a6dce885 100644
+--- a/libavformat/avformat.h
++++ b/libavformat/avformat.h
+@@ -1010,6 +1010,10 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
+ */
+ 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
+
+ /**
+--- a/libavformat/demux_utils.c
++++ b/libavformat/demux_utils.c
+@@ -29,6 +29,13 @@
+ #include "demux.h"
+ #include "internal.h"
+
++// 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 ^^^
++
+ struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
+ {
+ return cffstream(st)->parser;
diff --git a/community/ffmpeg/riscv-compliant-rvv.patch b/community/ffmpeg/riscv-compliant-rvv.patch
new file mode 100644
index 00000000000..abd8f40d146
--- /dev/null
+++ b/community/ffmpeg/riscv-compliant-rvv.patch
@@ -0,0 +1,86 @@
+diff --git a/libavutil/riscv/Makefile b/libavutil/riscv/Makefile
+index 1597154..6294b5d 100644
+--- a/libavutil/riscv/Makefile
++++ b/libavutil/riscv/Makefile
+@@ -2,4 +2,5 @@ OBJS += riscv/float_dsp_init.o \
+ riscv/fixed_dsp_init.o \
+ riscv/cpu.o
+ RVV-OBJS += riscv/float_dsp_rvv.o \
+- riscv/fixed_dsp_rvv.o
++ riscv/fixed_dsp_rvv.o \
++ riscv/cpu_rvv.o
+diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c
+index fa45c0a..76485fd 100644
+--- a/libavutil/riscv/cpu.c
++++ b/libavutil/riscv/cpu.c
+@@ -28,6 +28,8 @@
+ #define HWCAP_RV(letter) (1ul << ((letter) - 'A'))
+ #endif
+
++int ff_has_compliant_rvv(void);
++
+ int ff_get_cpu_flags_riscv(void)
+ {
+ int ret = 0;
+@@ -44,7 +46,7 @@ int ff_get_cpu_flags_riscv(void)
+ ret |= AV_CPU_FLAG_RVB_ADDR | AV_CPU_FLAG_RVB_BASIC;
+
+ /* The V extension implies all Zve* functional subsets */
+- if (hwcap & HWCAP_RV('V'))
++ if ((hwcap & HWCAP_RV('V')) && ff_has_compliant_rvv())
+ ret |= AV_CPU_FLAG_RVV_I32 | AV_CPU_FLAG_RVV_I64
+ | AV_CPU_FLAG_RVV_F32 | AV_CPU_FLAG_RVV_F64;
+ #endif
+diff --git a/libavutil/riscv/cpu_rvv.S b/libavutil/riscv/cpu_rvv.S
+new file mode 100644
+index 0000000..0b25e00
+--- /dev/null
++++ b/libavutil/riscv/cpu_rvv.S
+@@ -0,0 +1,47 @@
++/******************************************************************************
++ * Copyright © 2018, VideoLAN and dav1d authors
++ * Copyright © 2024, Nathan Egge
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright notice, this
++ * list of conditions and the following disclaimer.
++ *
++ * 2. Redistributions in binary form must reproduce the above copyright notice,
++ * this list of conditions and the following disclaimer in the documentation
++ * and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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.
++ *****************************************************************************/
++
++#include "asm.S"
++
++#define L(x) .L ## x
++
++// This function detects non-compliant RVV 0.7.1 hardware which reports support
++// for the V extension through HWCAP, by intentionally setting tail and mask
++// agnostic vector configurations that were only introduced in RVV 0.9 spec.
++// Existing non-compliant (pre RVV 1.0) hardware will set the VILL bit in VTYPE
++// (indicating an illegal vector configuration) which is stored in the XLEN-1
++// bit position, thus a simple sign check is sufficient for detection.
++// The same code will work on RV32 if there is ever non-compliant rv32gcv.
++func ff_has_compliant_rvv, ext=v
++ vsetvli zero, zero, e8, m1, ta, ma
++ csrr a1, vtype
++ li a0, 0
++ blt a1, x0, L(rvv071)
++ li a0, 1
++L(rvv071):
++ ret
++endfunc
diff --git a/community/ffmpeg/v4l-ioctl.patch b/community/ffmpeg/v4l-ioctl.patch
new file mode 100644
index 00000000000..791f5a5e020
--- /dev/null
+++ b/community/ffmpeg/v4l-ioctl.patch
@@ -0,0 +1,51 @@
+Patch-Source: https://github.com/chimera-linux/cports/blob/493e4aa53465d9a3e083b1b6f69c7990f675c51b/main/ffmpeg/patches/v4l-ioctl.patch
+--
+commit 8a48dfff8f68f075d7277b21589de175b76493c1
+Author: Daniel Kolesa <daniel@octaforge.org>
+Date: Sat Jun 17 15:33:56 2023 +0200
+
+ unify ioctl interface with v4l2 on musl
+
+diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
+index 5e85d1a..ee4d362 100644
+--- a/libavdevice/v4l2.c
++++ b/libavdevice/v4l2.c
+@@ -31,6 +31,7 @@
+ */
+
+ #include <stdatomic.h>
++#include <stdarg.h>
+
+ #include "libavutil/avassert.h"
+ #include "libavutil/avstring.h"
+@@ -107,11 +108,7 @@ struct video_data {
+ int (*open_f)(const char *file, int oflag, ...);
+ int (*close_f)(int fd);
+ int (*dup_f)(int fd);
+-#ifdef __GLIBC__
+ int (*ioctl_f)(int fd, unsigned long int request, ...);
+-#else
+- int (*ioctl_f)(int fd, int request, ...);
+-#endif
+ ssize_t (*read_f)(int fd, void *buffer, size_t n);
+ void *(*mmap_f)(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
+ int (*munmap_f)(void *_start, size_t length);
+@@ -122,6 +119,18 @@ struct buff_data {
+ int index;
+ };
+
++/* ffs */
++static int ioctl_wrapper(int fd, unsigned long request, ...)
++{
++ void *arg;
++ va_list ap;
++ va_start(ap, request);
++ arg = va_arg(ap, void *);
++ va_end(ap);
++ return ioctl(fd, request, arg);
++}
++#define ioctl ioctl_wrapper
++
+ static int device_open(AVFormatContext *ctx, const char* device_path)
+ {
+ struct video_data *s = ctx->priv_data;