aboutsummaryrefslogtreecommitdiff
path: root/ports/ffmpeg
diff options
context:
space:
mode:
authorMatthew Oliver <protogonoi@gmail.com>2021-04-08 03:06:55 +1000
committerGitHub <noreply@github.com>2021-04-07 10:06:55 -0700
commit85a48c1ed558210cab67a03209510c4bf6e5e285 (patch)
treea09d9080713e8979579d35e8540eb59bbafeadb0 /ports/ffmpeg
parent4278a5f9eafbdadfaa65d7aafd914964841cba42 (diff)
downloadvcpkg-85a48c1ed558210cab67a03209510c4bf6e5e285.tar.gz
vcpkg-85a48c1ed558210cab67a03209510c4bf6e5e285.zip
[ffmpeg] Add support for dav1d,fontconfig,freetype,fribidi,ilbc,modplug,opengl,openjpeg,libssh,tensorflow,tesseract,webp,libxml2 dependencies. (#15787)
* [tesseract] Use vcpkg_fixup_pkgconfig. * [libxml2] Correct pkgconfig lib name. * [libwebp] Use vcpkg_fixup_pkgconfig. * [libssh] Export pkgconfig on windows. Also move to using git to get source. * [modplug] Export pkgconfig on windows. * [ffmpeg] Add support for fontconfig,freetype,fribidi,modplug,openjpeg,libssh,tesseract,libxml2 dependencies. * [openjpeg] Correct required static link libs in pkgconfig. * [modplug] Combine vcpkg_from_github using variable. * Update ports/libssh/CONTROL * Improve portfile.cmake * update version records. * [openjpeg] Update libs in pkgcfg. Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * update version records * [libssh] Add pthread to pkgconfig when using mbedtls. * [libssh] Correct pthread naming on windows. * [fontconfig] Add libintl to pkgconfig on windows. * update version records * [ffmpeg] Fixup FindFFmpeg. * [ffmpeg] speex now supports non-windows. * [ffmpeg] Add feature libass. * [ffmpeg] Add dav1d feature. * [ffmpeg] Add feature ilbc. * [ffmpeg] Add tensorflow feature. * [ffmpeg] update version record. * [ffmpeg] Add CI feature test. * [ffmpeg] Limit features based on CI failures. * [ffmpeg] Update version record. * [ffmpeg] limit features based on ci.baseline. * [various ports] Update supports field. * [ffmpeg] Limit features more based on CI. * update version records. * [ffmpeg] Add detection of additional non target deps.. select_library_configurations_from_names currently detects the debug libs even for release builds as _IMPORT_PREFIX was not being set. * [aubio] Silence warning about FindFFMPEG. * [pangolin] Use vcpkg supplied FindFFMPEG. * update version files. * [ffnvcodec] Set as not supporting uwp. ffnvcodec will build under uwp as its a header only lib, but it can not be used as it requires dynamic dll loading. * [ffmpeg] Update feature all. * update version records * [tesseract] Wrap debug pkgcfg update. * [libssh,libxml2,openjpeg,fontconfig] Fix pkg-config for release only triplets. * [libssh] Correct port version after merge. * [ffmpeg] Fixup after merge. * Update version files. * [ffmpeg] Add opengl support. * [ffmpeg] Update package version. * [ffmpeg] Fix ffnvcodec support. * [ffmpeg] Fix x265 detection on osx. * [libvpx] Enable arm-uwp build. * [ffmpeg] Fixup x265 patch. * trigger sdl rebuild * [ffmpeg] Disable opengl on osx. * Revert "trigger sdl rebuild" This reverts commit 94065bfe8414259ad5a5576bd4ac0b7ab4b97c6b. * [ffmpeg] Disable failing features on osx. * Update ports/ffmpeg/FindFFMPEG.cmake.in Co-authored-by: Matthias C. M. Troffaes <matthias.troffaes@gmail.com> * [ffmpeg] Add ass dependencies to FindFFmpeg. * Update ports/ffmpeg/FindFFMPEG.cmake.in Co-authored-by: Matthias C. M. Troffaes <matthias.troffaes@gmail.com> * update version * [fontconfig] disable pthread/json as they are not needed for lib builds. Only used for tests. * [ffmpeg] Enable fontconfig on static+windows. * update versions * update versions. * Fix incorrectly included commits * revert pangolin commit Reverts most of 2543be2edf60bf38511c2d477bb17b617398a108 * update versions * Correct port version after merge. * update versions. * [ffmpeg] Fix cmake dependency detection on non-windows. * Revert "revert pangolin commit" This reverts commit f59bc5a53ea74fd9df17fc368886e9d1a80ac42f. * [ffmpeg] Fix dependency loading that does not define separate debug/release libs. * update versions. * [ffmpeg] set CMP0072 policy. * [wavpack] Fix cmake config export. * [ffmpeg] Add optional system dependent libraries. * update versions after merge. * update versions. Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com> Co-authored-by: Matthias C. M. Troffaes <matthias.troffaes@gmail.com>
Diffstat (limited to 'ports/ffmpeg')
-rw-r--r--ports/ffmpeg/0011-Fix-x265-detection.patch5
-rw-r--r--ports/ffmpeg/0015-Fix-xml2-detection.patch17
-rw-r--r--ports/ffmpeg/CONTROL140
-rw-r--r--ports/ffmpeg/FindFFMPEG.cmake.in158
-rw-r--r--ports/ffmpeg/portfile.cmake127
5 files changed, 384 insertions, 63 deletions
diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch
index af1b6751d..69c6380a1 100644
--- a/ports/ffmpeg/0011-Fix-x265-detection.patch
+++ b/ports/ffmpeg/0011-Fix-x265-detection.patch
@@ -2,13 +2,14 @@ diff --git a/configure b/configure
index 34a2e644c4..0ea64bd306 100755
--- a/configure
+++ b/configure
-@@ -6447,7 +6447,9 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
+@@ -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" &&
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 ||
-+ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" &&
++ { { 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"
diff --git a/ports/ffmpeg/0015-Fix-xml2-detection.patch b/ports/ffmpeg/0015-Fix-xml2-detection.patch
new file mode 100644
index 000000000..7d2f148b0
--- /dev/null
+++ b/ports/ffmpeg/0015-Fix-xml2-detection.patch
@@ -0,0 +1,17 @@
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 900505756b..8d1388a347 100755
+--- a/configure
++++ b/configure
+@@ -6476,7 +6476,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."; }
+-enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
++enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml/xmlversion.h xmlCheckVersion
+ 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/CONTROL b/ports/ffmpeg/CONTROL
index 9d7162faf..2548dc301 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,6 +1,6 @@
Source: ffmpeg
Version: 4.3.2
-Port-Version: 1
+Port-Version: 2
Homepage: https://ffmpeg.org
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.
@@ -8,132 +8,200 @@ Default-Features: avresample, avcodec, avformat, avdevice, avfilter, postproc, s
Feature: ffmpeg
Build-Depends: ffmpeg[core,avcodec,avfilter,avformat]
-Description: build the ffmpeg.exe application
+Description: Build the ffmpeg application
Feature: ffplay
Build-Depends: ffmpeg[core,avcodec,avfilter,avformat,swscale,swresample,sdl2]
-Description: ffplay application support in ffmpeg
+Description: Build the ffplay application
Feature: ffprobe
Build-Depends: ffmpeg[core,avcodec,avformat]
-Description: ffprobe application support in ffmpeg
+Description: Build the ffprobe application
Feature: avcodec
-Description: Codec support in ffmpeg
+Description: Build the avcodec library
Feature: avformat
Build-Depends: ffmpeg[core,avcodec]
-Description: Format support in ffmpeg
+Description: Build the avformat library
Feature: avdevice
Build-Depends: ffmpeg[core,avcodec,avformat]
-Description: Device support in ffmpeg
+Description: Build the avdevice library
Feature: avfilter
-Description: Filter support in ffmpeg
+Description: Build the avfilter library
Feature: postproc
Build-Depends: ffmpeg[core,gpl]
-Description: Postproc support in ffmpeg
+Description: Build the postproc library
Feature: swresample
-Description: Swresample support in ffmpeg
+Description: Build the swresample library
Feature: swscale
-Description: Swscale support in ffmpeg
+Description: Build the swscale library
Feature: avresample
-Description: Libav audio resampling library support in ffmpeg
+Description: Build the avresample library
Feature: nonfree
-Description: allow nonfree and unredistributable libraries
+Description: Allow use of nonfree code, the resulting libs and binaries will be unredistributable
Feature: gpl
-Description: allow GPL licensed libraries
+Description: Allow use of GPL code, the resulting libs and binaries will be under GPL
Feature: version3
-Description: upgrade (L)GPL to version 3
+Description: Upgrade (L)GPL to version 3
+
+Feature: all
+Build-Depends: ffmpeg[bzip2,iconv,freetype,lzma,mp3lame,openjpeg,opus,snappy,soxr,speex,theora,vorbis,vpx,webp,zlib], ffmpeg[ass] (!(uwp | arm)), ffmpeg[dav1d] (!(uwp | arm | x86 | osx)), ffmpeg[fontconfig] (!(windows & static) & !(uwp | arm)), ffmpeg[fribidi] (!(uwp | arm)), ffmpeg[ilbc] (!(arm & uwp)), ffmpeg[modplug] (!(windows & static) & !uwp), ffmpeg[nvcodec] ((windows | linux) & !uwp & !arm), ffmpeg[opencl] (!uwp), ffmpeg[ssh] (!(uwp | arm) & !static), ffmpeg[opengl] (!uwp & !(windows & arm) & !osx), ffmpeg[sdl2] (!osx), ffmpeg[tensorflow] (!(x86 | arm | uwp) & !static), ffmpeg[tesseract] (!uwp & !(windows & arm) & !static), ffmpeg[wavpack] (!arm), ffmpeg[xml2] (!static)
+Description: Build with all allowed dependencies selected that are compatible with the lgpl license
+
+Feature: all-gpl
+Build-Depends: ffmpeg[gpl,all], ffmpeg[avisynthplus] (windows & !arm & !uwp & !static), ffmpeg[x264] (!arm), ffmpeg[x265] (!arm & !uwp)
+Description: Build with all allowed dependencies selected that are compatible with the gpl license
+
+Feature: all-nonfree
+Build-Depends: ffmpeg[nonfree,all-gpl,openssl], ffmpeg[fdk-aac] (!arm & !uwp)
+Description: Build with all allowed dependencies selected with a non-redistributable license
+
+Feature: ass
+Build-Depends: libass
+Description: Libass subtitles rendering, needed for subtitles and ass filter support in ffmpeg
Feature: avisynthplus
Build-Depends: avisynthplus, ffmpeg[core,gpl]
-Description: avisynthplus support in ffmpeg
+Description: Reading of AviSynth script files
Feature: bzip2
Build-Depends: bzip2
-Description: bzip2 support in ffmpeg
+Description: Bzip2 support
+
+Feature: dav1d
+Build-Depends: dav1d
+Description: AV1 decoding via libdav1d
Feature: iconv
Build-Depends: libiconv
-Description: iconv support in ffmpeg
+Description: Iconv support
+
+Feature: ilbc
+Build-Depends: libilbc
+Description: iLBC de/encoding via libilbc
Feature: fdk-aac
Build-Depends: fdk-aac, ffmpeg[core,nonfree]
-Description: AAC de/encoding via libfdk-aac support in ffmpeg
+Description: AAC de/encoding via libfdk-aac
+
+Feature: fontconfig
+Build-Depends: fontconfig
+Description: Useful for drawtext filter
+
+Feature: freetype
+Build-Depends: freetype
+Description: Needed for drawtext filter
+
+Feature: fribidi
+Build-Depends: fribidi
+Description: Improves drawtext filter
Feature: lzma
Build-Depends: liblzma
-Description: lzma support in ffmpeg
+Description: lzma support
+
+Feature: modplug
+Build-Depends: libmodplug
+Description: ModPlug via libmodplug
Feature: mp3lame
Build-Depends: mp3lame
-Description: MP3 encoding via libmp3lame support in ffmpeg
+Description: MP3 encoding via libmp3lame
Feature: nvcodec
Build-Depends: ffnvcodec
-Description: Hardware accelerated codecs
+Description: Nvidia video decoding/encoding acceleration
Feature: opencl
Build-Depends: opencl
-Description: OpenCL processing support in ffmpeg
+Description: OpenCL processing
+
+Feature: opengl
+Build-Depends: opengl, opengl-registry
+Description: OpenGL rendering
+
+Feature: openjpeg
+Build-Depends: openjpeg
+Description: JPEG 2000 de/encoding via OpenJPEG
Feature: openssl
Build-Depends: openssl, ffmpeg[core,nonfree]
-Description: openssl support in ffmpeg
+Description: Needed for https support if gnutls, libtls or mbedtls is not used
Feature: opus
Build-Depends: opus
-Description: Opus de/encoding via libopus support in ffmpeg
+Description: Opus de/encoding via libopus
Feature: sdl2
Build-Depends: sdl2
-Description: sdl2 support in ffmpeg
+Description: Sdl2 support
Feature: snappy
Build-Depends: snappy
-Description: Snappy compression, needed for hap encoding support in ffmpeg
+Description: Snappy compression, needed for hap encoding
Feature: soxr
Build-Depends: soxr
-Description: libsoxr resampling support in ffmpeg
+Description: Include libsoxr resampling
Feature: speex
Build-Depends: speex
-Description: Speex de/encoding via libspeex support in ffmpeg
+Description: Speex de/encoding via libspeex
+
+Feature: ssh
+Build-Depends: libssh
+Description: SFTP protocol via libssh
+
+Feature: tensorflow
+Build-Depends: tensorflow
+Description: TensorFlow as a DNN module backend for DNN based filters like sr
+
+Feature: tesseract
+Build-Depends: tesseract
+Description: Tesseract, needed for ocr filter
Feature: theora
Build-Depends: libtheora
-Description: Theora encoding via libtheora support in ffmpeg
+Description: Theora encoding via libtheora
Feature: vorbis
Build-Depends: libvorbis
-Description: Vorbis en/decoding via libvorbis support in ffmpeg
+Description: Vorbis en/decoding via libvorbis, native implementation exists
Feature: vpx
Build-Depends: libvpx
-Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg
+Description: VP8 and VP9 de/encoding via libvpx
Feature: wavpack
Build-Depends: wavpack
-Description: wavpack encoding via libwavpack support in ffmpeg
+Description: Wavpack encoding via libwavpack
+
+Feature: webp
+Build-Depends: libwebp
+Description: WebP encoding via libwebp
Feature: x264
Build-Depends: x264, ffmpeg[core,gpl]
-Description: H.264 encoding via x264 support in ffmpeg
+Description: H.264 encoding via x264
Feature: x265
Build-Depends: x265, ffmpeg[core,gpl]
-Description: HEVC encoding via x265 support in ffmpeg
+Description: HEVC encoding via x265
+
+Feature: xml2
+Build-Depends: libxml2
+Description: XML parsing using the C library libxml2, needed for dash demuxing support
Feature: zlib
Build-Depends: zlib
-Description: zlib support in ffmpeg
+Description: zlib support
diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in
index afad38cb0..8be51419e 100644
--- a/ports/ffmpeg/FindFFMPEG.cmake.in
+++ b/ports/ffmpeg/FindFFMPEG.cmake.in
@@ -31,12 +31,20 @@ include(CMakeFindDependencyMacro)
if(NOT FFMPEG_FOUND)
+# Compute the installation path relative to this file.
+get_filename_component(SEARCH_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
+get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
+if(SEARCH_PATH STREQUAL "/")
+ set(SEARCH_PATH "")
+endif()
+
function(select_library_configurations_from_names)
cmake_parse_arguments(_slc "" "BASENAME" "NAMES;NAMES_RELEASE;NAMES_DEBUG" ${ARGN})
list(APPEND _slc_NAMES_RELEASE ${_slc_NAMES})
list(APPEND _slc_NAMES_DEBUG ${_slc_NAMES})
- find_library(${_slc_BASENAME}_LIBRARY_RELEASE NAMES ${_slc_NAMES_RELEASE} PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH)
- find_library(${_slc_BASENAME}_LIBRARY_DEBUG NAMES ${_slc_NAMES_DEBUG} PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH)
+ find_library(${_slc_BASENAME}_LIBRARY_RELEASE NAMES ${_slc_NAMES_RELEASE} PATHS ${SEARCH_PATH}/lib/ NO_DEFAULT_PATH)
+ find_library(${_slc_BASENAME}_LIBRARY_DEBUG NAMES ${_slc_NAMES_DEBUG} PATHS ${SEARCH_PATH}/debug/lib/ NO_DEFAULT_PATH)
select_library_configurations(${_slc_BASENAME})
set(${_slc_BASENAME}_LIBRARIES ${${_slc_BASENAME}_LIBRARIES} PARENT_SCOPE)
endfunction()
@@ -53,12 +61,25 @@ function(select_library_configurations_from_targets)
if(TARGET ${_dep})
get_target_property(_dep_rel ${_dep} IMPORTED_LOCATION_RELEASE)
get_target_property(_dep_dbg ${_dep} IMPORTED_LOCATION_DEBUG)
+ if(_dep_rel MATCHES _dep_rel-NOTFOUND)
+ set(_dep_rel ${_dep_dbg})
+ elseif(_dep_dbg MATCHES _dep_dbg-NOTFOUND)
+ set(_dep_dbg ${_dep_rel})
+ endif()
list(APPEND ${_slc_BASENAME}_LIBRARY_RELEASE ${_dep_rel})
list(APPEND ${_slc_BASENAME}_LIBRARY_DEBUG ${_dep_dbg})
+ elseif(NOT ${_dep} MATCHES _deps-NOTFOUND)
+ if(${_dep} MATCHES ::)
+ #TODO Handle targets contained in cmake generator expressions
+ message(STATUS Unhandled dependency ${_slc_BASENAME}: ${_dep})
+ else()
+ list(APPEND ${_slc_BASENAME}_DEP_LIBRARIES ${_dep})
+ endif()
endif()
endforeach()
endforeach()
select_library_configurations(${_slc_BASENAME})
+ list(APPEND ${_slc_BASENAME}_LIBRARIES ${${_slc_BASENAME}_DEP_LIBRARIES})
set(${_slc_BASENAME}_LIBRARIES ${${_slc_BASENAME}_LIBRARIES} PARENT_SCOPE)
endfunction()
@@ -72,14 +93,39 @@ function(find_platform_dependent_libraries)
set(FFMPEG_PLATFORM_DEPENDENT_LIBS ${FFMPEG_PLATFORM_DEPENDENT_LIBS} PARENT_SCOPE)
endfunction()
+# for finding system libraries that may not always be available
+function(find_platform_dependent_optional_libraries)
+ cmake_parse_arguments(_fpdo "" "" "NAMES" ${ARGN})
+ foreach(_name ${_fpdo_NAMES})
+ find_library(${_name}_LIBRARY ${_name})
+ if(NOT ${_name}_LIBRARY MATCHES ${_name}_LIBRARY-NOTFOUND)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${${_name}_LIBRARY})
+ endif()
+ endforeach()
+ set(FFMPEG_PLATFORM_DEPENDENT_LIBS ${FFMPEG_PLATFORM_DEPENDENT_LIBS} PARENT_SCOPE)
+endfunction()
+
set(FFMPEG_VERSION "4.3.2")
find_dependency(Threads)
if(UNIX)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread)
endif()
-if(UNIX AND NOT APPLE)
- list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11)
+
+if(@ENABLE_ASS@)
+ select_library_configurations_from_names(BASENAME ASS NAMES ass libass)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${ASS_LIBRARIES})
+ if(NOT @ENABLE_FREETYPE@)
+ find_dependency(Freetype)
+ select_library_configurations_from_targets(BASENAME freetype TARGETS Freetype::Freetype)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${freetype_LIBRARIES})
+ endif()
+ if(NOT @ENABLE_FRIBIDI@)
+ select_library_configurations_from_names(BASENAME FRIBIDI NAMES fribidi libfribidi)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${FRIBIDI_LIBRARIES})
+ endif()
+ select_library_configurations_from_names(BASENAME HARFBUZZ NAMES harfbuzz libharfbuzz)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${HARFBUZZ_LIBRARIES})
endif()
if(@ENABLE_BZIP2@)
@@ -88,16 +134,46 @@ if(@ENABLE_BZIP2@)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${BZip2_LIBRARIES})
endif()
+if(@ENABLE_DAV1D@)
+ select_library_configurations_from_names(BASENAME DAV1D NAMES dav1d libdav1d)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${DAV1D_LIBRARIES})
+ if(UNIX)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS dl)
+ endif()
+endif()
+
if(@ENABLE_ICONV@)
find_dependency(Iconv)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${Iconv_LIBRARIES})
endif()
+if(@ENABLE_ILBC@)
+ select_library_configurations_from_names(BASENAME ILBC NAMES ilbc libilbc)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${ILBC_LIBRARIES})
+endif()
+
if(@ENABLE_FDKAAC@)
select_library_configurations_from_names(BASENAME FDK NAMES fdk-aac libfdk-aac)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${FDK_LIBRARIES})
endif()
+if(@ENABLE_FONTCONFIG@)
+ find_dependency(Fontconfig)
+ select_library_configurations_from_targets(BASENAME fontconfig TARGETS Fontconfig::Fontconfig)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${fontconfig_LIBRARIES})
+endif()
+
+if(@ENABLE_FREETYPE@)
+ find_dependency(Freetype)
+ select_library_configurations_from_targets(BASENAME freetype TARGETS Freetype::Freetype)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${freetype_LIBRARIES})
+endif()
+
+if(@ENABLE_FRIBIDI@)
+ select_library_configurations_from_names(BASENAME FRIBIDI NAMES fribidi libfribidi)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${FRIBIDI_LIBRARIES})
+endif()
+
if(@ENABLE_LZMA@)
find_dependency(LibLZMA)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${LibLZMA_LIBRARIES})
@@ -109,6 +185,11 @@ if(@ENABLE_LAME@)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${mp3lame_LIBRARIES})
endif()
+if(@ENABLE_MODPLUG@)
+ select_library_configurations_from_names(BASENAME MODPLUG NAMES modplug libmodplug)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${MODPLUG_LIBRARIES})
+endif()
+
if(@ENABLE_NVCODEC@)
if(UNIX)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS dl)
@@ -120,6 +201,20 @@ if(@ENABLE_OPENCL@)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${OpenCL_LIBRARIES})
endif()
+if(@ENABLE_OPENGL@)
+ if(POLICY CMP0072)
+ cmake_policy (SET CMP0072 OLD)
+ endif(POLICY CMP0072)
+ find_dependency(OpenGL)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${OPENGL_LIBRARIES})
+endif()
+
+if(@ENABLE_OPENJPEG@)
+ find_dependency(OpenJPEG)
+ select_library_configurations_from_targets(BASENAME openjpeg TARGETS openjp2)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${openjpeg_LIBRARIES})
+endif()
+
if(@ENABLE_OPENSSL@)
find_dependency(OpenSSL)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${OPENSSL_LIBRARIES})
@@ -153,10 +248,20 @@ if(@ENABLE_SOXR@)
endif()
if(@ENABLE_SPEEX@)
- select_library_configurations_from_names(BASENAME SPEEX NAMES_RELEASE libspeex NAMES_DEBUG libspeexd)
+ if(WIN32)
+ select_library_configurations_from_names(BASENAME SPEEX NAMES_RELEASE libspeex NAMES_DEBUG libspeexd)
+ else()
+ select_library_configurations_from_names(BASENAME SPEEX NAMES speex libspeex)
+ endif()
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${SPEEX_LIBRARIES})
endif()
+if(@ENABLE_SSH@)
+ find_dependency(libssh)
+ select_library_configurations_from_targets(BASENAME libssh TARGETS ssh)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${libssh_LIBRARIES})
+endif()
+
if(@ENABLE_THEORA@)
find_dependency(Ogg) # ensure Ogg::ogg is defined as a target
find_dependency(unofficial-theora)
@@ -164,6 +269,12 @@ if(@ENABLE_THEORA@)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${THEORA_LIBRARIES})
endif()
+if(@ENABLE_TESSERACT@)
+ find_dependency(Tesseract)
+ select_library_configurations_from_targets(BASENAME tesseract TARGETS libtesseract)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${tesseract_LIBRARIES})
+endif()
+
if(@ENABLE_VORBIS@)
find_dependency(Vorbis)
select_library_configurations_from_targets(BASENAME vorbis TARGETS Vorbis::vorbis Vorbis::vorbisenc)
@@ -182,6 +293,12 @@ if(@ENABLE_WAVPACK@)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${wavpack_LIBRARIES})
endif()
+if(@ENABLE_WEBP@)
+ find_dependency(WebP)
+ select_library_configurations_from_targets(BASENAME webp TARGETS WebP::webp WebP::webpdemux WebP::libwebpmux WebP::webpdecoder)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${webp_LIBRARIES})
+endif()
+
if(@ENABLE_X264@)
select_library_configurations_from_names(BASENAME X264 NAMES x264 libx264)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${X264_LIBRARIES})
@@ -193,6 +310,16 @@ endif()
if(@ENABLE_X265@)
select_library_configurations_from_names(BASENAME X265 NAMES x265 x265-static)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${X265_LIBRARIES})
+ if(UNIX)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS dl)
+ find_platform_dependent_optional_libraries(NAMES numa)
+ endif()
+endif()
+
+if(@ENABLE_XML2@)
+ find_dependency(LibXml2)
+ select_library_configurations_from_targets(BASENAME libxml2 TARGETS LibXml2::LibXml2)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${libxml2_LIBRARIES})
endif()
if(@ENABLE_ZLIB@)
@@ -201,6 +328,11 @@ if(@ENABLE_ZLIB@)
endif()
# Platform dependent libraries required by FFMPEG
+if(UNIX AND NOT APPLE)
+ list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11)
+ find_platform_dependent_optional_libraries(NAMES va-drm va vdpau)
+endif()
+
if(WIN32)
if(NOT CYGWIN)
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt strmiids Vfw32 Shlwapi mfplat mfuuid)
@@ -209,23 +341,13 @@ else()
list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m)
endif()
-# Compute the installation prefix relative to this file.
-get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
-get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
-if(_IMPORT_PREFIX STREQUAL "/")
- set(_IMPORT_PREFIX "")
-endif()
-
-set(_IMPORT_PREFIX)
-
macro(FFMPEG_FIND varname shortname headername)
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
- find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${_IMPORT_PREFIX}/include NO_DEFAULT_PATH)
+ find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${SEARCH_PATH}/include NO_DEFAULT_PATH)
endif()
if(NOT FFMPEG_${varname}_LIBRARY)
- find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH)
- find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH)
+ find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${SEARCH_PATH}/lib/ NO_DEFAULT_PATH)
+ find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS ${SEARCH_PATH}/debug/lib/ NO_DEFAULT_PATH)
get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY)
get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY)
select_library_configurations(FFMPEG_${varname})
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 469a062ff..b5b5c49e2 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -18,6 +18,7 @@ vcpkg_from_github(
0012-Fix-ssl-110-detection.patch
0013-define-WINVER.patch
0014-avfilter-dependency-fix.patch
+ 0015-Fix-xml2-detection.patch
)
if (SOURCE_PATH MATCHES " ")
@@ -181,17 +182,25 @@ if("avresample" IN_LIST FEATURES)
set(ENABLE_AVRESAMPLE ON)
endif()
+set(STATIC_LINKAGE OFF)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(STATIC_LINKAGE ON)
+endif()
+
+set(ENABLE_ASS OFF)
+if("ass" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libass")
+ set(ENABLE_ASS ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libass")
+endif()
+
if("avisynthplus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avisynth")
else()
set(OPTIONS "${OPTIONS} --disable-avisynth")
endif()
-set(STATIC_LINKAGE OFF)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
-set(STATIC_LINKAGE ON)
-endif()
-
set(ENABLE_BZIP2 OFF)
if("bzip2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-bzlib")
@@ -200,6 +209,14 @@ else()
set(OPTIONS "${OPTIONS} --disable-bzlib")
endif()
+set(ENABLE_DAV1D OFF)
+if("dav1d" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libdav1d")
+ set(ENABLE_DAV1D ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libdav1d")
+endif()
+
set(ENABLE_ICONV OFF)
if("iconv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-iconv")
@@ -208,6 +225,14 @@ else()
set(OPTIONS "${OPTIONS} --disable-iconv")
endif()
+set(ENABLE_ILBC OFF)
+if("ilbc" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libilbc")
+ set(ENABLE_ILBC ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libilbc")
+endif()
+
set(ENABLE_FDKAAC OFF)
if("fdk-aac" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfdk-aac")
@@ -216,6 +241,30 @@ else()
set(OPTIONS "${OPTIONS} --disable-libfdk-aac")
endif()
+set(ENABLE_FONTCONFIG OFF)
+if("fontconfig" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libfontconfig")
+ set(ENABLE_FONTCONFIG ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libfontconfig")
+endif()
+
+set(ENABLE_FREETYPE OFF)
+if("freetype" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libfreetype")
+ set(ENABLE_FREETYPE ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libfreetype")
+endif()
+
+set(ENABLE_FRIBIDI OFF)
+if("fribidi" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libfribidi")
+ set(ENABLE_FRIBIDI ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libfribidi")
+endif()
+
set(ENABLE_LZMA OFF)
if("lzma" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-lzma")
@@ -232,13 +281,21 @@ else()
set(OPTIONS "${OPTIONS} --disable-libmp3lame")
endif()
+set(ENABLE_MODPLUG OFF)
+if("modplug" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libmodplug")
+ set(ENABLE_MODPLUG ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libmodplug")
+endif()
+
set(ENABLE_NVCODEC OFF)
if("nvcodec" IN_LIST FEATURES)
#Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading
set(ENABLE_NVCODEC ON)
- set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid")
+ set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid --enable-ffnvcodec")
else()
- set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid")
+ set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid --disable-ffnvcodec")
endif()
set(ENABLE_OPENCL OFF)
@@ -249,6 +306,22 @@ else()
set(OPTIONS "${OPTIONS} --disable-opencl")
endif()
+set(ENABLE_OPENGL OFF)
+if("opengl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-opengl")
+ set(ENABLE_OPENGL ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-opengl")
+endif()
+
+set(ENABLE_OPENJPEG OFF)
+if("openjpeg" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libopenjpeg")
+ set(ENABLE_OPENJPEG ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libopenjpeg")
+endif()
+
set(ENABLE_OPENSSL OFF)
if("openssl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-openssl")
@@ -297,6 +370,30 @@ else()
set(OPTIONS "${OPTIONS} --disable-libspeex")
endif()
+set(ENABLE_SSH OFF)
+if("ssh" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libssh")
+ set(ENABLE_SSH ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libssh")
+endif()
+
+set(ENABLE_TENSORFLOW OFF)
+if("tensorflow" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libtensorflow")
+ set(ENABLE_TENSORFLOW ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libtensorflow")
+endif()
+
+set(ENABLE_TESSERACT OFF)
+if("tesseract" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libtesseract")
+ set(ENABLE_TESSERACT ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libtesseract")
+endif()
+
set(ENABLE_THEORA OFF)
if("theora" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libtheora")
@@ -329,6 +426,14 @@ else()
set(OPTIONS "${OPTIONS} --disable-libwavpack")
endif()
+set(ENABLE_WEBP OFF)
+if("webp" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libwebp")
+ set(ENABLE_WEBP ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libwebp")
+endif()
+
set(ENABLE_X264 OFF)
if("x264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx264")
@@ -345,6 +450,14 @@ else()
set(OPTIONS "${OPTIONS} --disable-libx265")
endif()
+set(ENABLE_XML2 OFF)
+if("xml2" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libxml2")
+ set(ENABLE_XML2 ${STATIC_LINKAGE})
+else()
+ set(OPTIONS "${OPTIONS} --disable-libxml2")
+endif()
+
set(ENABLE_ZLIB OFF)
if("zlib" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-zlib")