From c66e3c2eea8a82d78e6700d69af691ee9dfd689e Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Sat, 3 Aug 2024 03:56:16 +1000 Subject: [PATCH] [ffmpeg] Update to 7.0. (#38011) --- ports/aubio/ffmpeg7.patch | 15 +++++++++++++++ ports/aubio/portfile.cmake | 6 ++++-- ports/aubio/vcpkg.json | 3 +-- ports/ffmpeg/0004-dependencies.patch | 6 +++--- ports/ffmpeg/0005-fix-nasm.patch | 13 +++++++++++++ ports/ffmpeg/0007-fix-lib-naming.patch | 4 ++-- ports/ffmpeg/0024-fix-osx-host-c11.patch | 15 +++++++++++++++ ...av_stream_get_first_dts-for-chromium.patch | 16 ++++++++-------- ports/ffmpeg/portfile.cmake | 13 +++++++------ ports/ffmpeg/vcpkg.json | 19 +++++++++---------- versions/a-/aubio.json | 5 +++++ versions/baseline.json | 8 ++++---- versions/f-/ffmpeg.json | 5 +++++ 13 files changed, 91 insertions(+), 37 deletions(-) create mode 100644 ports/aubio/ffmpeg7.patch create mode 100644 ports/ffmpeg/0024-fix-osx-host-c11.patch diff --git a/ports/aubio/ffmpeg7.patch b/ports/aubio/ffmpeg7.patch new file mode 100644 index 0000000000..cf0fe6ed68 --- /dev/null +++ b/ports/aubio/ffmpeg7.patch @@ -0,0 +1,15 @@ +diff --git a/src/io/source_avcodec.c b/src/io/source_avcodec.c +index 71ea8b5f..ad91f5eb 100644 +--- a/src/io/source_avcodec.c ++++ b/src/io/source_avcodec.c +@@ -345,8 +345,8 @@ void aubio_source_avcodec_reset_resampler(aubio_source_avcodec_t * s) + av_channel_layout_default(&input_layout, s->input_channels); + av_channel_layout_default(&output_layout, s->input_channels); + +- av_opt_set_chlayout(avr, "in_channel_layout", &input_layout, 0); +- av_opt_set_chlayout(avr, "out_channel_layout", &output_layout, 0); ++ av_opt_set_chlayout(avr, "in_chlayout", &input_layout, 0); ++ av_opt_set_chlayout(avr, "out_chlayout", &output_layout, 0); + #else + int64_t input_layout = av_get_default_channel_layout(s->input_channels); + int64_t output_layout = av_get_default_channel_layout(s->input_channels); diff --git a/ports/aubio/portfile.cmake b/ports/aubio/portfile.cmake index 26d4fa9bf7..59128ae790 100644 --- a/ports/aubio/portfile.cmake +++ b/ports/aubio/portfile.cmake @@ -3,9 +3,11 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO aubio/aubio - REF 8a05420e5dd8c7b8b2447f82dc919765876511b3 - SHA512 080775d7b972d31d88671b4a2917e926bc933b7bdc50fc56a4a8e3174b4544fd6fd416c06b064488cea777cbdd4eea63d0b35eca0025f53ab71da0ba8b64824f + REF 152d6819b360c2e7b379ee3f373d444ab3df0895 + SHA512 923529eb27e460293bd2b8b8c53d5eb96553e3e1ece7071904808d8f20f86b7af70bde97d271da9a07ee1898d0840190f265e326e67f48c6f5cadefa034abf0f HEAD_REF master + PATCHES + ffmpeg7.patch ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") diff --git a/ports/aubio/vcpkg.json b/ports/aubio/vcpkg.json index b03cc7149d..04188776c1 100644 --- a/ports/aubio/vcpkg.json +++ b/ports/aubio/vcpkg.json @@ -1,7 +1,6 @@ { "name": "aubio", - "version-date": "2022-01-26", - "port-version": 1, + "version-date": "2024-01-03", "description": "Aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.", "homepage": "https://github.com/aubio/aubio", "license": "GPL-3.0-or-later", diff --git a/ports/ffmpeg/0004-dependencies.patch b/ports/ffmpeg/0004-dependencies.patch index 1c40445139..bf91f88bda 100644 --- a/ports/ffmpeg/0004-dependencies.patch +++ b/ports/ffmpeg/0004-dependencies.patch @@ -21,10 +21,10 @@ index a8b74e0..c99f41c 100755 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 -lnppif || -@@ -6772,7 +6773,7 @@ enabled libopencv && { check_headers opencv2/core/core_c.h && - enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion +@@ -6772,7 +6773,7 @@ require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; } + enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version || - { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } } + { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } } -enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++" +enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } || diff --git a/ports/ffmpeg/0005-fix-nasm.patch b/ports/ffmpeg/0005-fix-nasm.patch index 9308e714a6..ea551ec9a8 100644 --- a/ports/ffmpeg/0005-fix-nasm.patch +++ b/ports/ffmpeg/0005-fix-nasm.patch @@ -53,3 +53,16 @@ diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile X86ASM-OBJS-$(CONFIG_OVERLAY_FILTER) += x86/vf_overlay.o X86ASM-OBJS-$(CONFIG_PP7_FILTER) += x86/vf_pp7.o X86ASM-OBJS-$(CONFIG_PSNR_FILTER) += x86/vf_psnr.o +diff --git a/libavcodec/x86/vvc/Makefile b/libavcodec/x86/vvc/Makefile +--- a/libavcodec/x86/vvc/Makefile ++++ b/libavcodec/x86/vvc/Makefile +@@ -3,5 +3,7 @@ clean:: + + OBJS-$(CONFIG_VVC_DECODER) += x86/vvc/vvcdsp_init.o \ + x86/h26x/h2656dsp.o +-X86ASM-OBJS-$(CONFIG_VVC_DECODER) += x86/vvc/vvc_mc.o \ +- x86/h26x/h2656_inter.o ++ifdef ARCH_X86_64 ++X86ASM-OBJS-$(CONFIG_VVC_DECODER) += x86/vvc/vvc_mc.o ++endif ++X86ASM-OBJS-$(CONFIG_VVC_DECODER) += x86/h26x/h2656_inter.o diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index d25f6039a9..c22f9c1999 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -2,8 +2,8 @@ diff --git a/configure b/configure index d6c4388..75b96c3 100644 --- a/configure +++ b/configure -@@ -4378,6 +4378,7 @@ msvc_common_flags(){ - -march=*) ;; +@@ -4781,6 +4781,7 @@ msvc_common_flags(){ + -mfp16-format=*) ;; -lz) echo zlib.lib ;; -lx264) echo libx264.lib ;; + -lmp3lame) echo libmp3lame.lib ;; diff --git a/ports/ffmpeg/0024-fix-osx-host-c11.patch b/ports/ffmpeg/0024-fix-osx-host-c11.patch new file mode 100644 index 0000000000..dbce2f53b8 --- /dev/null +++ b/ports/ffmpeg/0024-fix-osx-host-c11.patch @@ -0,0 +1,15 @@ +diff --git a/configure b/configure +index 4f5353f84b..dd9147c677 100755 +--- a/configure ++++ b/configure +@@ -5607,8 +5607,8 @@ check_cppflags -D_FILE_OFFSET_BITS=64 + check_cppflags -D_LARGEFILE_SOURCE + + add_host_cppflags -D_ISOC11_SOURCE + check_host_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" || +- check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" || die "Host compiler lacks C11 support" ++ check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" + + check_host_cflags -Wall + check_host_cflags $host_cflags_speed + diff --git a/ports/ffmpeg/0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch b/ports/ffmpeg/0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch index 0ac28ab0b3..c2e1d8ff0d 100644 --- a/ports/ffmpeg/0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch +++ b/ports/ffmpeg/0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch @@ -2,10 +2,10 @@ diff --git a/libavformat/avformat.h b/libavformat/avformat.h index cd7b0d941c..b4a6dce885 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h -@@ -1010,7 +1010,11 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); - attribute_deprecated - int64_t av_stream_get_end_pts(const AVStream *st); - #endif +@@ -1169,7 +1169,11 @@ typedef struct AVStreamGroup { + } AVStreamGroup; + + struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st); @@ -18,10 +18,10 @@ diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c index de7580c32d..0ef0fe530e 100644 --- a/libavformat/mux_utils.c +++ b/libavformat/mux_utils.c -@@ -33,7 +33,14 @@ int64_t av_stream_get_end_pts(const AVStream *st) - return AV_NOPTS_VALUE; - } - #endif +@@ -29,7 +29,14 @@ #include "avformat.h" + #include "avio.h" + #include "internal.h" + #include "mux.h" +// Chromium: We use the internal field first_dts vvv +int64_t av_stream_get_first_dts(const AVStream *st) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 4d1b9c716f..503b8843c9 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -2,18 +2,19 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ffmpeg/ffmpeg REF "n${VERSION}" - SHA512 a84209fe36a2a0262ebc34b727e7600b12d4739991a95599d7b4df533791b12e2e43586ccc6ff26aab2f935a3049866204e322ec0c5e49e378fc175ded34e183 + SHA512 ac147e52557b71cab0a38c0fee5f710a70d7e99107d1cb881e733c489a6b16f99d2c15e00e359ab48353bd710ead13399ee31840e6c5844a11d042eda71a0aa0 HEAD_REF master PATCHES 0001-create-lib-libraries.patch - 0002-fix-msvc-link.patch #upstreamed in future version + 0002-fix-msvc-link.patch 0003-fix-windowsinclude.patch 0004-dependencies.patch - 0005-fix-nasm.patch #upstreamed in future version + 0005-fix-nasm.patch 0007-fix-lib-naming.patch 0012-Fix-ssl-110-detection.patch 0013-define-WINVER.patch 0020-fix-aarch64-libswscale.patch + 0024-fix-osx-host-c11.patch 0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch # Do not remove this patch. It is required by chromium 0041-add-const-for-opengl-definition.patch 0042-fix-arm64-linux.patch #https://github.com/FFmpeg/FFmpeg/commit/fcfd17dbb4a6cf270cdd82e91c21a5efdc878d12 @@ -49,9 +50,9 @@ if(VCPKG_TARGET_IS_MINGW) elseif(VCPKG_TARGET_IS_LINUX) string(APPEND OPTIONS " --target-os=linux --enable-pthreads") elseif(VCPKG_TARGET_IS_UWP) - string(APPEND OPTIONS " --target-os=win32 --enable-w32threads --enable-d3d11va --enable-mediafoundation") + string(APPEND OPTIONS " --target-os=win32 --enable-w32threads --enable-d3d11va --enable-d3d12va --enable-mediafoundation") elseif(VCPKG_TARGET_IS_WINDOWS) - string(APPEND OPTIONS " --target-os=win32 --enable-w32threads --enable-d3d11va --enable-dxva2 --enable-mediafoundation") + string(APPEND OPTIONS " --target-os=win32 --enable-w32threads --enable-d3d11va --enable-d3d12va --enable-dxva2 --enable-mediafoundation") elseif(VCPKG_TARGET_IS_OSX) string(APPEND OPTIONS " --target-os=darwin --enable-appkit --enable-avfoundation --enable-coreimage --enable-audiotoolbox --enable-videotoolbox") elseif(VCPKG_TARGET_IS_IOS) @@ -91,7 +92,7 @@ if(VCPKG_DETECTED_CMAKE_C_COMPILER) get_filename_component(CC_filename "${VCPKG_DETECTED_CMAKE_C_COMPILER}" NAME) set(ENV{CC} "${CC_filename}") string(APPEND OPTIONS " --cc=${CC_filename}") - #string(APPEND OPTIONS " --host_cc=${CC_filename}") ffmpeg not yet setup for cross builds? + string(APPEND OPTIONS " --host_cc=${CC_filename}") list(APPEND prog_env "${CC_path}") endif() diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json index 0746fafd1d..161d6d5382 100644 --- a/ports/ffmpeg/vcpkg.json +++ b/ports/ffmpeg/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ffmpeg", - "version": "6.1.1", - "port-version": 11, + "version": "7.0", "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." @@ -108,14 +107,6 @@ ], "platform": "!uwp" }, - { - "name": "ffmpeg", - "default-features": false, - "features": [ - "opencl" - ], - "platform": "!uwp" - }, { "name": "ffmpeg", "default-features": false, @@ -156,6 +147,14 @@ ], "platform": "!osx & !uwp" }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "opencl" + ], + "platform": "!uwp & !osx" + }, { "name": "ffmpeg", "default-features": false, diff --git a/versions/a-/aubio.json b/versions/a-/aubio.json index d8521908b2..18ffdd57fb 100644 --- a/versions/a-/aubio.json +++ b/versions/a-/aubio.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "31db883042c73ae81e74c010dca29c7fc4e273f9", + "version-date": "2024-01-03", + "port-version": 0 + }, { "git-tree": "e51e332257e4b788828390a39d86109000d5b960", "version-date": "2022-01-26", diff --git a/versions/baseline.json b/versions/baseline.json index 3d7c71cbc1..97205c2db6 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -337,8 +337,8 @@ "port-version": 0 }, "aubio": { - "baseline": "2022-01-26", - "port-version": 1 + "baseline": "2024-01-03", + "port-version": 0 }, "audiofile": { "baseline": "1.1.1", @@ -2701,8 +2701,8 @@ "port-version": 7 }, "ffmpeg": { - "baseline": "6.1.1", - "port-version": 11 + "baseline": "7.0", + "port-version": 0 }, "ffnvcodec": { "baseline": "12.1.14.0", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index dbec2ed1c7..1f37299735 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6c14224b4a8c90efabd3640a98f76eaee8607f98", + "version": "7.0", + "port-version": 0 + }, { "git-tree": "15b90b33b76e69c2d9b876b32c4c9b47c97846ed", "version": "6.1.1",