Build VP9 on iOS and allow client to configure whether it's enabled

This commit is contained in:
Miriam Zimmerman 2026-01-23 12:38:33 -05:00 committed by GitHub
parent 2fa547b7bc
commit 4fa3fd6d70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 4 deletions

View File

@ -133,7 +133,7 @@ then
else
ARCHS=("simulator:x64" "simulator:arm64" "device:arm64")
fi
EXTRA_GN_ARGS="rtc_build_examples=false rtc_build_tools=false rtc_include_tests=false rtc_enable_protobuf=false rtc_enable_sctp=false rtc_libvpx_build_vp9=false rtc_disable_metrics=true rtc_disable_trace_events=true"
EXTRA_GN_ARGS="rtc_build_examples=false rtc_build_tools=false rtc_include_tests=false rtc_enable_protobuf=false rtc_enable_sctp=false rtc_libvpx_build_vp9=true rtc_disable_metrics=true rtc_disable_trace_events=true"
WEBRTC_BUILD_DIR="${WEBRTC_SRC_DIR}/out/${BUILD_TYPE}"
(cd "${WEBRTC_SRC_DIR}" && ./tools_webrtc/ios/build_ios_libs.py -o "${WEBRTC_BUILD_DIR}" --build_config ${BUILD_TYPE} --arch "${ARCHS[@]}" --deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" --extra-gn-args "${EXTRA_GN_ARGS}")

View File

@ -529,8 +529,9 @@ public class CallManager<CallType, CallManagerDelegateType>: CallManagerInterfac
/// - videoCaptureController: UI provided capturer interface
/// - dataMode: The desired data mode to start the session with
/// - audioLevelsIntervalMillis: If non-zero, the desired interval between audio level events (in milliseconds)
/// - enableVp9: Whether to allow use of the VP9 codec for video for this call
@MainActor
public func proceed(callId: UInt64, iceServers: [RTCIceServer], hideIp: Bool, videoCaptureController: VideoCaptureController, dataMode: DataMode, audioLevelsIntervalMillis: UInt64?) throws {
public func proceed(callId: UInt64, iceServers: [RTCIceServer], hideIp: Bool, videoCaptureController: VideoCaptureController, dataMode: DataMode, audioLevelsIntervalMillis: UInt64?, enableVp9: Bool = false) throws {
Logger.info("proceed(): callId: 0x\(String(callId, radix: 16)), hideIp: \(hideIp)")
for iceServer in iceServers {
for url in iceServer.urlStrings {
@ -564,7 +565,7 @@ public class CallManager<CallType, CallManagerDelegateType>: CallManagerInterfac
// creating the connection.
let appCallContext = CallContext(iceServers: iceServers, hideIp: hideIp, audioSource: audioSource, audioTrack: audioTrack, videoSource: videoSource, videoTrack: videoTrack, videoCaptureController: videoCaptureController)
let retPtr = ringrtcProceed(ringRtcCallManager, callId, appCallContext.getWrapper(), dataMode.rawValue, audioLevelsIntervalMillis ?? 0)
let retPtr = ringrtcProceed(ringRtcCallManager, callId, appCallContext.getWrapper(), dataMode.rawValue, audioLevelsIntervalMillis ?? 0, enableVp9)
if retPtr == nil {
throw CallManagerError.apiFailed(description: "proceed() function failure")
}

View File

@ -867,6 +867,11 @@ impl CallConfig {
self.data_mode = data_mode;
self
}
pub fn with_enable_vp9(mut self, enable_vp9: bool) -> Self {
self.enable_vp9 = enable_vp9;
self
}
}
// Benchmarking component list.

View File

@ -652,6 +652,7 @@ pub extern "C" fn ringrtcProceed(
appCallContext: AppCallContext,
dataMode: i32,
audioLevelsIntervalMillis: u64,
enable_vp9: bool,
) -> *mut c_void {
let audio_levels_interval = if audioLevelsIntervalMillis == 0 {
None
@ -662,7 +663,9 @@ pub extern "C" fn ringrtcProceed(
callManager as *mut IosCallManager,
callId,
appCallContext,
CallConfig::default().with_data_mode(DataMode::from_i32(dataMode)),
CallConfig::default()
.with_data_mode(DataMode::from_i32(dataMode))
.with_enable_vp9(enable_vp9),
audio_levels_interval,
) {
Ok(_v) => {