Skip to content

Fix WebRTC symbol clash #709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LiveKitClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |spec|

spec.source_files = "Sources/**/*"

spec.dependency("LiveKitWebRTC", "= 125.6422.29")
spec.dependency("LiveKitWebRTC", "= 125.6422.32")
spec.dependency("SwiftProtobuf")
spec.dependency("Logging", "= 1.5.4")
spec.dependency("DequeModule", "= 1.1.4")
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let package = Package(
],
dependencies: [
// LK-Prefixed Dynamic WebRTC XCFramework
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.29"),
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.32"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.26.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.4"),
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"),
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
],
dependencies: [
// LK-Prefixed Dynamic WebRTC XCFramework
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.29"),
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.32"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.2"), // 1.6.x requires Swift >=5.8
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"),
Expand Down
2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
],
dependencies: [
// LK-Prefixed Dynamic WebRTC XCFramework
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.29"),
.package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "125.6422.32"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.29.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.6.2"), // 1.6.x requires Swift >=5.8
.package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal import LiveKitWebRTC
class AudioDeviceModuleDelegateAdapter: NSObject, LKRTCAudioDeviceModuleDelegate {
weak var audioManager: AudioManager?

func audioDeviceModule(_: LKRTCAudioDeviceModule, didReceiveSpeechActivityEvent speechActivityEvent: RTCSpeechActivityEvent) {
func audioDeviceModule(_: LKRTCAudioDeviceModule, didReceiveSpeechActivityEvent speechActivityEvent: LKRTCSpeechActivityEvent) {
guard let audioManager else { return }
audioManager._state.onMutedSpeechActivity?(audioManager, speechActivityEvent.toLKType())
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Audio/AudioEngineObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal import LiveKitWebRTC
@_implementationOnly import LiveKitWebRTC
#endif

public let AudioEngineInputMixerNodeKey = kRTCAudioEngineInputMixerNodeKey
public let AudioEngineInputMixerNodeKey = kLKRTCAudioEngineInputMixerNodeKey

/// Do not retain the engine object.
public protocol AudioEngineObserver: NextInvokable, Sendable {
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Audio/DefaultMixerAudioObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public final class DefaultMixerAudioObserver: AudioEngineObserver, Loggable {

public func engineWillConnectInput(_ engine: AVAudioEngine, src: AVAudioNode?, dst: AVAudioNode, format: AVAudioFormat, context: [AnyHashable: Any]) -> Int {
// Get the main mixer
guard let mainMixerNode = context[kRTCAudioEngineInputMixerNodeKey] as? AVAudioMixerNode else {
guard let mainMixerNode = context[kLKRTCAudioEngineInputMixerNodeKey] as? AVAudioMixerNode else {
// If failed to get main mixer, call next and return.
return next?.engineWillConnectInput(engine, src: src, dst: dst, format: format, context: context) ?? 0
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public enum AudioDeviceModuleType {
}

extension AudioDeviceModuleType {
func toRTCType() -> RTCAudioDeviceModuleType {
func toRTCType() -> LKRTCAudioDeviceModuleType {
switch self {
case .audioEngine: return RTCAudioDeviceModuleType.audioEngine
case .platformDefault: return RTCAudioDeviceModuleType.platformDefault
case .audioEngine: return LKRTCAudioDeviceModuleType.audioEngine
case .platformDefault: return LKRTCAudioDeviceModuleType.platformDefault
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/LiveKit/Audio/Manager/AudioManager+MuteMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public extension AudioManager {

@available(*, deprecated, message: "Use `set(muteMode:)` instead")
func setLegacyMuteMode(_ enabled: Bool) throws {
let mode: RTCAudioEngineMuteMode = enabled ? .restartEngine : .voiceProcessing
let mode: LKRTCAudioEngineMuteMode = enabled ? .restartEngine : .voiceProcessing
let result = RTC.audioDeviceModule.setMuteMode(mode)
try checkAdmResult(code: result)
}
}

// MARK: - Internal

extension RTCAudioEngineMuteMode {
extension LKRTCAudioEngineMuteMode {
func toLKType() -> MicrophoneMuteMode {
switch self {
case .voiceProcessing: return .voiceProcessing
Expand All @@ -84,7 +84,7 @@ extension RTCAudioEngineMuteMode {
}

extension MicrophoneMuteMode {
func toRTCType() -> RTCAudioEngineMuteMode {
func toRTCType() -> LKRTCAudioEngineMuteMode {
switch self {
case .unknown: return .unknown
case .voiceProcessing: return .voiceProcessing
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Audio/Manager/AudioManager+Testing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal import LiveKitWebRTC

// Only internal testing.
extension AudioManager {
var engineState: RTCAudioEngineState {
var engineState: LKRTCAudioEngineState {
get { RTC.audioDeviceModule.engineState }
set { RTC.audioDeviceModule.engineState = newValue }
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/LiveKit/Core/RTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal import LiveKitWebRTC
private extension Array where Element: LKRTCVideoCodecInfo {
func rewriteCodecsIfNeeded() -> [LKRTCVideoCodecInfo] {
// rewrite H264's profileLevelId to 42e032
let codecs = map { $0.name == kRTCVideoCodecH264Name ? RTC.h264BaselineLevel5CodecInfo : $0 }
let codecs = map { $0.name == kLKRTCVideoCodecH264Name ? RTC.h264BaselineLevel5CodecInfo : $0 }
// logger.log("supportedCodecs: \(codecs.map({ "\($0.name) - \($0.parameters)" }).joined(separator: ", "))", type: Engine.self)
return codecs
}
Expand Down Expand Up @@ -66,7 +66,7 @@ actor RTC {
}

// create a new H264 codec with new profileLevelId
return LKRTCVideoCodecInfo(name: kRTCH264CodecName,
return LKRTCVideoCodecInfo(name: kLKRTCH264CodecName,
parameters: ["profile-level-id": profileLevelId.hexString,
"level-asymmetry-allowed": "1",
"packetization-mode": "1"])
Expand All @@ -85,8 +85,8 @@ actor RTC {

static let audioProcessingModule: LKRTCDefaultAudioProcessingModule = .init()

static let videoSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kRTCMediaStreamTrackKindVideo)
static let audioSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kRTCMediaStreamTrackKindAudio)
static let videoSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kLKRTCMediaStreamTrackKindVideo)
static let audioSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kLKRTCMediaStreamTrackKindAudio)

static let peerConnectionFactory: LKRTCPeerConnectionFactory = {
// Update pc init lock
Expand All @@ -97,7 +97,7 @@ actor RTC {

logger.log("Initializing SSL...", type: Room.self)

RTCInitializeSSL()
LKRTCInitializeSSL()

logger.log("Initializing PeerConnectionFactory...", type: Room.self)

Expand Down Expand Up @@ -157,7 +157,7 @@ actor RTC {
try DispatchQueue.liveKitWebRTC.sync { try LKRTCIceCandidate(fromJsonString: fromJsonString) }
}

static func createSessionDescription(type: RTCSdpType, sdp: String) -> LKRTCSessionDescription {
static func createSessionDescription(type: LKRTCSdpType, sdp: String) -> LKRTCSessionDescription {
DispatchQueue.liveKitWebRTC.sync { LKRTCSessionDescription(type: type, sdp: sdp) }
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/LiveKit/Core/Room+TransportDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal import LiveKitWebRTC
@_implementationOnly import LiveKitWebRTC
#endif

extension RTCPeerConnectionState {
extension LKRTCPeerConnectionState {
var isConnected: Bool {
self == .connected
}
Expand All @@ -33,7 +33,7 @@ extension RTCPeerConnectionState {
}

extension Room: TransportDelegate {
func transport(_ transport: Transport, didUpdateState pcState: RTCPeerConnectionState) {
func transport(_ transport: Transport, didUpdateState pcState: LKRTCPeerConnectionState) {
log("target: \(transport.target), connectionState: \(pcState.description)")

// primary connected
Expand Down
14 changes: 7 additions & 7 deletions Sources/LiveKit/Core/Transport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ actor Transport: NSObject, Loggable {
nonisolated let target: Livekit_SignalTarget
nonisolated let isPrimary: Bool

var connectionState: RTCPeerConnectionState {
var connectionState: LKRTCPeerConnectionState {
_pc.connectionState
}

Expand All @@ -48,7 +48,7 @@ actor Transport: NSObject, Loggable {
_pc.remoteDescription
}

var signalingState: RTCSignalingState {
var signalingState: LKRTCSignalingState {
_pc.signalingState
}

Expand Down Expand Up @@ -154,7 +154,7 @@ actor Transport: NSObject, Loggable {
var constraints = [String: String]()
if iceRestart {
log("Restarting ICE...")
constraints[kRTCMediaConstraintsIceRestart] = kRTCMediaConstraintsValueTrue
constraints[kLKRTCMediaConstraintsIceRestart] = kLKRTCMediaConstraintsValueTrue
_isRestartingIce = true
}

Expand Down Expand Up @@ -216,7 +216,7 @@ extension Transport {
// MARK: - RTCPeerConnectionDelegate

extension Transport: LKRTCPeerConnectionDelegate {
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange state: RTCPeerConnectionState) {
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange state: LKRTCPeerConnectionState) {
log("[Connect] Transport(\(target)) did update state: \(state.description)")
_delegate.notify { $0.transport(self, didUpdateState: state) }
}
Expand Down Expand Up @@ -255,11 +255,11 @@ extension Transport: LKRTCPeerConnectionDelegate {
_delegate.notify { $0.transport(self, didOpenDataChannel: dataChannel) }
}

nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: RTCIceConnectionState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: LKRTCIceConnectionState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didRemove _: LKRTCMediaStream) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: RTCSignalingState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: LKRTCSignalingState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didAdd _: LKRTCMediaStream) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: RTCIceGatheringState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didChange _: LKRTCIceGatheringState) {}
nonisolated func peerConnection(_: LKRTCPeerConnection, didRemove _: [LKRTCIceCandidate]) {}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/LiveKit/E2EE/E2EEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class E2EEManager: NSObject, @unchecked Sendable, ObservableObject, Logga

func frameCryptor(_ frameCryptor: LKRTCFrameCryptor,
didStateChangeWithParticipantId participantId: String,
with stateChanged: FrameCryptionState)
with stateChanged: LKRTCFrameCryptorState)
{
// Redirect
target?.frameCryptor(frameCryptor, didStateChangeWithParticipantId: participantId, with: stateChanged)
Expand Down Expand Up @@ -174,7 +174,7 @@ public class E2EEManager: NSObject, @unchecked Sendable, ObservableObject, Logga
}

extension E2EEManager {
func frameCryptor(_ frameCryptor: LKRTCFrameCryptor, didStateChangeWithParticipantId participantId: String, with state: FrameCryptionState) {
func frameCryptor(_ frameCryptor: LKRTCFrameCryptor, didStateChangeWithParticipantId participantId: String, with state: LKRTCFrameCryptorState) {
guard let room = _room else {
log("room is nil", .warning)
return
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/E2EE/State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public extension E2EEState {
}
}

extension FrameCryptionState {
extension LKRTCFrameCryptorState {
func toLKType() -> E2EEState {
switch self {
case .new: return .new
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Extensions/CustomStringConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extension Track.Source: CustomStringConvertible {
}
}

extension RTCPeerConnectionState {
extension LKRTCPeerConnectionState {
var description: String {
switch self {
case .new: return ".new"
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Extensions/RTCMediaConstraints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ internal import LiveKitWebRTC
extension LKRTCMediaConstraints {
static let defaultPCConstraints = LKRTCMediaConstraints(
mandatoryConstraints: nil,
optionalConstraints: ["DtlsSrtpKeyAgreement": kRTCMediaConstraintsValueTrue]
optionalConstraints: ["DtlsSrtpKeyAgreement": kLKRTCMediaConstraintsValueTrue]
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ extension Dimensions {
}

extension CGImagePropertyOrientation {
func toRTCRotation() -> RTCVideoRotation {
func toRTCRotation() -> LKRTCVideoRotation {
switch self {
case .up, .upMirrored, .down, .downMirrored: return ._0
case .left, .leftMirrored: return ._90
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Participant/LocalParticipant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ extension LocalParticipant {
if let rtcDegradationPreference = publishOptions.degradationPreference.toRTCType() {
return NSNumber(value: rtcDegradationPreference.rawValue)
} else if track.source == .screenShareVideo || publishOptions.simulcast {
return NSNumber(value: RTCDegradationPreference.maintainResolution.rawValue)
return NSNumber(value: LKRTCDegradationPreference.maintainResolution.rawValue)
}
return nil
}()
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Protocols/TransportDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal import LiveKitWebRTC
#endif

protocol TransportDelegate: AnyObject, Sendable {
func transport(_ transport: Transport, didUpdateState state: RTCPeerConnectionState)
func transport(_ transport: Transport, didUpdateState state: LKRTCPeerConnectionState)
func transport(_ transport: Transport, didGenerateIceCandidate iceCandidate: IceCandidate)
func transport(_ transport: Transport, didOpenDataChannel dataChannel: LKRTCDataChannel)
func transport(_ transport: Transport, didAddTrack track: LKRTCMediaStreamTrack, rtpReceiver: LKRTCRtpReceiver, streams: [LKRTCMediaStream])
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Track/Capturers/VideoCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ extension VideoCapturer {
}

// attempt to determine rotation information if buffer is coming from ReplayKit
var rotation: RTCVideoRotation?
var rotation: LKRTCVideoRotation?
if #available(macOS 11.0, *) {
// Check rotation tags. Extensions see these tags, but `RPScreenRecorder` does not appear to set them.
// On iOS 12.0 and 13.0 rotation tags (other than up) are set by extensions.
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Types/DegradationPreference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public enum DegradationPreference: Int, Sendable {
}

extension DegradationPreference {
func toRTCType() -> RTCDegradationPreference? {
func toRTCType() -> LKRTCDegradationPreference? {
switch self {
case .auto: return nil
case .disabled: return .disabled
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Types/Dimensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ extension Dimensions {
// MARK: - Convert

extension Dimensions {
func apply(rotation: RTCVideoRotation) -> Dimensions {
func apply(rotation: LKRTCVideoRotation) -> Dimensions {
if rotation == ._90 || rotation == ._270 {
return swapped()
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Types/IceTransportPolicy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public enum IceTransportPolicy: Int, Sendable {
}

extension IceTransportPolicy {
func toRTCType() -> RTCIceTransportPolicy {
func toRTCType() -> LKRTCIceTransportPolicy {
switch self {
case .none: return .none
case .relay: return .relay
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Types/SessionDescription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension LKRTCSessionDescription {

extension Livekit_SessionDescription {
func toRTCType() -> LKRTCSessionDescription {
var sdpType: RTCSdpType
var sdpType: LKRTCSdpType
switch type {
case "answer": sdpType = .answer
case "offer": sdpType = .offer
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Types/SpeechActivityEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum SpeechActivityEvent {
case ended
}

extension RTCSpeechActivityEvent {
extension LKRTCSpeechActivityEvent {
func toLKType() -> SpeechActivityEvent {
switch self {
case .started: return .started
Expand Down
6 changes: 3 additions & 3 deletions Sources/LiveKit/Types/VideoRotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public enum VideoRotation: Int, Sendable, Codable {
case _270 = 270
}

extension RTCVideoRotation {
extension LKRTCVideoRotation {
func toLKType() -> VideoRotation {
VideoRotation(rawValue: rawValue)!
}
}

extension VideoRotation {
func toRTCType() -> RTCVideoRotation {
RTCVideoRotation(rawValue: rawValue)!
func toRTCType() -> LKRTCVideoRotation {
LKRTCVideoRotation(rawValue: rawValue)!
}
}
2 changes: 1 addition & 1 deletion Tests/LiveKitTests/LKTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import XCTest
class LKTestCase: XCTestCase {
private static let _globalSetup: Bool = {
LiveKitSDK.setLoggerStandardOutput()
RTCSetMinDebugLogLevel(.info)
LKRTCSetMinDebugLogLevel(.info)
return true
}()

Expand Down
2 changes: 1 addition & 1 deletion Tests/LiveKitTests/MuteTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct TestEngineStep {
let assert: TestEngineAssert
}

extension RTCAudioEngineState: Swift.CustomStringConvertible {
extension LKRTCAudioEngineState: Swift.CustomStringConvertible {
public var description: String {
"EngineState(" +
"outputEnabled: \(outputEnabled), " +
Expand Down
Loading