Skip to content

Commit b3999c4

Browse files
authored
Merge pull request #304 from basilgello/ffmpeg7.0-Piers
Port FFmpeg 7.0 to ffmpegdirect Piers
2 parents 3215a81 + d627df3 commit b3999c4

19 files changed

+2031
-189
lines changed

FindFFMPEG.cmake

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
#
3434

3535
# required ffmpeg library versions
36-
set(REQUIRED_FFMPEG_VERSION 5.0.0)
37-
set(_avcodec_ver ">=59.18.100")
38-
set(_avfilter_ver ">=8.24.100")
39-
set(_avformat_ver ">=59.16.100")
40-
set(_avutil_ver ">=57.17.100")
41-
set(_postproc_ver ">=56.3.100")
42-
set(_swresample_ver ">=4.3.100")
43-
set(_swscale_ver ">=6.4.100")
36+
set(REQUIRED_FFMPEG_VERSION 7.0.0)
37+
set(_avcodec_ver ">=61.3.100")
38+
set(_avfilter_ver ">=10.1.100")
39+
set(_avformat_ver ">=61.1.100")
40+
set(_avutil_ver ">=59.8.100")
41+
set(_postproc_ver ">=58.1.100")
42+
set(_swresample_ver ">=5.1.100")
43+
set(_swscale_ver ">=8.1.100")
4444

4545
# Allows building with external ffmpeg not found in system paths,
4646
# without library version checks
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From 08ae41e824e04ab48eafde763c72d1ff3e878a41 Mon Sep 17 00:00:00 2001
1+
From 6b0296b657b281cf326b96ab6cf3b8e1e6e620d2 Mon Sep 17 00:00:00 2001
22
From: Lukas Rusak <[email protected]>
33
Date: Sat, 10 Apr 2021 08:16:11 -0700
4-
Subject: [PATCH 1/4] ffmpeg: windows: configure: detect openssl
4+
Subject: [PATCH 1/3] ffmpeg: windows: configure: detect openssl
55

66
---
77
configure | 2 ++
88
1 file changed, 2 insertions(+)
99

1010
diff --git a/configure b/configure
11-
index d7a3f507e8..4b85e881b1 100755
11+
index 8642513..84d0fa4 100755
1212
--- a/configure
1313
+++ b/configure
14-
@@ -6728,6 +6728,8 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
14+
@@ -7060,6 +7060,8 @@ enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" ope
1515
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
1616
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
1717
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
@@ -21,5 +21,5 @@ index d7a3f507e8..4b85e881b1 100755
2121
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
2222
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
2323
--
24-
2.29.2
24+
2.39.2
2525

Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From 1e57e7f49f1a74ee11d3c8dd5d407f35eecd5167 Mon Sep 17 00:00:00 2001
1+
From 500820158d64749311c243e7af599077ad68085e Mon Sep 17 00:00:00 2001
22
From: Lukas Rusak <[email protected]>
33
Date: Sat, 10 Apr 2021 08:16:48 -0700
4-
Subject: [PATCH 2/4] ffmpeg: windows: configure: fix zlib conflict
4+
Subject: [PATCH 2/3] ffmpeg: windows: configure: fix zlib conflict
55

66
---
77
configure | 3 +++
88
1 file changed, 3 insertions(+)
99

1010
diff --git a/configure b/configure
11-
index 4b85e881b1..da457705d1 100755
11+
index 84d0fa4..2fcde55 100755
1212
--- a/configure
1313
+++ b/configure
14-
@@ -7825,6 +7825,9 @@ print_config CONFIG_ "$config_files" $CONFIG_LIST \
14+
@@ -8188,6 +8188,9 @@ print_config HAVE_ "$config_files" $HAVE_LIST
1515
print_config CONFIG_ "$config_files" $CONFIG_LIST \
1616
$CONFIG_EXTRA \
1717

@@ -22,5 +22,5 @@ index 4b85e881b1..da457705d1 100755
2222

2323
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
2424
--
25-
2.29.2
25+
2.39.2
2626

Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
From efb771d944e96bcbb24635bcae99a43dffab262e Mon Sep 17 00:00:00 2001
1+
From 3563feddaf8a3f473999fca61e12624def63eba4 Mon Sep 17 00:00:00 2001
22
From: Lukas Rusak <[email protected]>
33
Date: Sat, 10 Apr 2021 08:17:11 -0700
4-
Subject: [PATCH 3/4] ffmpeg: windows: configure: allow building static
4+
Subject: [PATCH 3/3] ffmpeg: windows: configure: allow building static
55

66
---
77
configure | 4 ++++
88
1 file changed, 4 insertions(+)
99

1010
diff --git a/configure b/configure
11-
index da457705d1..e3a8f45ff4 100755
11+
index 2fcde55..598439a 100755
1212
--- a/configure
1313
+++ b/configure
14-
@@ -5566,6 +5566,8 @@ case $target_os in
15-
enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres
14+
@@ -5784,6 +5784,8 @@ case $target_os in
1615
enabled x86_32 && check_ldflags -Wl,--large-address-aware
16+
add_cppflags -DWIN32_LEAN_AND_MEAN
1717
shlibdir_default="$bindir_default"
1818
+ LIBPREF=""
1919
+ LIBSUF=".lib"
2020
SLIBPREF=""
2121
SLIBSUF=".dll"
2222
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
23-
@@ -5615,6 +5617,8 @@ case $target_os in
24-
fi
23+
@@ -5835,6 +5837,8 @@ case $target_os in
2524
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
25+
add_cppflags -DWIN32_LEAN_AND_MEAN
2626
shlibdir_default="$bindir_default"
2727
+ LIBPREF=""
2828
+ LIBSUF=".lib"
2929
SLIBPREF=""
3030
SLIBSUF=".dll"
3131
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
3232
--
33-
2.29.2
33+
2.39.2
3434

