diff options
| author | JackBoosY <47264268+JackBoosY@users.noreply.github.com> | 2019-08-16 10:01:32 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-16 10:01:32 +0800 |
| commit | adb84c2658b9774ff535eb88f377ee818dd429be (patch) | |
| tree | fcfcf4a93057037152a14aa2885598b45c5b03bd /ports/ffmpeg | |
| parent | 2865da8f4a6d911617cdd9b147816c4cd02bbf7e (diff) | |
| parent | 22e787f9448a25dae734ca06c80e7e5af5fb6537 (diff) | |
| download | vcpkg-adb84c2658b9774ff535eb88f377ee818dd429be.tar.gz vcpkg-adb84c2658b9774ff535eb88f377ee818dd429be.zip | |
Merge branch 'master' into dev/jack/4167
Diffstat (limited to 'ports/ffmpeg')
| -rw-r--r-- | ports/ffmpeg/CONTROL | 5 | ||||
| -rw-r--r-- | ports/ffmpeg/FindFFMPEG.cmake | 44 | ||||
| -rw-r--r-- | ports/ffmpeg/configure_opencv.patch | 11 | ||||
| -rw-r--r-- | ports/ffmpeg/fix-debug-build.patch | 30 | ||||
| -rw-r--r-- | ports/ffmpeg/portfile.cmake | 75 |
5 files changed, 119 insertions, 46 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 4c1565679..abf59b857 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,5 +1,5 @@ Source: ffmpeg -Version: 4.1-8 +Version: 4.1-10 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. @@ -45,3 +45,6 @@ Description: allow nonfree and unredistributable libraries Feature: gpl Description: allow GPL licensed libraries + +Feature: avresample +Description: Libav audio resampling library support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake b/ports/ffmpeg/FindFFMPEG.cmake index 65ab59e90..b3c187340 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake +++ b/ports/ffmpeg/FindFFMPEG.cmake @@ -35,6 +35,8 @@ include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) include(${CMAKE_ROOT}/Modules/CMakeFindDependencyMacro.cmake) +set(FFMPEG_VERSION "4.1") + find_dependency(Threads) #list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS Threads::Threads) if(UNIX) @@ -83,7 +85,7 @@ macro(FFMPEG_FIND_GENEX varname shortname headername) set(FFMPEG_${varname}_FOUND 1) list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR}) endif() -endmacro(FFMPEG_FIND) +endmacro(FFMPEG_FIND_GENEX) if(WIN32) if(NOT FFMPEG_${varname}_INCLUDE_DIRS) @@ -92,8 +94,39 @@ if(WIN32) if (FFMPEG_stdint_INCLUDE_DIRS) set(STDINT_OK TRUE) endif() + FFMPEG_FIND_GENEX(libzlib zlib zlib.h) else() set(STDINT_OK TRUE) + FFMPEG_FIND_GENEX(libzlib z zlib.h) +endif() + +if(APPLE) + find_library(VT_UNIT VideoToolbox) + if (NOT VT_UNIT) + message(FATAL_ERROR "VideoToolbox not found") + endif() + find_library(AT_UNIT AudioToolbox) + if (NOT AT_UNIT) + message(FATAL_ERROR "AudioToolbox not found") + endif() + find_library(SEC_UNIT Security) + if (NOT SEC_UNIT) + message(FATAL_ERROR "Security not found") + endif() + find_library(CF_UNIT CoreFoundation) + if (NOT CF_UNIT) + message(FATAL_ERROR "CoreFoundation not found") + endif() + find_library(CM_UNIT CoreMedia) + if (NOT CM_UNIT) + message(FATAL_ERROR "CoreMedia not found") + endif() + find_library(CV_UNIT CoreVideo) + if (NOT CV_UNIT) + message(FATAL_ERROR "CoreVideo not found") + endif() + find_package(Iconv QUIET) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS ${VT_UNIT} ${AT_UNIT} ${SEC_UNIT} ${CF_UNIT} ${CM_UNIT} ${CV_UNIT} ${Iconv_LIBRARIES}) endif() FFMPEG_FIND(libavcodec avcodec avcodec.h) @@ -103,13 +136,20 @@ FFMPEG_FIND(libavformat avformat avformat.h) FFMPEG_FIND(libavutil avutil avutil.h) FFMPEG_FIND(libswresample swresample swresample.h) FFMPEG_FIND(libswscale swscale swscale.h) -FFMPEG_FIND_GENEX(libzlib zlib zlib.h) if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND AND STDINT_OK) list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS} ${FFMPEG_stdint_INCLUDE_DIRS}) list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) + set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") + list(APPEND FFMPEG_LIBRARIES ${FFMPEG_libavformat_LIBRARY} ${FFMPEG_libavdevice_LIBRARY} diff --git a/ports/ffmpeg/configure_opencv.patch b/ports/ffmpeg/configure_opencv.patch deleted file mode 100644 index ac5c82797..000000000 --- a/ports/ffmpeg/configure_opencv.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure
-+++ b/configure
-@@ -6110,7 +6110,7 @@ enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec
- enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
- enabled libopencv && { check_headers opencv2/core/core_c.h &&
- { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
-- require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
-+ require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core341 -lopencv_imgproc341; } ||
- require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
- enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
- enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
diff --git a/ports/ffmpeg/fix-debug-build.patch b/ports/ffmpeg/fix-debug-build.patch new file mode 100644 index 000000000..324eb79f9 --- /dev/null +++ b/ports/ffmpeg/fix-debug-build.patch @@ -0,0 +1,30 @@ +diff --git a/configure b/configure +index 7c5b8a1..181fc47 100644 +--- a/configure ++++ b/configure +@@ -3906,6 +3906,9 @@ for opt do + --libfuzzer=*) + libfuzzer_path="$optval" + ;; ++ --debug) ++ enable debug_configure ++ ;; + *) + optname="${opt%%=*}" + optname="${optname#--}" +@@ -6037,8 +6040,13 @@ fi + + enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || + check_lib zlib zlib.h zlibVersion -lz; } +-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 +-enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma ++if enabled debug_configure; then ++ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d ++ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad ++else ++ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 ++ enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma ++fi + + # On some systems dynamic loading requires no extra linker flags + check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 15be7468b..079880ab3 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -12,10 +12,10 @@ vcpkg_extract_source_archive_ex( PATCHES create-lib-libraries.patch detect-openssl.patch - configure_opencv.patch fix_windowsinclude-in-ffmpegexe-1.patch fix_windowsinclude-in-ffmpegexe-2.patch fix_libvpx_windows_linking.patch + fix-debug-build.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -25,7 +25,7 @@ endif() vcpkg_find_acquire_program(YASM) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) set(SEP ";") #We're assuming that if we're building for Windows we're using MSVC set(INCLUDE_VAR "INCLUDE") @@ -36,7 +36,7 @@ else() set(LIB_PATH_VAR "LIBRARY_PATH") endif() -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) @@ -125,6 +125,10 @@ else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() +if("avresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avresample") +endif() + set(OPTIONS_CROSS "") if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") @@ -162,44 +166,51 @@ endif() message(STATUS "Building Options: ${OPTIONS}") -if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") +if(VCPKG_TARGET_IS_WINDOWS) if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") - set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd") + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd --debug") set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD") else() - set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd") + set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd --debug") set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT") endif() endif() set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") -set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}") - -message(STATUS "Building ${_csc_PROJECT_PATH} for Release") -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) -vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR - "${SOURCE_PATH}" # SOURCE DIR - "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR - "${OPTIONS} ${OPTIONS_RELEASE}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel - LOGNAME build-${TARGET_TRIPLET}-rel -) -set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}") - -message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") -file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) -vcpkg_execute_required_process( - COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" - "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR - "${SOURCE_PATH}" # SOURCE DIR - "${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR - "${OPTIONS} ${OPTIONS_DEBUG}" - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg - LOGNAME build-${TARGET_TRIPLET}-dbg -) +# Relase build +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) + message(STATUS "Building Relase Options: ${OPTIONS_RELEASE}") + set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}") + message(STATUS "Building ${_csc_PROJECT_PATH} for Release") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR + "${SOURCE_PATH}" # SOURCE DIR + "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR + "${OPTIONS} ${OPTIONS_RELEASE}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel + LOGNAME build-${TARGET_TRIPLET}-rel + ) +endif() + +# Debug build +if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) + message(STATUS "Building Debug Options: ${OPTIONS_DEBUG}") + set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}") + message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") + file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}" + "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR + "${SOURCE_PATH}" # SOURCE DIR + "${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR + "${OPTIONS} ${OPTIONS_DEBUG}" + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg + LOGNAME build-${TARGET_TRIPLET}-dbg + ) +endif() file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def) |
