From 5d7ad6b5aef51df4dccbe31237cdbd9d3092c8c7 Mon Sep 17 00:00:00 2001 From: omartijn <44672243+omartijn@users.noreply.github.com> Date: Mon, 14 Nov 2022 23:29:28 +0100 Subject: [PATCH] [ffmpeg] Update to 4.4.3 (#27713) * 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 Co-authored-by: Javier Matos Denizac --- ports/ffmpeg/0001-create-lib-libraries.patch | 4 +- ports/ffmpeg/0003-fix-windowsinclude.patch | 4 +- ports/ffmpeg/0004-fix-debug-build.patch | 8 ++-- ports/ffmpeg/0006-fix-StaticFeatures.patch | 12 +++--- ports/ffmpeg/0007-fix-lib-naming.patch | 4 +- ports/ffmpeg/0009-Fix-fdk-detection.patch | 5 +-- ports/ffmpeg/0010-Fix-x264-detection.patch | 5 +-- ports/ffmpeg/0011-Fix-x265-detection.patch | 5 +-- ports/ffmpeg/0012-Fix-ssl-110-detection.patch | 5 +-- ports/ffmpeg/0013-define-WINVER.patch | 7 +-- .../ffmpeg/0014-avfilter-dependency-fix.patch | 4 +- ports/ffmpeg/0015-Fix-xml2-detection.patch | 8 +--- .../0016-configure-dnn-needs-avformat.patch | 25 ----------- ...-9019-CUDA-Compile-Broken-Using-MSVC.patch | 18 +------- ...ibaom-Dont-use-aom_codec_av1_dx_algo.patch | 17 +------- ...-not-explicitly-set-X264_API_IMPORTS.patch | 21 ++------- .../ffmpeg/0020-fix-aarch64-libswscale.patch | 4 +- .../ffmpeg/0021-fix-sdl2-version-check.patch | 13 ------ ...0022-fix-m1-hardware-decode-nal-bits.patch | 43 +++++++++++++++++++ ports/ffmpeg/portfile.cmake | 8 ++-- ports/ffmpeg/vcpkg.json | 3 +- versions/baseline.json | 4 +- versions/f-/ffmpeg.json | 5 +++ 23 files changed, 97 insertions(+), 135 deletions(-) delete mode 100644 ports/ffmpeg/0016-configure-dnn-needs-avformat.patch delete mode 100644 ports/ffmpeg/0021-fix-sdl2-version-check.patch create mode 100644 ports/ffmpeg/0022-fix-m1-hardware-decode-nal-bits.patch diff --git a/ports/ffmpeg/0001-create-lib-libraries.patch b/ports/ffmpeg/0001-create-lib-libraries.patch index 493e24c1bb..9c2345b09d 100644 --- a/ports/ffmpeg/0001-create-lib-libraries.patch +++ b/ports/ffmpeg/0001-create-lib-libraries.patch @@ -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 diff --git a/ports/ffmpeg/0003-fix-windowsinclude.patch b/ports/ffmpeg/0003-fix-windowsinclude.patch index 8ac04c8656..b12ec027f9 100644 --- a/ports/ffmpeg/0003-fix-windowsinclude.patch +++ b/ports/ffmpeg/0003-fix-windowsinclude.patch @@ -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 #endif #ifdef _WIN32 diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index 6f921960ac..e49688f057 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -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" ;; @@ -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; } @@ -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; } diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index ce5c2f9e38..005cacdf4b 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -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 @@ -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 @@ -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 || @@ -30,7 +30,7 @@ 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 || @@ -38,7 +38,7 @@ index 3bdcfc6..00b2f13 100644 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 diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index 7e4aa7102e..f2fd7d738c 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -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 ;; diff --git a/ports/ffmpeg/0009-Fix-fdk-detection.patch b/ports/ffmpeg/0009-Fix-fdk-detection.patch index 3d280fd2b3..3169c6928d 100644 --- a/ports/ffmpeg/0009-Fix-fdk-detection.patch +++ b/ports/ffmpeg/0009-Fix-fdk-detection.patch @@ -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 || @@ -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 - diff --git a/ports/ffmpeg/0010-Fix-x264-detection.patch b/ports/ffmpeg/0010-Fix-x264-detection.patch index 2cbf85eaf8..6b76b7fbb6 100644 --- a/ports/ffmpeg/0010-Fix-x264-detection.patch +++ b/ports/ffmpeg/0010-Fix-x264-detection.patch @@ -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 || @@ -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" - diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch index 69c6380a1f..697ece8086 100644 --- a/ports/ffmpeg/0011-Fix-x265-detection.patch +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -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" @@ -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 - diff --git a/ports/ffmpeg/0012-Fix-ssl-110-detection.patch b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch index e9dd215539..6f424607fa 100644 --- a/ports/ffmpeg/0012-Fix-ssl-110-detection.patch +++ b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch @@ -1,8 +1,8 @@ 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 || @@ -10,4 +10,3 @@ index 2be953f7e7..e075949ffc 100755 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 || - diff --git a/ports/ffmpeg/0013-define-WINVER.patch b/ports/ffmpeg/0013-define-WINVER.patch index 295a738e74..395df56e95 100644 --- a/ports/ffmpeg/0013-define-WINVER.patch +++ b/ports/ffmpeg/0013-define-WINVER.patch @@ -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 diff --git a/ports/ffmpeg/0014-avfilter-dependency-fix.patch b/ports/ffmpeg/0014-avfilter-dependency-fix.patch index bc9dc0219d..6e1921bb87 100644 --- a/ports/ffmpeg/0014-avfilter-dependency-fix.patch +++ b/ports/ffmpeg/0014-avfilter-dependency-fix.patch @@ -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" diff --git a/ports/ffmpeg/0015-Fix-xml2-detection.patch b/ports/ffmpeg/0015-Fix-xml2-detection.patch index 7d2f148b09..7c50105342 100644 --- a/ports/ffmpeg/0015-Fix-xml2-detection.patch +++ b/ports/ffmpeg/0015-Fix-xml2-detection.patch @@ -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."; } @@ -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 || - diff --git a/ports/ffmpeg/0016-configure-dnn-needs-avformat.patch b/ports/ffmpeg/0016-configure-dnn-needs-avformat.patch deleted file mode 100644 index e789e5bec2..0000000000 --- a/ports/ffmpeg/0016-configure-dnn-needs-avformat.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7ca15b7f337b00a71384f748d05fce89fcf15a8d Mon Sep 17 00:00:00 2001 -From: "Matthias C. M. Troffaes" -Date: Tue, 4 May 2021 13:03:17 +0100 -Subject: [PATCH] configure: dnn needs avformat - ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index 9e45c0822c..8725a94f8a 100755 ---- a/configure -+++ b/configure -@@ -2660,7 +2660,7 @@ cbs_vp9_select="cbs" - dct_select="rdft" - dirac_parse_select="golomb" - dnn_suggest="libtensorflow libopenvino" --dnn_deps="swscale" -+dnn_deps="avformat swscale" - error_resilience_select="me_cmp" - faandct_deps="faan" - faandct_select="fdctdsp" --- -2.25.1 - diff --git a/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch b/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch index c80e51ad75..718b436d48 100644 --- a/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch +++ b/ports/ffmpeg/0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch @@ -1,14 +1,3 @@ -From 6dd12a7210fb4cf2e69b6c83628021d83ba132c3 Mon Sep 17 00:00:00 2001 -From: "Don C. Bigler" -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 ---- - 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 @@ -28,10 +17,10 @@ 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_ @@ -39,6 +28,3 @@ index 1b1b140d6f..048e02355f 100755 } check_nvcc() { --- -2.26.2.windows.1 - diff --git a/ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch b/ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch index f70c2a0297..80af5abab7 100644 --- a/ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch +++ b/ports/ffmpeg/0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch @@ -1,18 +1,8 @@ -From 6ff9f56f2b0bface43c6b0810cfda458695600f3 Mon Sep 17 00:00:00 2001 -From: Matt Oliver -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) { @@ -21,6 +11,3 @@ index 75ecc08970..d6b822fda2 100644 } AVCodec ff_libaom_av1_decoder = { --- -2.33.1.windows.1 - diff --git a/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch b/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch index f3c5bf04d6..5fa6693779 100644 --- a/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch +++ b/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch @@ -1,18 +1,8 @@ -From d5fca748d76602a912590b64022560283db6fae6 Mon Sep 17 00:00:00 2001 -From: Matt Oliver -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; } @@ -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" @@ -41,6 +31,3 @@ index 21f434d06d..efbc9608c7 100644 #include #include #include --- -2.33.1.windows.1 - diff --git a/ports/ffmpeg/0020-fix-aarch64-libswscale.patch b/ports/ffmpeg/0020-fix-aarch64-libswscale.patch index 6019b06645..553b3638ed 100644 --- a/ports/ffmpeg/0020-fix-aarch64-libswscale.patch +++ b/ports/ffmpeg/0020-fix-aarch64-libswscale.patch @@ -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 diff --git a/ports/ffmpeg/0021-fix-sdl2-version-check.patch b/ports/ffmpeg/0021-fix-sdl2-version-check.patch deleted file mode 100644 index c26a155c62..0000000000 --- a/ports/ffmpeg/0021-fix-sdl2-version-check.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure b/configure -index 2829d79..697a504 100755 ---- a/configure -+++ b/configure -@@ -6589,7 +6589,7 @@ fi - - if enabled sdl2; then - SDL2_CONFIG="${cross_prefix}sdl2-config" -- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent -+ test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent - if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then - sdl2_cflags=$("${SDL2_CONFIG}" --cflags) - sdl2_extralibs=$("${SDL2_CONFIG}" --libs) diff --git a/ports/ffmpeg/0022-fix-m1-hardware-decode-nal-bits.patch b/ports/ffmpeg/0022-fix-m1-hardware-decode-nal-bits.patch new file mode 100644 index 0000000000..6b6905e69c --- /dev/null +++ b/ports/ffmpeg/0022-fix-m1-hardware-decode-nal-bits.patch @@ -0,0 +1,43 @@ +From c534d9f72a89542ed639071b1ae15893aadf1f18 Mon Sep 17 00:00:00 2001 +From: rcombs +Date: Sat, 16 Apr 2022 03:41:29 -0500 +Subject: [PATCH] lavc/h264_ps: always include the stop bit in [s|p]ps->data + +The VideoToolbox hwaccel needs the entire NAL (including the stop bit), +but ff_h2645_packet_split may remove it. Detect this case by looking for +bit counts divisible by 8 and insert a stop-bit-only 0x80 byte. + +Signed-off-by: rcombs +--- + libavcodec/h264_ps.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c +index 051f06692c..e16da68dec 100644 +--- a/libavcodec/h264_ps.c ++++ b/libavcodec/h264_ps.c +@@ -351,6 +351,10 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, + } + memcpy(sps->data, gb->buffer, sps->data_size); + ++ // Re-add the removed stop bit (may be used by hwaccels). ++ if (!(gb->size_in_bits & 7) && sps->data_size < sizeof(sps->data)) ++ sps->data[sps->data_size++] = 0x80; ++ + profile_idc = get_bits(gb, 8); + constraint_set_flags |= get_bits1(gb) << 0; // constraint_set0_flag + constraint_set_flags |= get_bits1(gb) << 1; // constraint_set1_flag +@@ -775,6 +779,10 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct + } + memcpy(pps->data, gb->buffer, pps->data_size); + ++ // Re-add the removed stop bit (may be used by hwaccels). ++ if (!(bit_length & 7) && pps->data_size < sizeof(pps->data)) ++ pps->data[pps->data_size++] = 0x80; ++ + pps->sps_id = get_ue_golomb_31(gb); + if ((unsigned)pps->sps_id >= MAX_SPS_COUNT || + !ps->sps_list[pps->sps_id]) { +-- +2.20.1 + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 97bc4fc174..f18677776d 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -4,8 +4,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ffmpeg/ffmpeg - REF n4.4.1 - SHA512 a53e617937f9892c5cfddb00896be9ad8a3e398dc7cf3b6c893b52ff38aff6ff0cbc61a44cd5f93d9a28f775e71ae82996a5e2b699a769c1de8f882aab34c797 + REF n4.4.3 + SHA512 46bb03d690bdf0d1ce55bfe0582edf1f50b938efcdd5708a6e5ba04154fa50ac8cff4a9e44544cfa50e7f52392c88cde9455aacd6b6e51d4944f123bdcc9297a HEAD_REF master PATCHES 0001-create-lib-libraries.patch @@ -20,12 +20,11 @@ vcpkg_from_github( 0013-define-WINVER.patch 0014-avfilter-dependency-fix.patch # https://ffmpeg.org/pipermail/ffmpeg-devel/2021-February/275819.html 0015-Fix-xml2-detection.patch - 0016-configure-dnn-needs-avformat.patch # https://ffmpeg.org/pipermail/ffmpeg-devel/2021-May/279926.html ${PATCHES} 0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch 0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch 0020-fix-aarch64-libswscale.patch - 0021-fix-sdl2-version-check.patch + 0022-fix-m1-hardware-decode-nal-bits.patch # remove in next version ) if (SOURCE_PATH MATCHES " ") @@ -708,6 +707,7 @@ function(append_dependencies_from_libs out) list(FILTER contents EXCLUDE REGEX "^postproc$") list(FILTER contents EXCLUDE REGEX "^swresample$") list(FILTER contents EXCLUDE REGEX "^swscale$") + list(FILTER contents EXCLUDE REGEX "^atomic$") if(VCPKG_TARGET_IS_WINDOWS) list(TRANSFORM contents TOLOWER) endif() diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json index 0d41392792..f98ec820ce 100644 --- a/ports/ffmpeg/vcpkg.json +++ b/ports/ffmpeg/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ffmpeg", - "version": "4.4.1", - "port-version": 22, + "version": "4.4.3", "description": [ "a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.", "FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations." diff --git a/versions/baseline.json b/versions/baseline.json index d3f3568ce5..67eac921ac 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2297,8 +2297,8 @@ "port-version": 5 }, "ffmpeg": { - "baseline": "4.4.1", - "port-version": 22 + "baseline": "4.4.3", + "port-version": 0 }, "ffnvcodec": { "baseline": "11.1.5.0", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index 095437919d..8185d37eb9 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7e5aad683e1959d2595ae4622e686cf35dbd9ea3", + "version": "4.4.3", + "port-version": 0 + }, { "git-tree": "1a56131c12116cc5ee8b86c329ee6e815ec2c17e", "version": "4.4.1",