depends/common/ffmpeg/0004-ffmpeg-linux-fix-asm-binutil-since-2.41.patch

-58
This file was deleted.

depends/common/ffmpeg/0005-ffmpeg-windows-dxva2-check-nullptr-surface.patch depends/common/ffmpeg/0004-ffmpeg-windows-dxva2-check-nullptr-surface.patch

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
2+
index 5902563..33dceec 100644
23
--- a/libavcodec/dxva2.c
34
+++ b/libavcodec/dxva2.c
4-
@@ -777,7 +777,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,
5+
@@ -782,7 +782,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx,
56
#if CONFIG_D3D11VA
67
if (avctx->pix_fmt == AV_PIX_FMT_D3D11)
78
return (intptr_t)frame->data[1];

depends/common/ffmpeg/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ if(NOT WIN32)
117117
list(APPEND EXTRA_CONF --arch=aarch64)
118118
list(APPEND EXTRA_CONF --disable-filter=yadif_videotoolbox)
119119
endif()
120-
list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox
120+
list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --enable-videotoolbox
121121
--target-os=darwin)
122122
elseif(CORE_SYSTEM_NAME STREQUAL osx)
123-
list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox
123+
list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --enable-videotoolbox
124124
--target-os=darwin
125125
--disable-securetransport)
126126
endif()
@@ -150,6 +150,12 @@ if(NOT WIN32)
150150
COMMAND echo "Setting HAVE_CLOCK_GETTIME to 0 for darwin_embedded using sed"
151151
COMMAND sed -i -- "s/HAVE_CLOCK_GETTIME 1/HAVE_CLOCK_GETTIME 0/g" ${CMAKE_CURRENT_BINARY_DIR}/ffmpeg-prefix/src/ffmpeg-build/config.h
152152
DEPENDEES configure)
153+
externalproject_add_step(ffmpeg
154+
DisableVVCDecoderOnAArch64
155+
COMMAND echo "Disabling AArch64 implementation of VVC (H.266) on darwin_embedded using sed"
156+
COMMAND rm ${CMAKE_SOURCE_DIR}/libavcodec/aarch64/vvc/Makefile
157+
COMMAND sed -i -- "/ff_vvc_dsp_init_aarch64/d" ${CMAKE_SOURCE_DIR}/libavcodec/vvc/dsp.c
158+
DEPENDERS configure)
153159
endif()
154160
else()
155161
find_package(MinGW REQUIRED)

depends/common/ffmpeg/ffmpeg.sha256

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9a1fa94608300e835bf89bdfcd7d77deceba67bff3494f609816f84bd69a459e
1+
7ddad2d992bd250a6c56053c26029f7e728bebf0f37f80cf3f8a0e6ec706431a

depends/common/ffmpeg/ffmpeg.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ffmpeg https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n6.0.tar.gz
1+
ffmpeg https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.1.tar.gz

depends/common/ffmpeg/readme

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ All patches are required for windows and allow both static building
22
and openssl. Note there is no impact to applying these to other platforms
33
as openssl is not used (gnutls is used for non-windows).
44

5-
Last update and patches refreshed for FFmpeg-n4.4
5+
Last update and patches refreshed for FFmpeg-n7.1
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
--- a/src/gl/fpending.c
22
+++ b/src/gl/fpending.c
3-
@@ -40,8 +40,14 @@ __fpending (FILE *fp)
3+
@@ -40,8 +40,17 @@ __fpending (FILE *fp)
44
/* GNU libc, BeOS, Haiku, Linux libc5 */
55
return fp->_IO_write_ptr - fp->_IO_write_base;
66
#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
7-
+#if defined ANDROID && __ANDROID_API__ < 23
7+
+#ifdef __ANDROID__
8+
+# include <android/api-level.h>
9+
+# if __ANDROID_API__ < 23
810
+ /* Hack fix for Kodi as it still use Android API 21 */
911
+ #warning "ANDROID API to low, no __fpending usable"
1012
+ return 1;
13+
+# endif
1114
+#else
1215
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
1316
return fp_->_p - fp_->_bf._base;
1417
+#endif
1518
#elif defined __EMX__ /* emx+gcc */
16-
return fp_->_ptr - fp_->_buffer;
19+
return fp->_ptr - fp->_buffer;
1720
#elif defined __minix /* Minix */

depends/common/gnutls/03-include-libdl-if-available.patch depends/common/gnutls/0003-include-libdl-if-available.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ diff -ur gnutls/lib/gnutls.pc.in gnutls-patched/lib/gnutls.pc.in
1818
URL: https://www.gnutls.org/
1919
Version: @VERSION@
2020
Libs: -L${libdir} -lgnutls
21-
-Libs.private: @LIBZ_PC@ @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @GNUTLS_LIBS_PRIVATE@
22-
+Libs.private: @LIBZ_PC@ @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @GNUTLS_LIBS_PRIVATE@ @LIBDL@
21+
-Libs.private: @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @GNUTLS_LIBS_PRIVATE@
22+
+Libs.private: @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @GNUTLS_LIBS_PRIVATE@ @LIBDL@
2323
@GNUTLS_REQUIRES_PRIVATE@
2424
Cflags: -I${includedir}

0 commit comments

Comments
 (0)