Skip to content

Commit

Permalink
[ffmpeg] Update to 4.4.3 (#27713)
Browse files Browse the repository at this point in the history
* Update ffmpeg to 4.4.3

- Backport fix for h.264 hardware decoding on M1 macs
- ffmpeg links against built-in atomic, not a findable lib

* add missing extension for new patch

* version!

Co-authored-by: Martijn Otto <martijn@resolume.com>
Co-authored-by: Javier Matos Denizac <javier.matosd@gmail.com>
  • Loading branch information
3 people committed Nov 14, 2022
1 parent 5ad884f commit 5d7ad6b
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 135 deletions.
4 changes: 2 additions & 2 deletions ports/ffmpeg/0001-create-lib-libraries.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index 34c2adb..1c8008a 100755
index 89af70d..405680e 100755
--- a/configure
+++ b/configure
@@ -5352,15 +5352,17 @@ case $target_os in
@@ -5480,15 +5480,17 @@ case $target_os in
;;
win32|win64)
disable symver
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/0003-fix-windowsinclude.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 9cfbc45..e3447e6 100644
index fe424b6..2df70df 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -63,6 +63,8 @@
@@ -60,6 +60,8 @@
#include <sys/resource.h>
#endif
#ifdef _WIN32
Expand Down
8 changes: 4 additions & 4 deletions ports/ffmpeg/0004-fix-debug-build.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index bd2de34..fba948a 100755
index 405680e..cc5bf29 100755
--- a/configure
+++ b/configure
@@ -3993,6 +3993,9 @@ for opt do
@@ -4111,6 +4111,9 @@ for opt do
--libfuzzer=*)
libfuzzer_path="$optval"
;;
Expand All @@ -12,7 +12,7 @@ index bd2de34..fba948a 100755
*)
optname="${opt%%=*}"
optname="${optname#--}"
@@ -6152,7 +6153,11 @@
@@ -6316,7 +6319,11 @@ fi

enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
check_lib zlib zlib.h zlibVersion -lz; }
Expand All @@ -25,7 +25,7 @@ index bd2de34..fba948a 100755
enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma

# On some systems dynamic loading requires no extra linker flags
@@ -6350,7 +6350,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
@@ -6434,7 +6441,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
Expand Down
12 changes: 6 additions & 6 deletions ports/ffmpeg/0006-fix-StaticFeatures.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index 3bdcfc6..00b2f13 100644
index cc5bf29..ee26559 100755
--- a/configure
+++ b/configure
@@ -6351,7 +6351,8 @@ if enabled libmfx; then
@@ -6406,7 +6406,8 @@ if enabled libmfx; then
fi

enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
Expand All @@ -12,7 +12,7 @@ index 3bdcfc6..00b2f13 100644
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
@@ -6392,7 +6393,7 @@ if enabled debug_configure; then
@@ -6446,7 +6447,7 @@ if enabled debug_configure; then
else
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
fi
Expand All @@ -21,7 +21,7 @@ index 3bdcfc6..00b2f13 100644
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
@@ -6460,6 +6461,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
@@ -6527,6 +6528,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
Expand All @@ -30,15 +30,15 @@ index 3bdcfc6..00b2f13 100644
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -6479,6 +6482,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
@@ -6550,6 +6553,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32||
die "ERROR: openssl not found"; }
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
@@ -6707,7 +6711,7 @@ enabled amf &&
@@ -6811,7 +6815,7 @@ enabled amf &&
if enabled libc_iconv; then
check_func_headers iconv.h iconv
elif enabled iconv; then
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/0007-fix-lib-naming.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index d6c4388..75b96c3 100644
index ee26559..f2c83b7 100755
--- a/configure
+++ b/configure
@@ -4378,6 +4378,10 @@ msvc_common_flags(){
@@ -4496,6 +4496,10 @@ msvc_common_flags(){
-march=*) ;;
-lz) echo zlib.lib ;;
-lx264) echo libx264.lib ;;
Expand Down
5 changes: 2 additions & 3 deletions ports/ffmpeg/0009-Fix-fdk-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index b137669dd3..34c92230f4 100755
index f2c83b7..5e42b12 100755
--- a/configure
+++ b/configure
@@ -6331,7 +6331,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
@@ -6379,7 +6379,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
Expand All @@ -11,4 +11,3 @@ index b137669dd3..34c92230f4 100755
warn "using libfdk without pkg-config"; } }
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs

5 changes: 2 additions & 3 deletions ports/ffmpeg/0010-Fix-x264-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index b137669dd3..34a2e644c4 100755
index 5e42b12..d8f059f 100755
--- a/configure
+++ b/configure
@@ -6443,7 +6443,7 @@ enabled libwebp && {
@@ -6497,7 +6497,7 @@ enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
Expand All @@ -11,4 +11,3 @@ index b137669dd3..34a2e644c4 100755
warn "using libx264 without pkg-config"; } } &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"

5 changes: 2 additions & 3 deletions ports/ffmpeg/0011-Fix-x265-detection.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index 34a2e644c4..0ea64bd306 100755
index d8f059f..f3688ad 100755
--- a/configure
+++ b/configure
@@ -6447,7 +6447,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
@@ -6501,7 +6501,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
warn "using libx264 without pkg-config"; } } &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
Expand All @@ -14,4 +14,3 @@ index 34a2e644c4..0ea64bd306 100755
require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get

5 changes: 2 additions & 3 deletions ports/ffmpeg/0012-Fix-ssl-110-detection.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
diff --git a/configure b/configure
index 2be953f7e7..e075949ffc 100755
index f3688ad..26e512e 100755
--- a/configure
+++ b/configure
@@ -6497,6 +6497,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
@@ -6556,6 +6556,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
enabled omx && require_headers OMX_Core.h
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl ||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||

