aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Cox <sander@paralleldimension.nl>2020-08-14 19:01:01 +0200
committerGitHub <noreply@github.com>2020-08-14 10:01:01 -0700
commit234f7e45430eda4f1f68ff75cabe11435e8b8190 (patch)
tree775a38329713c248d6b2a772031014120e846d7c
parent0c753a22868fc65322dbcdbf0340c2fc6864ee5e (diff)
downloadvcpkg-234f7e45430eda4f1f68ff75cabe11435e8b8190.tar.gz
vcpkg-234f7e45430eda4f1f68ff75cabe11435e8b8190.zip
[ffmpeg] Some libraries in ffmpeg can be optional (#12843)
* Make sub libraries of FFmpeg optional avdevice avfilter swresample swscale * Also adding avcodec and avformat * This should have been avcodec obviously
-rw-r--r--ports/ffmpeg/CONTROL22
-rw-r--r--ports/ffmpeg/FindFFMPEG.cmake.in66
-rw-r--r--ports/ffmpeg/portfile.cmake48
3 files changed, 119 insertions, 17 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index c318866af..a2a905b2c 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,11 +1,11 @@
Source: ffmpeg
Version: 4.2
-Port-Version: 17
+Port-Version: 18
Build-Depends: zlib
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.
-Default-Features: avresample
+Default-Features: avresample, avcodec, avformat, avdevice, avfilter, swresample, swscale
Feature: ffmpeg
Description: build the ffmpeg.exe application
@@ -55,6 +55,24 @@ Description: upgrade (L)GPL to version 3
Feature: avresample
Description: Libav audio resampling library support in ffmpeg
+Feature: avcodec
+Description: Codec support in ffmpeg
+
+Feature: avformat
+Description: Format support in ffmpeg
+
+Feature: avdevice
+Description: Device support in ffmpeg
+
+Feature: avfilter
+Description: Filter support in ffmpeg
+
+Feature: swresample
+Description: Swresample support in ffmpeg
+
+Feature: swscale
+Description: Swscale support in ffmpeg
+
Feature: nvcodec
Build-Depends: ffnvcodec, cuda
Description: Hardware accelerated codecs
diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in
index 7333e6083..5fbd9963d 100644
--- a/ports/ffmpeg/FindFFMPEG.cmake.in
+++ b/ports/ffmpeg/FindFFMPEG.cmake.in
@@ -131,32 +131,68 @@ if(APPLE)
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)
-FFMPEG_FIND(libavdevice avdevice avdevice.h)
-FFMPEG_FIND(libavfilter avfilter avfilter.h)
-FFMPEG_FIND(libavformat avformat avformat.h)
+if(@ENABLE_AVCODEC@)
+ FFMPEG_FIND(libavcodec avcodec avcodec.h)
+endif()
+if(@ENABLE_AVDEVICE@)
+ FFMPEG_FIND(libavdevice avdevice avdevice.h)
+endif()
+if(@ENABLE_AVFILTER@)
+ FFMPEG_FIND(libavfilter avfilter avfilter.h)
+endif()
+if(@ENABLE_AVFORMAT@)
+ FFMPEG_FIND(libavformat avformat avformat.h)
+endif()
if(@ENABLE_AVRESAMPLE@)
FFMPEG_FIND(libavresample avresample avresample.h)
endif()
FFMPEG_FIND(libavutil avutil avutil.h)
-FFMPEG_FIND(libswresample swresample swresample.h)
-FFMPEG_FIND(libswscale swscale swscale.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)
- 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})
+if(@ENABLE_SWRESAMPLE@)
+ FFMPEG_FIND(libswresample swresample swresample.h)
+endif()
+if(@ENABLE_SWSCALE@)
+ FFMPEG_FIND(libswscale swscale swscale.h)
+endif(@ENABLE_SWSCALE@)
+
+if (FFMPEG_libavutil_FOUND AND FFMPEG_libzlib_FOUND)
+ list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavutil_INCLUDE_DIRS})
+ if(FFMPEG_libavcodec_FOUND)
+ list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavcodec_INCLUDE_DIRS})
+ endif()
+ if(FFMPEG_libavdevice_FOUND)
+ list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavdevice_INCLUDE_DIRS})
+ endif()
+ if(FFMPEG_libavformat_FOUND)
+ list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS})
+ endif()
+ if(FFMPEG_libswscale_FOUND)
+ list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libswscale_INCLUDE_DIRS})
+ endif()
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
- set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
- set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
- set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
- set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ if(FFMPEG_libavcodec_FOUND)
+ set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
+ if(FFMPEG_libavdevice_FOUND)
+ set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
+ if(FFMPEG_libavfilter_FOUND)
+ set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
+ if(FFMPEG_libavformat_FOUND)
+ set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
if(FFMPEG_libavresample_FOUND)
set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
endif()
set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
- set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
- set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ if(FFMPEG_libswresample_FOUND)
+ set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
+ if(FFMPEG_libswscale_FOUND)
+ set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "")
+ endif()
list(APPEND FFMPEG_LIBRARIES
${FFMPEG_libavdevice_LIBRARY}
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 6fd6bc988..86fd3e5d9 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -133,6 +133,54 @@ if("avresample" IN_LIST FEATURES)
set(ENABLE_AVRESAMPLE ON) #necessary for configuring FFMPEG CMake Module
endif()
+if("avcodec" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-avcodec")
+ set(ENABLE_AVCODEC ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-avcodec")
+ set(ENABLE_AVCODEC OFF)
+endif()
+
+if("avdevice" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-avdevice")
+ set(ENABLE_AVDEVICE ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-avdevice")
+ set(ENABLE_AVDEVICE OFF)
+endif()
+
+if("avformat" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-avformat")
+ set(ENABLE_AVFORMAT ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-avformat")
+ set(ENABLE_AVFORMAT OFF)
+endif()
+
+if("avfilter" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-avfilter")
+ set(ENABLE_AVFILTER ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-avfilter")
+ set(ENABLE_AVFILTER OFF)
+endif()
+
+if("swresample" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-swresample")
+ set(ENABLE_SWRESAMPLE ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-swresample")
+ set(ENABLE_SWRESAMPLE OFF)
+endif()
+
+if("swscale" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-swscale")
+ set(ENABLE_SWSCALE ON)
+else()
+ set(OPTIONS "${OPTIONS} --disable-swscale")
+ set(ENABLE_SWSCALE OFF)
+endif()
+
if (VCPKG_TARGET_IS_OSX)
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
endif()