Skip to content
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
1 change: 1 addition & 0 deletions .changes/xcframework
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
minor type="fixed" "Breaking change: Library evolution support (xcframework). May break existing `*Track` extensions."
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ jobs:
-scheme LiveKit \
-configuration Release \
-destination 'platform=${{ matrix.platform }}' \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
OTHER_SWIFT_FLAGS="-Xfrontend -emit-symbol-graph\
-Xfrontend -emit-symbol-graph-dir\
-Xfrontend \"${PWD}/symbol-graph\"" \
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class BroadcastScreenCapturer: BufferCapturer, @unchecked Sendable {
public extension LocalVideoTrack {
/// Creates a track that captures screen capture from a broadcast upload extension
static func createBroadcastScreenCapturerTrack(name: String = Track.screenShareVideoName,
source: VideoTrack.Source = .screenShareVideo,
source: Track.Source = .screenShareVideo,
options: ScreenShareCaptureOptions = ScreenShareCaptureOptions(),
reportStatistics: Bool = false) -> LocalVideoTrack
{
Expand Down
1 change: 1 addition & 0 deletions Sources/LiveKit/Core/Room.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import Combine
import Foundation

#if canImport(Network)
Expand Down
1 change: 1 addition & 0 deletions Sources/LiveKit/E2EE/E2EEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import Combine
import Foundation

internal import LiveKitWebRTC
Expand All @@ -39,7 +40,7 @@

// MARK: - Public

public let e2eeOptions: E2EEOptions?

Check warning on line 43 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 43 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 43 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 43 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 43 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).
public let options: EncryptionOptions?

public var keyProvider: BaseKeyProvider {
Expand Down Expand Up @@ -75,7 +76,7 @@
var dataCryptor: LKRTCDataPacketCryptor?
}

public init(e2eeOptions: E2EEOptions) {

Check warning on line 79 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 79 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-14, 15.4, iOS Simulator,name=iPhone 15 Pro,OS=17.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 79 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 79 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).

Check warning on line 79 in Sources/LiveKit/E2EE/E2EEManager.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

'E2EEOptions' is deprecated: Migrate to 'EncryptionOptions' instead. Important: It will enable data channel encryption by default (requires support from all platforms).
self.e2eeOptions = e2eeOptions
options = nil
}
Expand Down
6 changes: 6 additions & 0 deletions Sources/LiveKit/Extensions/Sendable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ extension NSMapTable: @unchecked Swift.Sendable {} // cannot specify Obj-C gener
#if swift(<6.2)
extension Dictionary: Swift.Sendable where Key: Sendable, Value: Sendable {}
#endif

// MARK: AV

extension AVCaptureDevice: @unchecked Swift.Sendable {}
extension AVCaptureDevice.Format: @unchecked Swift.Sendable {}
extension CVPixelBuffer: @unchecked Swift.Sendable {}
1 change: 1 addition & 0 deletions Sources/LiveKit/Participant/Participant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import Combine
import Foundation

internal import LiveKitWebRTC
Expand Down
1 change: 1 addition & 0 deletions Sources/LiveKit/SwiftUI/TrackDelegateObserver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import Combine
import Foundation

/// Helper class to observer ``TrackDelegate`` from Swift UI.
Expand Down
4 changes: 3 additions & 1 deletion Sources/LiveKit/Track/AudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
import Foundation

@objc
public protocol AudioTrack where Self: Track {
public protocol AudioTrackProtocol: AnyObject, Sendable {
@objc(addAudioRenderer:)
func add(audioRenderer: AudioRenderer)

@objc(removeAudioRenderer:)
func remove(audioRenderer: AudioRenderer)
}

public typealias AudioTrack = AudioTrackProtocol & Track
2 changes: 1 addition & 1 deletion Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
internal import LiveKitWebRTC

@available(visionOS 2.0, *)
public class ARCameraCapturer: VideoCapturer {

Check warning on line 24 in Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-15, 16.4, visionOS Simulator,name=Apple Vision Pro,OS=2.5)

class 'ARCameraCapturer' must restate inherited '@unchecked Sendable' conformance

Check warning on line 24 in Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift

View workflow job for this annotation

GitHub Actions / Build & Test (macos-26, latest, visionOS Simulator,name=Apple Vision Pro,OS=26.0)

class 'ARCameraCapturer' must restate inherited '@unchecked Sendable' conformance
private let capturer = RTC.createVideoCapturer()
private let arKitSession = ARKitSession()
private let cameraFrameProvider = CameraFrameProvider()
Expand Down Expand Up @@ -94,7 +94,7 @@
public extension LocalVideoTrack {
/// Creates a track that can directly capture `CVPixelBuffer` or `CMSampleBuffer` for convenience
static func createARCameraTrack(name: String = Track.cameraName,
source: VideoTrack.Source = .camera,
source: Track.Source = .camera,
options: ARCameraCaptureOptions = ARCameraCaptureOptions(),
reportStatistics: Bool = false) -> LocalVideoTrack
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Track/Capturers/BufferCapturer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class BufferCapturer: VideoCapturer, @unchecked Sendable {
public extension LocalVideoTrack {
/// Creates a track that can directly capture `CVPixelBuffer` or `CMSampleBuffer` for convienience
static func createBufferTrack(name: String = Track.screenShareVideoName,
source: VideoTrack.Source = .screenShareVideo,
source: Track.Source = .screenShareVideo,
options: BufferCaptureOptions = BufferCaptureOptions(),
reportStatistics: Bool = false) -> LocalVideoTrack
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Track/Local/LocalAudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Foundation
internal import LiveKitWebRTC

@objc
public class LocalAudioTrack: Track, LocalTrack, AudioTrack, @unchecked Sendable {
public class LocalAudioTrack: Track, LocalTrackProtocol, AudioTrackProtocol, @unchecked Sendable {
/// ``AudioCaptureOptions`` used to create this track.
public let captureOptions: AudioCaptureOptions

Expand Down
6 changes: 4 additions & 2 deletions Sources/LiveKit/Track/Local/LocalTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
import Foundation

@objc
public protocol LocalTrack where Self: Track {
public protocol LocalTrackProtocol: AnyObject, Sendable {
@objc
var publishOptions: TrackPublishOptions? { get }

@objc
var publishState: PublishState { get }
var publishState: Track.PublishState { get }

@objc
func mute() async throws

@objc
func unmute() async throws
}

public typealias LocalTrack = LocalTrackProtocol & Track
4 changes: 2 additions & 2 deletions Sources/LiveKit/Track/Local/LocalVideoTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
internal import LiveKitWebRTC

@objc
public class LocalVideoTrack: Track, LocalTrack, @unchecked Sendable {
public class LocalVideoTrack: Track, LocalTrackProtocol, @unchecked Sendable {
@objc
public internal(set) var capturer: VideoCapturer

Expand Down Expand Up @@ -65,7 +65,7 @@ public class LocalVideoTrack: Track, LocalTrack, @unchecked Sendable {

// MARK: - VideoTrack Protocol

extension LocalVideoTrack: VideoTrack {
extension LocalVideoTrack: VideoTrackProtocol {
public func add(videoRenderer: VideoRenderer) {
capturer.rendererDelegates.add(delegate: videoRenderer)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import CoreMedia
internal import LiveKitWebRTC

@objc
public class RemoteAudioTrack: Track, RemoteTrack, AudioTrack, @unchecked Sendable {
public class RemoteAudioTrack: Track, RemoteTrackProtocol, AudioTrackProtocol, @unchecked Sendable {
/// Volume with range 0.0 - 1.0
public var volume: Double {
get {
Expand Down
4 changes: 3 additions & 1 deletion Sources/LiveKit/Track/Remote/RemoteTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@
import Foundation

@objc
public protocol RemoteTrack where Self: Track {}
public protocol RemoteTrackProtocol: AnyObject, Sendable {}

public typealias RemoteTrack = RemoteTrackProtocol & Track
4 changes: 2 additions & 2 deletions Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
internal import LiveKitWebRTC

@objc
public class RemoteVideoTrack: Track, RemoteTrack, @unchecked Sendable {
public class RemoteVideoTrack: Track, RemoteTrackProtocol, @unchecked Sendable {
init(name: String,
source: Track.Source,
track: LKRTCMediaStreamTrack,
Expand All @@ -33,7 +33,7 @@ public class RemoteVideoTrack: Track, RemoteTrack, @unchecked Sendable {

// MARK: - VideoTrack Protocol

extension RemoteVideoTrack: VideoTrack {
extension RemoteVideoTrack: VideoTrackProtocol {
public func add(videoRenderer: VideoRenderer) {
guard let rtcVideoTrack = mediaTrack as? LKRTCVideoTrack else {
log("mediaTrack is not a RTCVideoTrack", .error)
Expand Down
6 changes: 4 additions & 2 deletions Sources/LiveKit/Track/VideoTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,24 @@ import Foundation
internal import LiveKitWebRTC

@objc
public protocol VideoTrack where Self: Track {
public protocol VideoTrackProtocol: AnyObject, Sendable {
@objc(addVideoRenderer:)
func add(videoRenderer: VideoRenderer)

@objc(removeVideoRenderer:)
func remove(videoRenderer: VideoRenderer)
}

public typealias VideoTrack = Track & VideoTrackProtocol

// Directly add/remove renderers for better performance
protocol VideoTrack_Internal where Self: Track {
func add(rtcVideoRenderer: LKRTCVideoRenderer)

func remove(rtcVideoRenderer: LKRTCVideoRenderer)
}

extension VideoTrack {
extension VideoTrackProtocol where Self: Track {
// Update a single SubscribedCodec
func _set(subscribedCodec: Livekit_SubscribedCodec) throws -> Bool {
guard let videoCodec = VideoCodec.from(name: subscribedCodec.codec) else { return false }
Expand Down
1 change: 1 addition & 0 deletions Sources/LiveKit/TrackPublications/TrackPublication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import Combine
import Foundation

@objc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,3 @@ public final class BackgroundBlurVideoProcessor: NSObject, @unchecked Sendable,
return cachedPixelBuffer
}
}

extension CVPixelBuffer: @unchecked Swift.Sendable {}
Loading