diff --git a/ports/ffmpeg/0002-fix-msvc-link.patch b/ports/ffmpeg/0002-fix-msvc-link.patch new file mode 100644 index 0000000000..c9aa7e7523 --- /dev/null +++ b/ports/ffmpeg/0002-fix-msvc-link.patch @@ -0,0 +1,11 @@ +diff --git a/configure b/configure +--- a/configure ++++ b/configure +@@ -6162,6 +6162,7 @@ EOF + test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX" + case "$objformat" in + elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;; ++ win*) enabled debug && append X86ASMFLAGS "-g" ;; + esac + + enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0" diff --git a/ports/ffmpeg/0003-fix-windowsinclude.patch b/ports/ffmpeg/0003-fix-windowsinclude.patch index 8ac04c8656..8b2e22b476 100644 --- a/ports/ffmpeg/0003-fix-windowsinclude.patch +++ b/ports/ffmpeg/0003-fix-windowsinclude.patch @@ -1,13 +1,13 @@ diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c -index 9cfbc45..e3447e6 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c -@@ -63,6 +63,8 @@ - #include - #endif +@@ -51,6 +51,8 @@ + #include "fopen_utf8.h" + #include "opt_common.h" #ifdef _WIN32 +#define _WIN32_WINNT 0x0502 +#define WIN32_LEAN_AND_MEAN #include + #include "compat/w32dlfcn.h" #endif diff --git a/ports/ffmpeg/0005-fix-nasm.patch b/ports/ffmpeg/0005-fix-nasm.patch new file mode 100644 index 0000000000..2bbe36b6de --- /dev/null +++ b/ports/ffmpeg/0005-fix-nasm.patch @@ -0,0 +1,69 @@ +diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile +--- a/libavcodec/x86/Makefile ++++ b/libavcodec/x86/Makefile +@@ -138,8 +138,11 @@ X86ASM-OBJS-$(CONFIG_QPELDSP) += x86/qpeldsp.o \ + X86ASM-OBJS-$(CONFIG_RV34DSP) += x86/rv34dsp.o + X86ASM-OBJS-$(CONFIG_VC1DSP) += x86/vc1dsp_loopfilter.o \ + x86/vc1dsp_mc.o +-X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct10.o \ +- x86/simple_idct.o ++ifdef ARCH_X86_64 ++X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct10.o ++else ++X86ASM-OBJS-$(CONFIG_IDCTDSP) += x86/simple_idct.o ++endif + X86ASM-OBJS-$(CONFIG_VIDEODSP) += x86/videodsp.o + X86ASM-OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp.o + X86ASM-OBJS-$(CONFIG_VP8DSP) += x86/vp8dsp.o \ +@@ -157,6 +160,8 @@ X86ASM-OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp.o + X86ASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o + X86ASM-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsidct.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_CFHD_ENCODER) += x86/cfhdencdsp.o ++endif + X86ASM-OBJS-$(CONFIG_CFHD_DECODER) += x86/cfhddsp.o + X86ASM-OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp.o x86/synth_filter.o + X86ASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp.o \ +@@ -175,15 +180,21 @@ x86/hevc_sao_10bit.o + X86ASM-OBJS-$(CONFIG_JPEG2000_DECODER) += x86/jpeg2000dsp.o + X86ASM-OBJS-$(CONFIG_LSCR_DECODER) += x86/pngdsp.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o ++endif + X86ASM-OBJS-$(CONFIG_MPEG4_DECODER) += x86/xvididct.o + X86ASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o + X86ASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o ++endif + X86ASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp.o + X86ASM-OBJS-$(CONFIG_SBC_ENCODER) += x86/sbcdsp.o + X86ASM-OBJS-$(CONFIG_SVQ1_ENCODER) += x86/svq1enc.o + X86ASM-OBJS-$(CONFIG_TAK_DECODER) += x86/takdsp.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o ++endif + X86ASM-OBJS-$(CONFIG_TTA_DECODER) += x86/ttadsp.o + X86ASM-OBJS-$(CONFIG_TTA_ENCODER) += x86/ttaencdsp.o + X86ASM-OBJS-$(CONFIG_UTVIDEO_DECODER) += x86/utvideodsp.o +diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile +--- a/libavfilter/x86/Makefile ++++ b/libavfilter/x86/Makefile +@@ -44,6 +44,8 @@ + X86ASM-OBJS-$(CONFIG_AFIR_FILTER) += x86/af_afir.o + X86ASM-OBJS-$(CONFIG_ANLMDN_FILTER) += x86/af_anlmdn.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_ATADENOISE_FILTER) += x86/vf_atadenoise.o ++endif + X86ASM-OBJS-$(CONFIG_BLEND_FILTER) += x86/vf_blend.o + X86ASM-OBJS-$(CONFIG_BWDIF_FILTER) += x86/vf_bwdif.o + X86ASM-OBJS-$(CONFIG_COLORSPACE_FILTER) += x86/colorspacedsp.o +@@ -62,6 +62,8 @@ X86ASM-OBJS-$(CONFIG_LUT3D_FILTER) += x86/vf_lut3d.o + X86ASM-OBJS-$(CONFIG_MASKEDCLAMP_FILTER) += x86/vf_maskedclamp.o + X86ASM-OBJS-$(CONFIG_MASKEDMERGE_FILTER) += x86/vf_maskedmerge.o ++ifdef ARCH_X86_64 + X86ASM-OBJS-$(CONFIG_NLMEANS_FILTER) += x86/vf_nlmeans.o ++endif + 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/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch index 69c6380a1f..13711bc2db 100644 --- a/ports/ffmpeg/0011-Fix-x265-detection.patch +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -1,17 +1,15 @@ diff --git a/configure b/configure -index 34a2e644c4..0ea64bd306 100755 --- a/configure +++ b/configure -@@ -6447,7 +6447,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" && +@@ -6671,7 +6671,10 @@ + [ "$toolchain" != "msvc" ] || + require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && check_cpp_condition libx262 x264.h "X264_MPEG2" -enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && +enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || -+ { { 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++"; } && -+ warn "using libx265 without pkg-config"; } } && ++ { { 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++"; } && ++ warn "using libx265 without pkg-config"; } } && 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/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch b/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch deleted file mode 100644 index 07b304837b..0000000000 --- a/ports/ffmpeg/0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch +++ /dev/null @@ -1,46 +0,0 @@ -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 ---- a/configure -+++ b/configure -@@ -6535,11 +6535,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; } --enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || -- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && -- warn "using libx264 without pkg-config"; } } && -- require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && -- check_cpp_condition libx262 x264.h "X264_MPEG2" -+enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && -+ require_cpp_condition libx264 x264.h "X264_BUILD >= 158" - enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || - { { 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 ---- a/libavcodec/libx264.c -+++ b/libavcodec/libx264.c -@@ -34,10 +34,6 @@ - #include "atsc_a53.h" - #include "sei.h" - --#if defined(_MSC_VER) --#define X264_API_IMPORTS 1 --#endif -- - #include - #include - #include --- -2.33.1.windows.1 - diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index d286e9fb56..a24388aa3c 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -4,12 +4,14 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO ffmpeg/ffmpeg REF n${VERSION} - SHA512 76f892f15b65574c01a98eb6e8e0fa8a6c9febd9419f3f2a91bbd275762934d65bd809c6dbe67e047a475e1c8510b3e8d503fb0016e979a52edb7a02722788ca + SHA512 1b90c38b13149f2de7618ad419adc277afd5e65bbf52b849a7245aec0f92f73189c8547599dba8408b8828a767c1120f132727b57cd6231cd8b81de2471a4b8b HEAD_REF master PATCHES 0001-create-lib-libraries.patch + 0002-fix-msvc-link.patch #upstreamed in future version 0003-fix-windowsinclude.patch 0004-fix-debug-build.patch + 0005-fix-nasm.patch #upstreamed in future version 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch 0009-Fix-fdk-detection.patch @@ -17,7 +19,6 @@ vcpkg_from_github( 0012-Fix-ssl-110-detection.patch 0013-define-WINVER.patch 0015-Fix-xml2-detection.patch - 0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch 0020-fix-aarch64-libswscale.patch 0022-fix-iconv.patch ) @@ -26,16 +27,9 @@ if (SOURCE_PATH MATCHES " ") message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces") endif() -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - # ffmpeg nasm build causes linker to stall on x86, so fall back to yasm - vcpkg_find_acquire_program(YASM) - get_filename_component(YASM_EXE_PATH "${YASM}" DIRECTORY) - vcpkg_add_to_path("${YASM_EXE_PATH}") -else() - vcpkg_find_acquire_program(NASM) - get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) - vcpkg_add_to_path("${NASM_EXE_PATH}") -endif() +vcpkg_find_acquire_program(NASM) +get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY) +vcpkg_add_to_path("${NASM_EXE_PATH}") if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) #We're assuming that if we're building for Windows we're using MSVC @@ -560,9 +554,8 @@ if(VCPKG_TARGET_IS_UWP) string(APPEND OPTIONS " --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib") endif() -# Note: --disable-optimizations can't be used due to https://ffmpeg.org/pipermail/libav-user/2013-March/003945.html -set(OPTIONS_DEBUG "--debug") -set(OPTIONS_RELEASE "") +set(OPTIONS_DEBUG "--debug --disable-optimizations") +set(OPTIONS_RELEASE "--enable-optimizations") set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}") @@ -808,14 +801,25 @@ message(STATUS "Dependencies (debug): ${FFMPEG_DEPENDENCIES_DEBUG}") # Handle version strings function(extract_regex_from_file out) - cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "FILE;REGEX" "") - file(READ "${arg_FILE}" contents) + cmake_parse_arguments(PARSE_ARGV 1 "arg" "MAJOR" "FILE_WITHOUT_EXTENSION;REGEX" "") + file(READ "${arg_FILE_WITHOUT_EXTENSION}.h" contents) if (contents MATCHES "${arg_REGEX}") if(NOT CMAKE_MATCH_COUNT EQUAL 1) message(FATAL_ERROR "Could not identify match group in regular expression \"${arg_REGEX}\"") endif() else() - message(FATAL_ERROR "Could not find line matching \"${arg_REGEX}\" in file \"${arg_FILE}\"") + if (arg_MAJOR) + file(READ "${arg_FILE_WITHOUT_EXTENSION}_major.h" contents) + if (contents MATCHES "${arg_REGEX}") + if(NOT CMAKE_MATCH_COUNT EQUAL 1) + message(FATAL_ERROR "Could not identify match group in regular expression \"${arg_REGEX}\"") + endif() + else() + message(WARNING "Could not find line matching \"${arg_REGEX}\" in file \"${arg_FILE_WITHOUT_EXTENSION}_major.h\"") + endif() + else() + message(WARNING "Could not find line matching \"${arg_REGEX}\" in file \"${arg_FILE_WITHOUT_EXTENSION}.h\"") + endif() endif() set("${out}" "${CMAKE_MATCH_1}" PARENT_SCOPE) endfunction() @@ -825,22 +829,23 @@ function(extract_version_from_component out) string(TOLOWER "${arg_COMPONENT}" component_lower) string(TOUPPER "${arg_COMPONENT}" component_upper) extract_regex_from_file(major_version - FILE "${SOURCE_PATH}/${component_lower}/version.h" + FILE_WITHOUT_EXTENSION "${SOURCE_PATH}/${component_lower}/version" + MAJOR REGEX "#define ${component_upper}_VERSION_MAJOR[ ]+([0-9]+)" ) extract_regex_from_file(minor_version - FILE "${SOURCE_PATH}/${component_lower}/version.h" + FILE_WITHOUT_EXTENSION "${SOURCE_PATH}/${component_lower}/version" REGEX "#define ${component_upper}_VERSION_MINOR[ ]+([0-9]+)" ) extract_regex_from_file(micro_version - FILE "${SOURCE_PATH}/${component_lower}/version.h" + FILE_WITHOUT_EXTENSION "${SOURCE_PATH}/${component_lower}/version" REGEX "#define ${component_upper}_VERSION_MICRO[ ]+([0-9]+)" ) set("${out}" "${major_version}.${minor_version}.${micro_version}" PARENT_SCOPE) endfunction() extract_regex_from_file(FFMPEG_VERSION - FILE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/libavutil/ffversion.h" + FILE_WITHOUT_EXTENSION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/libavutil/ffversion" REGEX "#define FFMPEG_VERSION[ ]+\"(.+)\"" ) @@ -852,7 +857,7 @@ extract_version_from_component(LIBAVDEVICE_VERSION COMPONENT libavdevice) extract_version_from_component(LIBAVFILTER_VERSION COMPONENT libavfilter) -extract_version_from_component( LIBAVFORMAT_VERSION +extract_version_from_component(LIBAVFORMAT_VERSION COMPONENT libavformat) extract_version_from_component(LIBSWRESAMPLE_VERSION COMPONENT libswresample) diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json index 06e0dafcca..5703f71a42 100644 --- a/ports/ffmpeg/vcpkg.json +++ b/ports/ffmpeg/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ffmpeg", - "version": "5.0.2", - "port-version": 3, + "version": "5.1.2", "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/ports/pangolin/ffmpeg-vxmc.patch b/ports/pangolin/ffmpeg-vxmc.patch new file mode 100644 index 0000000000..bccc9f16f1 --- /dev/null +++ b/ports/pangolin/ffmpeg-vxmc.patch @@ -0,0 +1,13 @@ +--- a/components/pango_video/include/pangolin/video/drivers/ffmpeg_common.h ++++ b/components/pango_video/include/pangolin/video/drivers/ffmpeg_common.h +@@ -55,10 +55,6 @@ inline std::string FfmpegFmtToString(const AVPixelFormat fmt) + TEST_PIX_FMT_RETURN(YUVJ420P); + TEST_PIX_FMT_RETURN(YUVJ422P); + TEST_PIX_FMT_RETURN(YUVJ444P); +-#ifdef FF_API_XVMC +- TEST_PIX_FMT_RETURN(XVMC_MPEG2_MC); +- TEST_PIX_FMT_RETURN(XVMC_MPEG2_IDCT); +-#endif + TEST_PIX_FMT_RETURN(UYVY422); + TEST_PIX_FMT_RETURN(UYYVYY411); + TEST_PIX_FMT_RETURN(BGR8); diff --git a/ports/pangolin/portfile.cmake b/ports/pangolin/portfile.cmake index d1108504ee..991f49cd49 100644 --- a/ports/pangolin/portfile.cmake +++ b/ports/pangolin/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( HEAD_REF master PATCHES devendor-palsigslot.patch + ffmpeg-vxmc.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/pangolin/vcpkg.json b/ports/pangolin/vcpkg.json index 8a4ffaa8ef..9b4406f261 100644 --- a/ports/pangolin/vcpkg.json +++ b/ports/pangolin/vcpkg.json @@ -1,7 +1,7 @@ { "name": "pangolin", "version": "0.8", - "port-version": 1, + "port-version": 2, "description": "Lightweight GUI Library", "homepage": "https://github.com/stevenlovegrove/Pangolin", "license": "MIT", diff --git a/versions/baseline.json b/versions/baseline.json index c973a6ca84..67a8be3b73 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2345,8 +2345,8 @@ "port-version": 5 }, "ffmpeg": { - "baseline": "5.0.2", - "port-version": 3 + "baseline": "5.1.2", + "port-version": 0 }, "ffnvcodec": { "baseline": "11.1.5.0", @@ -5782,7 +5782,7 @@ }, "pangolin": { "baseline": "0.8", - "port-version": 1 + "port-version": 2 }, "pangomm": { "baseline": "2.50.1", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index f497eda108..4d007ba417 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b288cec1b63010d1cb92e18256bc49a48b4bca52", + "version": "5.1.2", + "port-version": 0 + }, { "git-tree": "d4da48cc8448d8b126b8558bf6ddf5f2a380bf51", "version": "5.0.2", diff --git a/versions/p-/pangolin.json b/versions/p-/pangolin.json index 4f73558821..5adf7319fa 100644 --- a/versions/p-/pangolin.json +++ b/versions/p-/pangolin.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "669c1d887b36a039f058ad82615e0ef22d721f1d", + "version": "0.8", + "port-version": 2 + }, { "git-tree": "b6465120255800b1cb8df8fb0a47eff4970a2b47", "version": "0.8",