From c5175175de3f699a3fc50b69134ba4c9e9c09380 Mon Sep 17 00:00:00 2001 From: Jarne Demeulemeester Date: Mon, 30 Sep 2024 20:30:16 +0200 Subject: [PATCH] chore: update ffmpeg and mbedtls ffmpeg 7.0.2 -> 7.1 mbedtls 3.5.2 -> 3.6.1 --- buildscripts/include/depinfo.sh | 4 +- buildscripts/include/download-deps.sh | 4 +- ...odecdec-call-MediaCodec.stop-on-close.diff | 43 ------------- .../mbedtls/mbedtls_fix_x86_compilation.patch | 63 ------------------- 4 files changed, 4 insertions(+), 110 deletions(-) delete mode 100644 buildscripts/patches/ffmpeg/FFmpeg-devel-v2-avcodec-mediacodecdec-call-MediaCodec.stop-on-close.diff delete mode 100644 buildscripts/patches/mbedtls/mbedtls_fix_x86_compilation.patch diff --git a/buildscripts/include/depinfo.sh b/buildscripts/include/depinfo.sh index 9471cfa..68804c8 100755 --- a/buildscripts/include/depinfo.sh +++ b/buildscripts/include/depinfo.sh @@ -11,10 +11,10 @@ v_libass=0.17.3 v_harfbuzz=10.0.1 v_fribidi=1.0.16 v_freetype=2-13-3 -v_mbedtls=3.5.2 +v_mbedtls=3.6.1 v_libplacebo=7.349.0 v_dav1d=1.4.3 -v_ffmpeg=7.0.2 +v_ffmpeg=7.1 v_mpv=0.39.0 diff --git a/buildscripts/include/download-deps.sh b/buildscripts/include/download-deps.sh index b38c717..365f53e 100755 --- a/buildscripts/include/download-deps.sh +++ b/buildscripts/include/download-deps.sh @@ -7,7 +7,7 @@ mkdir -p deps && cd deps # mbedtls -[ ! -d mbedtls ] && git clone --depth 1 --branch v$v_mbedtls https://github.com/Mbed-TLS/mbedtls.git mbedtls +[ ! -d mbedtls ] && git clone --depth 1 --branch v$v_mbedtls --recurse-submodules https://github.com/Mbed-TLS/mbedtls.git mbedtls # dav1d [ ! -d dav1d ] && git clone --depth 1 --branch $v_dav1d https://code.videolan.org/videolan/dav1d.git dav1d @@ -34,7 +34,7 @@ if [ ! -d lua ]; then tar -xz -C lua --strip-components=1 fi -[ ! -d libplacebo ] && git clone --depth 1 --branch v$v_libplacebo --recursive https://code.videolan.org/videolan/libplacebo.git libplacebo +[ ! -d libplacebo ] && git clone --depth 1 --branch v$v_libplacebo --recurse-submodules https://code.videolan.org/videolan/libplacebo.git libplacebo # mpv [ ! -d mpv ] && git clone --depth 1 --branch v$v_mpv https://github.com/mpv-player/mpv.git mpv diff --git a/buildscripts/patches/ffmpeg/FFmpeg-devel-v2-avcodec-mediacodecdec-call-MediaCodec.stop-on-close.diff b/buildscripts/patches/ffmpeg/FFmpeg-devel-v2-avcodec-mediacodecdec-call-MediaCodec.stop-on-close.diff deleted file mode 100644 index 8b340f5..0000000 --- a/buildscripts/patches/ffmpeg/FFmpeg-devel-v2-avcodec-mediacodecdec-call-MediaCodec.stop-on-close.diff +++ /dev/null @@ -1,43 +0,0 @@ -From 9aa111c400cc3245edf870c431a5e271432ef5f2 Mon Sep 17 00:00:00 2001 -From: sfan5 -Date: Wed, 7 Aug 2024 17:48:06 +0200 -Subject: [PATCH v2] avcodec/mediacodecdec: call MediaCodec.stop on close - -Usually the MediaCodec context will be released immediately, or it needs to stay -alive due to existing hardware buffers. - -However we can free resources early in the case of -hw_buffer_count == 0 && refcount > 1, which can be reproduced by keeping frames -referenced after flushing and closing. mpv currently behaves like this. - -Signed-off-by: sfan5 ---- - libavcodec/mediacodecdec_common.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c -index d6f91e6e89..c888dea8cf 100644 ---- a/libavcodec/mediacodecdec_common.c -+++ b/libavcodec/mediacodecdec_common.c -@@ -841,6 +841,18 @@ int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s) - - int ff_mediacodec_dec_close(AVCodecContext *avctx, MediaCodecDecContext *s) - { -+ if (!s) -+ return 0; -+ -+ if (s->codec) { -+ if (atomic_load(&s->hw_buffer_count) == 0) { -+ ff_AMediaCodec_stop(s->codec); -+ av_log(avctx, AV_LOG_DEBUG, "MediaCodec %p stopped\n", s->codec); -+ } else { -+ av_log(avctx, AV_LOG_DEBUG, "Not stopping MediaCodec (there are buffers pending)\n"); -+ } -+ } -+ - ff_mediacodec_dec_unref(s); - - return 0; --- -2.46.0 - diff --git a/buildscripts/patches/mbedtls/mbedtls_fix_x86_compilation.patch b/buildscripts/patches/mbedtls/mbedtls_fix_x86_compilation.patch deleted file mode 100644 index aa88820..0000000 --- a/buildscripts/patches/mbedtls/mbedtls_fix_x86_compilation.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/library/aesni.c b/library/aesni.c -index 59bcd3d..f787497 100644 ---- a/library/aesni.c -+++ b/library/aesni.c -@@ -29,6 +29,17 @@ - #include - #endif - -+#if defined(MBEDTLS_ARCH_IS_X86) -+#if defined(MBEDTLS_COMPILER_IS_GCC) -+#pragma GCC push_options -+#pragma GCC target ("pclmul,sse2,aes") -+#define MBEDTLS_POP_TARGET_PRAGMA -+#elif defined(__clang__) -+#pragma clang attribute push (__attribute__((target("pclmul,sse2,aes"))), apply_to=function) -+#define MBEDTLS_POP_TARGET_PRAGMA -+#endif -+#endif -+ - #if !defined(MBEDTLS_AES_USE_HARDWARE_ONLY) - /* - * AES-NI support detection routine -@@ -384,6 +395,15 @@ static void aesni_setkey_enc_256(unsigned char *rk_bytes, - } - #endif /* !MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */ - -+#if defined(MBEDTLS_POP_TARGET_PRAGMA) -+#if defined(__clang__) -+#pragma clang attribute pop -+#elif defined(__GNUC__) -+#pragma GCC pop_options -+#endif -+#undef MBEDTLS_POP_TARGET_PRAGMA -+#endif -+ - #else /* MBEDTLS_AESNI_HAVE_CODE == 1 */ - - #if defined(__has_feature) -diff --git a/library/aesni.h b/library/aesni.h -index 165859a..1a116cf 100644 ---- a/library/aesni.h -+++ b/library/aesni.h -@@ -39,6 +39,11 @@ - #define MBEDTLS_AESNI_HAVE_INTRINSICS - #endif - -+/* For 32-bit, we only support intrinsics */ -+#if defined(MBEDTLS_ARCH_IS_X86) && (defined(__GNUC__) || defined(__clang__)) -+#define MBEDTLS_AESNI_HAVE_INTRINSICS -+#endif -+ - /* Choose the implementation of AESNI, if one is available. - * - * Favor the intrinsics-based implementation if it's available, for better -@@ -48,7 +53,7 @@ - #if defined(MBEDTLS_AESNI_HAVE_INTRINSICS) - #define MBEDTLS_AESNI_HAVE_CODE 2 // via intrinsics - #elif defined(MBEDTLS_HAVE_ASM) && \ -- defined(__GNUC__) && defined(MBEDTLS_ARCH_IS_X64) -+ (defined(__GNUC__) || defined(__clang__)) && defined(MBEDTLS_ARCH_IS_X64) - /* Can we do AESNI with inline assembly? - * (Only implemented with gas syntax, only for 64-bit.) - */