Skip to content

Commit

Permalink
auto-disable videotoolbox when tvos sdk version set does not support it
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Dec 21, 2021
1 parent 39dfa48 commit 4cf5850
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
9 changes: 9 additions & 0 deletions scripts/function-apple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ disable_macos_architecture_not_supported_on_detected_sdk_version() {
fi
}

disable_tvos_videotoolbox_on_not_supported_sdk_version() {

# INTRODUCED IN TVOS SDK 10.2
if [[ $(compare_versions "$TVOS_MIN_VERSION" "10.2") -lt 0 ]]; then
set_library "tvos-videotoolbox" 0
echo -e "INFO: Disabled tvos-videotoolbox which is not supported on tvOS SDK $TVOS_MIN_VERSION\n" 1>>"${BASEDIR}"/build.log 2>&1
fi
}

build_apple_architecture_variant_strings() {
export ALL_IOS_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_IOS}")"
export IPHONEOS_ARCHITECTURES="$(get_apple_architectures_for_variant "${ARCH_VAR_IPHONEOS}")"
Expand Down
5 changes: 0 additions & 5 deletions scripts/function-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ enable_lts_build() {
# MAC CATALYST IS INTRODUCED IN 13.0
export MAC_CATALYST_MIN_VERSION=13.0
fi

# 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() {
Expand Down
3 changes: 0 additions & 3 deletions scripts/function-tvos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ enable_lts_build() {
# XCODE 7.3 HAS TVOS SDK 9.2
export TVOS_MIN_VERSION=9.2
fi

# TVOS SDK 9.2 DOES NOT INCLUDE VIDEOTOOLBOX
ENABLED_LIBRARIES[LIBRARY_VIDEOTOOLBOX]=0
}

get_common_includes() {
Expand Down
15 changes: 1 addition & 14 deletions scripts/function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,6 @@ is_library_supported_on_platform() {
fi
;;

# ONLY IOS, MACOS AND TVOS MAIN
52)
if [[ ${FFMPEG_KIT_BUILD_TYPE} == "ios" ]] && [[ $1 == "ios-videotoolbox" ]] && [[ -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
echo "0"
elif [[ ${FFMPEG_KIT_BUILD_TYPE} == "macos" ]] && [[ $1 == "macos-videotoolbox" ]]; then
echo "0"
elif [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]] && [[ $1 == "tvos-videotoolbox" ]] && [[ -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
echo "0"
else
echo "1"
fi
;;

# ONLY IOS AND MACOS
53)
if [[ ${FFMPEG_KIT_BUILD_TYPE} == "ios" ]] && [[ $1 == "ios-avfoundation" ]]; then
Expand All @@ -290,7 +277,7 @@ is_library_supported_on_platform() {
;;

# IOS, MACOS AND TVOS
49 | 50 | 51 | 54 | 55)
49 | 50 | 51 | 52 | 54 | 55)
if [[ ${FFMPEG_KIT_BUILD_TYPE} == "ios" ]] || [[ ${FFMPEG_KIT_BUILD_TYPE} == "tvos" ]] || [[ ${FFMPEG_KIT_BUILD_TYPE} == "macos" ]]; then
echo "0"
else
Expand Down
3 changes: 3 additions & 0 deletions tvos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ fi
# DISABLE NOT SUPPORTED ARCHITECTURES
disable_tvos_architecture_not_supported_on_detected_sdk_version "${ARCH_ARM64_SIMULATOR}"

# DISABLE NOT SUPPORTED LIBRARIES
disable_tvos_videotoolbox_on_not_supported_sdk_version

# CHECK SOME RULES FOR .framework BUNDLES

# 1. DISABLE arm64-simulator WHEN arm64 IS ENABLED IN framework BUNDLES
Expand Down

0 comments on commit 4cf5850

Please sign in to comment.