aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungho Kim <melchi45@gmail.com>2018-03-12 22:13:14 +0900
committerRobert Schumacher <roschuma@microsoft.com>2018-03-19 08:42:47 -0700
commit5968ebf9f4beae3a0662dfc6ba343b0be07a1241 (patch)
tree7f60473e177c1fea4e5ab2e846b3ef515c735041
parent371cc14917223f427fa42889b774bc6b5539f864 (diff)
downloadvcpkg-5968ebf9f4beae3a0662dfc6ba343b0be07a1241.tar.gz
vcpkg-5968ebf9f4beae3a0662dfc6ba343b0be07a1241.zip
[ffmpeg] Add options
-rw-r--r--ports/ffmpeg/CONTROL31
-rw-r--r--ports/ffmpeg/FindFFMPEG.cmake2
-rw-r--r--ports/ffmpeg/configure_opencv.patch11
-rw-r--r--ports/ffmpeg/portfile.cmake59
4 files changed, 98 insertions, 5 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index 3ed4c4bac..2f635cc10 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,8 +1,35 @@
Source: ffmpeg
-Version: 3.3.3-3
+Version: 3.3.3-4
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.
+Feature: ffserver
+Description: ffserver appplication support in ffmpeg
+
+Feature: ffplay
+Description: ffplay appplication support in ffmpeg
+
+Feature: ffprobe
+Description: ffprobe appplication support in ffmpeg
+
Feature: openssl
-Build-Depends: openssl
+Build-Depends: openssl, ffmpeg[nonfree]
Description: openssl support in ffmpeg
+
+Feature: lzma
+Build-Depends: liblzma
+Description: lzma support in ffmpeg
+
+Feature: x264
+Build-Depends: x264, ffmpeg[gpl]
+Description: x264 support in ffmpeg
+
+Feature: opencl
+Build-Depends: opencl
+Description: opencl support in ffmpeg
+
+Feature: nonfree
+Description: allow nonfree and unredistributable libraries
+
+Feature: gpl
+Description: allow GPL licensed libraries
diff --git a/ports/ffmpeg/FindFFMPEG.cmake b/ports/ffmpeg/FindFFMPEG.cmake
index ce6e7e600..bd373bfae 100644
--- a/ports/ffmpeg/FindFFMPEG.cmake
+++ b/ports/ffmpeg/FindFFMPEG.cmake
@@ -8,4 +8,4 @@ foreach(FFMPEG_SUBLIBRARY avformat avdevice avcodec avutil swscale)
endforeach()
list(APPEND FFMPEG_LIBRARIES wsock32 ws2_32 Secur32)
-find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIR)
+find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
diff --git a/ports/ffmpeg/configure_opencv.patch b/ports/ffmpeg/configure_opencv.patch
new file mode 100644
index 000000000..66678661e
--- /dev/null
+++ b/ports/ffmpeg/configure_opencv.patch
@@ -0,0 +1,11 @@
+--- a/configure
++++ b/configure
+@@ -5804,7 +5804,7 @@
+ enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
+ enabled libopencv && { check_header opencv2/core/core_c.h &&
+ { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
+- require opencv 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 opencv opencv/cxcore.h cvCreateImageHeader; }
+ enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
+ enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 56b467685..11c24ebc7 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -3,7 +3,7 @@ set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.3.3)
vcpkg_download_distfile(ARCHIVE
URLS "http://ffmpeg.org/releases/ffmpeg-3.3.3.tar.bz2"
FILENAME "ffmpeg-3.3.3.tar.bz2"
- SHA512 1cc63bf73356f4e618c0d3572a216bdf5689f10deff56b4262f6d740b0bee5a4b3eac234f45fca3d4d2da77903a507b4fba725b76d2d2070f31b6dae9e7a2dab
+ SHA512 1cc63bf73356f4e618c0d3572a216bdf5689f10deff56b4262f6d740b0bee5a4b3eac234f45fca3d4d2da77903a507b4fba725b76d2d2070f31b6dae9e7a2dab
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
@@ -11,6 +11,7 @@ vcpkg_apply_patches(
PATCHES
${CMAKE_CURRENT_LIST_DIR}/create-lib-libraries.patch
${CMAKE_CURRENT_LIST_DIR}/detect-openssl.patch
+ ${CMAKE_CURRENT_LIST_DIR}/configure_opencv.patch
)
vcpkg_find_acquire_program(YASM)
@@ -30,14 +31,66 @@ set(_csc_PROJECT_PATH ffmpeg)
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
-set(OPTIONS "--disable-ffmpeg --disable-ffprobe --disable-doc --enable-debug")
+set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --disable-ffmpeg")
set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect")
+
+if("nonfree" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-nonfree")
+endif()
+
+if("gpl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-gpl")
+endif()
+
if("openssl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-openssl")
else()
set(OPTIONS "${OPTIONS} --disable-openssl")
endif()
+if("ffplay" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffplay")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffplay")
+endif()
+
+if("ffserver" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffserver")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffserver")
+endif()
+
+if("ffprobe" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffprobe")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffprobe")
+endif()
+
+if("x264" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libx264")
+else()
+ set(OPTIONS "${OPTIONS} --disable-libx264")
+endif()
+
+if("opencl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-opencl")
+else()
+ set(OPTIONS "${OPTIONS} --disable-opencl")
+endif()
+
+if("lzma" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-lzma")
+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(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}")
@@ -68,6 +121,8 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
endif()
endif()
+message(STATUS "Building Options: ${OPTIONS}")
+
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")