fix building with VideoToolbox when deployment target is less than 11

pull/253/head
Andrey Filipenkov 4 years ago
parent 48533712d9
commit 5c5896e225
  1. 7
      scripts/apple/ffmpeg.sh
  2. 5
      scripts/function-ios.sh
  3. 2
      scripts/function.sh

@ -444,6 +444,13 @@ ${SED_INLINE} 's/static int av_log_level/__thread int av_log_level/g' "${BASEDIR
FFMPEG_VERSION="v$(get_user_friendly_ffmpeg_version)"
${SED_INLINE} "s/\$version/$FFMPEG_VERSION/g" "${BASEDIR}"/src/"${LIB_NAME}"/ffbuild/version.sh 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
# 5. Add iOS/tvOS availability checks for videotoolbox
${SED_INLINE} -E \
-e 's/__builtin_available\(macOS 10\.11, \*\)/__builtin_available(macOS 10.11, iOS 9.0, tvOS 9.0, *)/g' \
-e 's/__builtin_available\(macOS 10\.12, \*\)/__builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, *)/g' \
-e 's/__builtin_available\(macOS 10\.13, \*\)/__builtin_available(macOS 10.13, iOS 11.0, tvOS 11.0, *)/g' \
"${BASEDIR}"/src/${LIB_NAME}/libavutil/hwcontext_videotoolbox.c 1>>"${BASEDIR}"/build.log 2>&1 || exit 1
###################################################################
./configure \

@ -71,11 +71,6 @@ enable_lts_build() {
# MAC CATALYST IS INTRODUCED IN 13.0
export MAC_CATALYST_MIN_VERSION=13.0
# IOS SDK 9.3 SUPPORTS VIDEOTOOLBOX
# HOWEVER, THE LATEST FFMPEG VERSION USES SDK 11.0 APIS
# THEREFORE, VIDEOTOOLBOX IS DISABLED IN LTS RELEASES
ENABLED_LIBRARIES[LIBRARY_VIDEOTOOLBOX]=0
}
get_common_includes() {

@ -267,7 +267,7 @@ is_library_supported_on_platform() {
# ONLY IOS, MACOS AND TVOS MAIN
52)
if [[ ${FFMPEG_KIT_BUILD_TYPE} == "ios" ]] && [[ $1 == "ios-videotoolbox" ]] && [[ -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
if [[ ${FFMPEG_KIT_BUILD_TYPE} == "ios" ]] && [[ $1 == "ios-videotoolbox" ]]; then
echo "0"
elif [[ ${FFMPEG_KIT_BUILD_TYPE} == "macos" ]] && [[ $1 == "macos-videotoolbox" ]]; then
echo "0"

Loading…
Cancel
Save