-
Notifications
You must be signed in to change notification settings - Fork 230
WebRTC m144 #911
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
WebRTC m144 #911
Changes from 7 commits
b1abd69
5436258
992dbcb
ffd8a14
663a11a
45ce816
03edad9
9103a15
79fe355
665c607
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| // swift-tools-version:6.2 | ||
| // (Xcode26.0+) | ||
|
|
||
| import PackageDescription | ||
|
|
||
| let package = Package( | ||
| name: "LiveKit", | ||
| platforms: [ | ||
| .iOS(.v13), | ||
| .macOS(.v10_15), | ||
| .macCatalyst(.v14), | ||
| .tvOS(.v17), | ||
| .visionOS(.v26), | ||
| ], | ||
| products: [ | ||
| .library( | ||
| name: "LiveKit", | ||
| targets: ["LiveKit"] | ||
| ), | ||
| ], | ||
| dependencies: [ | ||
| // LK-Prefixed Dynamic WebRTC XCFramework | ||
| .package(url: "https://github.com/livekit/webrtc-xcframework.git", exact: "144.7559.01-alpha.1"), | ||
| .package(url: "https://github.com/livekit/livekit-uniffi-xcframework.git", exact: "0.0.5"), | ||
| .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.31.0"), | ||
| .package(url: "https://github.com/apple/swift-collections.git", "1.1.0" ..< "1.3.0"), | ||
| // Only used for DocC generation | ||
| .package(url: "https://github.com/apple/swift-docc-plugin.git", from: "1.3.0"), | ||
| ], | ||
| targets: [ | ||
| .target( | ||
| name: "LKObjCHelpers", | ||
| publicHeadersPath: "include" | ||
| ), | ||
| .target( | ||
| name: "LiveKit", | ||
| dependencies: [ | ||
| .product(name: "LiveKitWebRTC", package: "webrtc-xcframework"), | ||
| .product(name: "LiveKitUniFFI", package: "livekit-uniffi-xcframework"), | ||
| .product(name: "SwiftProtobuf", package: "swift-protobuf"), | ||
| .product(name: "DequeModule", package: "swift-collections"), | ||
| .product(name: "OrderedCollections", package: "swift-collections"), | ||
| "LKObjCHelpers", | ||
| ], | ||
| exclude: [ | ||
| "Broadcast/NOTICE", | ||
| ], | ||
| resources: [ | ||
| .process("PrivacyInfo.xcprivacy"), | ||
| ], | ||
| swiftSettings: [ | ||
| .enableExperimentalFeature("AccessLevelOnImport"), | ||
| ] | ||
| ), | ||
| .target( | ||
| name: "LiveKitTestSupport", | ||
| dependencies: [ | ||
| "LiveKit", | ||
| ], | ||
| path: "Tests/LiveKitTestSupport" | ||
| ), | ||
| .testTarget( | ||
| name: "LiveKitCoreTests", | ||
| dependencies: [ | ||
| "LiveKit", | ||
| "LiveKitTestSupport", | ||
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "LiveKitAudioTests", | ||
| dependencies: [ | ||
| "LiveKit", | ||
| "LiveKitTestSupport", | ||
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "LiveKitObjCTests", | ||
| dependencies: [ | ||
| "LiveKit", | ||
| "LiveKitTestSupport", | ||
| ] | ||
| ), | ||
| ], | ||
| swiftLanguageModes: [ | ||
| .v5, // opt-out from dynamic actor isolation checks | ||
| .v6, | ||
| ] | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ | |
| static let videoSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kLKRTCMediaStreamTrackKindVideo) | ||
| static let audioSenderCapabilities = peerConnectionFactory.rtpSenderCapabilities(forKind: kLKRTCMediaStreamTrackKindAudio) | ||
|
|
||
| static let peerConnectionFactory: LKRTCPeerConnectionFactory = { | ||
|
Check failure on line 86 in Sources/LiveKit/Core/RTC.swift
|
||
| // Update pc init lock | ||
| let (admType, bypassVoiceProcessing) = pcFactoryState.mutate { | ||
| $0.isInitialized = true | ||
|
|
@@ -96,6 +96,9 @@ | |
|
|
||
| Room.log("Initializing PeerConnectionFactory...") | ||
|
|
||
| // Enable DTLS during ICE handshake for faster connection setup. | ||
| LKRTCPeerConnectionFactory.configureFieldTrials("WebRTC-IceHandshakeDtls/Enabled/") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit awkward (static), mostly due to multiple |
||
|
|
||
| return LKRTCPeerConnectionFactory(audioDeviceModuleType: admType.toRTCType(), | ||
| bypassVoiceProcessing: bypassVoiceProcessing, | ||
| encoderFactory: encoderFactory, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,21 +20,25 @@ internal import LiveKitWebRTC | |
| public enum DegradationPreference: Int, Sendable { | ||
| /// The SDK will decide which preference is suitable or will use WebRTC's default implementation. | ||
| case auto | ||
| @available(*, deprecated, renamed: "maintainFramerateAndResolution") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed from the header |
||
| case disabled | ||
| /// Prefer to maintain FPS rather than resolution. | ||
| case maintainFramerate | ||
| /// Prefer to maintain resolution rather than FPS. | ||
| case maintainResolution | ||
| case balanced | ||
| /// Prefer to maintain both FPS and resolution. | ||
| case maintainFramerateAndResolution | ||
| } | ||
|
|
||
| extension DegradationPreference { | ||
| func toRTCType() -> LKRTCDegradationPreference? { | ||
| switch self { | ||
| case .auto: nil | ||
| case .disabled: .disabled | ||
| case .disabled: .maintainFramerateAndResolution | ||
| case .maintainFramerate: .maintainFramerate | ||
| case .maintainResolution: .maintainResolution | ||
| case .maintainFramerateAndResolution: .maintainFramerateAndResolution | ||
| case .balanced: .balanced | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to support visionOS v26, I hope we'll drop Swift 5.9 soon https://developer.apple.com/news/upcoming-requirements/?id=02032026a