aboutsummaryrefslogtreecommitdiff
path: root/ports/ffmpeg
diff options
context:
space:
mode:
authorAndrei Lebedev <lebdron@gmail.com>2019-06-12 08:25:07 +0300
committerAndrei Lebedev <lebdron@gmail.com>2019-06-12 08:25:07 +0300
commit34d19da9ffd0571bf16190ec4a16a04bef265900 (patch)
tree413690269c5f216194b9a0f72f0438b27ccfd68d /ports/ffmpeg
parentb395438c791ca9f78e383a1d571525eee785e67c (diff)
parent59a8a9c6248ed230b19028a44484ae5f06db697d (diff)
downloadvcpkg-34d19da9ffd0571bf16190ec4a16a04bef265900.tar.gz
vcpkg-34d19da9ffd0571bf16190ec4a16a04bef265900.zip
Merge branch 'master' into openssl-unix-dynamic
Diffstat (limited to 'ports/ffmpeg')
-rw-r--r--ports/ffmpeg/CONTROL10
-rw-r--r--ports/ffmpeg/fix_libvpx_windows_linking.patch55
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch4
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch4
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch19
-rw-r--r--ports/ffmpeg/portfile.cmake78
6 files changed, 121 insertions, 49 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index ce961fa55..ca28e399e 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,5 +1,5 @@
Source: ffmpeg
-Version: 4.1-4
+Version: 4.1-6
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.
@@ -23,6 +23,14 @@ Feature: lzma
Build-Depends: liblzma
Description: lzma support in ffmpeg
+Feature: bzip2
+Build-Depends: bzip2
+Description: bzip2 support in ffmpeg
+
+Feature: vpx
+Build-Depends: libvpx
+Description: WebM VP8/VP9 support in ffmpeg
+
Feature: x264
Build-Depends: x264, ffmpeg[gpl]
Description: x264 support in ffmpeg
diff --git a/ports/ffmpeg/fix_libvpx_windows_linking.patch b/ports/ffmpeg/fix_libvpx_windows_linking.patch
new file mode 100644
index 000000000..805cd7e78
--- /dev/null
+++ b/ports/ffmpeg/fix_libvpx_windows_linking.patch
@@ -0,0 +1,55 @@
+diff --git "a/configure" "b/configure"
+index c8be177..2fef830 100644
+--- "a/configure"
++++ "b/configure"
+@@ -5098,6 +5098,8 @@ case "$arch" in
+ ;;
+ esac
+
++libvpx_name=vpx
++
+ # OS specific
+ case $target_os in
+ aix)
+@@ -5269,6 +5271,15 @@ case $target_os in
+ enabled x86_64 && objformat="win64" || objformat="win32"
+ ranlib=:
+ enable dos_paths
++ if [ -z "${extra_cflags##*-MDd*}" ]; then
++ libvpx_name=vpxmdd
++ elif [ -z "${extra_cflags##*-MD*}" ]; then
++ libvpx_name=vpxmd
++ elif [ -z "${extra_cflags##*-MTd*}" ]; then
++ libvpx_name=vpxmtd
++ elif [ -z "${extra_cflags##*-MT*}" ]; then
++ libvpx_name=vpxmt
++ fi
+ ;;
+ cygwin*)
+ target_os=cygwin
+@@ -6153,21 +6164,21 @@ enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h
+ enabled libvpx && {
+ enabled libvpx_vp8_decoder && {
+ check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
+- check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
++ check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -l$libvpx_name ||
+ die "ERROR: libvpx decoder version must be >=1.4.0";
+ }
+ enabled libvpx_vp8_encoder && {
+ check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
+- check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
++ check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -l$libvpx_name ||
+ die "ERROR: libvpx encoder version must be >=1.4.0";
+ }
+ enabled libvpx_vp9_decoder && {
+ check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
+- check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
++ check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs"
+ }
+ enabled libvpx_vp9_encoder && {
+ check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
+- check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
++ check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-l$libvpx_name $libm_extralibs"
+ }
+ if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
+ die "libvpx enabled but no supported decoders found"
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch
index 345061c3f..09ee1219f 100644
--- a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch
+++ b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch
@@ -1,5 +1,5 @@
---- a/cmdutils.c 2017-07-29 19:49:29.000000000 +0200
-+++ b/cmdutils.c 2018-09-02 20:31:42.509408400 +0200
+--- a/fftools/cmdutils.c 2017-07-29 19:49:29.000000000 +0200
++++ b/fftools/cmdutils.c 2018-09-02 20:31:42.509408400 +0200
@@ -62,6 +62,8 @@
#include <sys/resource.h>
#endif
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch
index fc63f1486..69d725e2a 100644
--- a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch
+++ b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch
@@ -1,5 +1,5 @@
---- a/ffmpeg.c 2017-07-29 19:49:29.000000000 +0200
-+++ b/ffmpeg.c 2018-09-02 20:32:27.666725200 +0200
+--- a/fftools/ffmpeg.c 2017-07-29 19:49:29.000000000 +0200
++++ b/fftools/ffmpeg.c 2018-09-02 20:32:27.666725200 +0200
@@ -23,6 +23,11 @@
* multimedia converter based on the FFmpeg libraries
*/
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch
deleted file mode 100644
index 78aa3d2d0..000000000
--- a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/ffmpeg_dxva2.c 2017-07-29 19:49:29.000000000 +0200
-+++ b/ffmpeg_dxva2.c 2018-09-02 20:33:48.248716100 +0200
-@@ -16,12 +16,14 @@
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
--#include <windows.h>
--
- #ifdef _WIN32_WINNT
- #undef _WIN32_WINNT
- #endif
- #define _WIN32_WINNT 0x0600
-+#define WIN32_LEAN_AND_MEAN
-+
-+#include <windows.h>
-+
- #define DXVA2API_USE_BITFIELDS
- #define COBJMACROS
-
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 786d82ea1..1ce53a996 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -15,7 +15,7 @@ vcpkg_extract_source_archive_ex(
configure_opencv.patch
fix_windowsinclude-in-ffmpegexe-1.patch
fix_windowsinclude-in-ffmpegexe-2.patch
- fix_windowsinclude-in-ffmpegexe-3.patch
+ fix_libvpx_windows_linking.patch
)
if (${SOURCE_PATH} MATCHES " ")
@@ -25,16 +25,28 @@ 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")
+ set(SEP ";")
+ #We're assuming that if we're building for Windows we're using MSVC
+ set(INCLUDE_VAR "INCLUDE")
+ set(LIB_PATH_VAR "LIB")
+else()
+ set(SEP ":")
+ set(INCLUDE_VAR "CPATH")
+ set(LIB_PATH_VAR "LIBRARY_PATH")
+endif()
+
if (WIN32)
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
+
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
- if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make)
else()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make)
endif()
-
+
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
else()
set(ENV{PATH} "$ENV{PATH}:${YASM_EXE_PATH}")
@@ -42,8 +54,7 @@ else()
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/build_linux.sh)
endif()
-set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
-set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}")
+set(ENV{${INCLUDE_VAR}} "${CURRENT_INSTALLED_DIR}/include${SEP}$ENV{${INCLUDE_VAR}}")
set(_csc_PROJECT_PATH ffmpeg)
@@ -84,6 +95,12 @@ else()
set(OPTIONS "${OPTIONS} --disable-ffprobe")
endif()
+if("vpx" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libvpx")
+else()
+ set(OPTIONS "${OPTIONS} --disable-libvpx")
+endif()
+
if("x264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx264")
else()
@@ -102,34 +119,38 @@ else()
set(OPTIONS "${OPTIONS} --disable-lzma")
endif()
-# bzip2's debug library is named "bz2d", which isn't found by ffmpeg
-# if("bzip2" IN_LIST FEATURES)
-# set(OPTIONS "${OPTIONS} --enable-bzip2")
-# else()
-# set(OPTIONS "${OPTIONS} --disable-bzip2")
-# endif()
+if("bzip2" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-bzlib")
+else()
+ set(OPTIONS "${OPTIONS} --disable-bzlib")
+endif()
+
+set(OPTIONS_CROSS "")
+
+if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ set(OPTIONS_CROSS " --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}")
+ vcpkg_find_acquire_program(GASPREPROCESSOR)
+ foreach(GAS_PATH ${GASPREPROCESSOR})
+ get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
+ set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}")
+ endforeach(GAS_PATH)
+elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+else()
+ message(FATAL_ERROR "Unsupported architecture")
+endif()
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
- set(OPTIONS "${OPTIONS} --disable-programs --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}")
+ set(OPTIONS "${OPTIONS} --disable-programs")
set(OPTIONS "${OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00")
-
- if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
- vcpkg_find_acquire_program(GASPREPROCESSOR)
- foreach(GAS_PATH ${GASPREPROCESSOR})
- get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
- set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}")
- endforeach(GAS_PATH)
- elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
- elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
- else()
- message(FATAL_ERROR "Unsupported architecture")
- endif()
+ set(OPTIONS_CROSS " --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}")
endif()
set(OPTIONS_DEBUG "") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html
set(OPTIONS_RELEASE "")
+set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}")
set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
@@ -141,7 +162,7 @@ endif()
message(STATUS "Building Options: ${OPTIONS}")
-if(WIN32)
+if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd")
set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD")
@@ -151,6 +172,9 @@ if(WIN32)
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(
@@ -163,6 +187,8 @@ vcpkg_execute_required_process(
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(
@@ -179,6 +205,8 @@ file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/de
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
+elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
+ set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")