7 changes: 4 additions & 3 deletions ports/ffmpeg/0013-define-WINVER.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
diff --color -Naur src_old/libavcodec/mf_utils.c src/libavcodec/mf_utils.c
--- src_old/libavcodec/mf_utils.c 2020-07-11 05:26:17.000000000 +0700
+++ src/libavcodec/mf_utils.c 2020-11-13 12:55:57.226976400 +0700
diff --git a/libavcodec/mf_utils.c b/libavcodec/mf_utils.c
index eeabd0c..ea3a03b 100644
--- a/libavcodec/mf_utils.c
+++ b/libavcodec/mf_utils.c
@@ -22,6 +22,11 @@
#define _WIN32_WINNT 0x0602
#endif
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/0014-avfilter-dependency-fix.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/configure b/configure
index a092a6b457..41e55b4101 100755
index 26e512e..c0377b6 100755
--- a/configure
+++ b/configure
@@ -3666,6 +3666,18 @@ vpp_qsv_filter_select="qsvvpp"
@@ -3674,6 +3674,18 @@ vpp_qsv_filter_select="qsvvpp"
xfade_opencl_filter_deps="opencl"
yadif_cuda_filter_deps="ffnvcodec"
yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
Expand Down
8 changes: 2 additions & 6 deletions ports/ffmpeg/0015-Fix-xml2-detection.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 900505756b..8d1388a347 100755
index c0377b6..62753ef 100755
--- a/configure
+++ b/configure
@@ -6476,7 +6476,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
@@ -6526,7 +6526,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
{ test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
Expand All @@ -14,4 +11,3 @@ index 900505756b..8d1388a347 100755
enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||

25 changes: 0 additions & 25 deletions ports/ffmpeg/0016-configure-dnn-needs-avformat.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
From 6dd12a7210fb4cf2e69b6c83628021d83ba132c3 Mon Sep 17 00:00:00 2001
From: "Don C. Bigler" <don.bigler@framatome.com>
Date: Fri, 4 Dec 2020 12:39:55 -0500
Subject: [PATCH] Patch for ticket #9019 CUDA Compile Broken Using MSVC

Signed-off-by: Don C. Bigler <don.bigler@framatome.com>
---
compat/cuda/ptx2c.sh | 7 ++++---
configure | 1 +
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 48452379c2..1c486dc30e 100755
--- a/compat/cuda/ptx2c.sh
Expand All @@ -28,17 +17,14 @@ index 48452379c2..1c486dc30e 100755

exit 0
diff --git a/configure b/configure
index 1b1b140d6f..048e02355f 100755
index 6190d06b0b..48fb73738e 100755
--- a/configure
+++ b/configure
@@ -1050,6 +1050,7 @@ test_nvcc(){
@@ -1046,6 +1046,7 @@ test_nvcc(){
tmpo_=$TMPO
[ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
+ test_cmd xxd
}

check_nvcc() {
--
2.26.2.windows.1

17 changes: 2 additions & 15 deletions ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
From 6ff9f56f2b0bface43c6b0810cfda458695600f3 Mon Sep 17 00:00:00 2001
From: Matt Oliver <protogonoi@gmail.com>
Date: Wed, 20 Oct 2021 06:55:48 +1100
Subject: [PATCH] libaom: Dont use aom_codec_av1_dx_algo.

This fixes linking errors where variables cannot be correctly linked in from an external shared library such as with msvc.
---
libavcodec/libaomdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 75ecc08970..d6b822fda2 100644
index 1fc0a00..06b2ff0 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -223,7 +223,7 @@ static av_cold int aom_free(AVCodecContext *avctx)
@@ -224,7 +224,7 @@ static av_cold int aom_free(AVCodecContext *avctx)

static av_cold int av1_init(AVCodecContext *avctx)
{
Expand All @@ -21,6 +11,3 @@ index 75ecc08970..d6b822fda2 100644
}

AVCodec ff_libaom_av1_decoder = {
--
2.33.1.windows.1

Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
From d5fca748d76602a912590b64022560283db6fae6 Mon Sep 17 00:00:00 2001
From: Matt Oliver <protogonoi@gmail.com>
Date: Sat, 30 Oct 2021 14:09:29 +1100
Subject: [PATCH] libx264: Do not explicitly set X264_API_IMPORTS

---
configure | 8 +++-----
libavcodec/libx264.c | 4 ----
2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index ede8f9777b..b35728aace 100755
index 62753ef..018764e 100755
--- a/configure
+++ b/configure
@@ -6535,11 +6535,8 @@ enabled libvpx && {
@@ -6508,11 +6508,8 @@ enabled libvpx && {
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
Expand All @@ -27,10 +17,10 @@ index ede8f9777b..b35728aace 100755
{ { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 21f434d06d..efbc9608c7 100644
index 4ddc497..0152d30 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -34,10 +34,6 @@
@@ -32,10 +32,6 @@
#include "packet_internal.h"
#include "atsc_a53.h"

Expand All @@ -41,6 +31,3 @@ index 21f434d06d..efbc9608c7 100644
#include <x264.h>
#include <float.h>
#include <math.h>
--
2.33.1.windows.1

4 changes: 2 additions & 2 deletions ports/ffmpeg/0020-fix-aarch64-libswscale.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
index af677afe6..f4b220fb6 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
index f4b220f..af677af 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -169,19 +169,19 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
sqdmulh v26.8H, v26.8H, v0.8H // ((Y1*(1<<3) - y_offset) * y_coeff) >> 15
Expand Down
13 changes: 0 additions & 13 deletions ports/ffmpeg/0021-fix-sdl2-version-check.patch

This file was deleted.

Loading

0 comments on commit 5d7ad6b

Please sign in to comment.