diff --git a/.changes/dc-leak b/.changes/dc-leak new file mode 100644 index 000000000..044e14e5d --- /dev/null +++ b/.changes/dc-leak @@ -0,0 +1 @@ +patch type="fixed" "Memory leaks in data channel cancellation code" \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml index 5569d7e10..d916fc94f 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -15,3 +15,10 @@ type_name: excluded: - ID - OS + +custom_rules: + no_manual_task_management: + name: "No Manual Task Management" + regex: "(let|var)\\s+\\w+\\s*:\\s*Task. This allows for safer cleanup, similar to Combine's AnyCancellable." + severity: warning diff --git a/Sources/LiveKit/Agent/Agent.swift b/Sources/LiveKit/Agent/Agent.swift index f7f6a6c3a..6aeaaa953 100644 --- a/Sources/LiveKit/Agent/Agent.swift +++ b/Sources/LiveKit/Agent/Agent.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Message.swift b/Sources/LiveKit/Agent/Chat/Message.swift index 529728c1c..2a0fb8c96 100644 --- a/Sources/LiveKit/Agent/Chat/Message.swift +++ b/Sources/LiveKit/Agent/Chat/Message.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Receive/MessageReceiver.swift b/Sources/LiveKit/Agent/Chat/Receive/MessageReceiver.swift index 20b7edec4..e3b62c3f5 100644 --- a/Sources/LiveKit/Agent/Chat/Receive/MessageReceiver.swift +++ b/Sources/LiveKit/Agent/Chat/Receive/MessageReceiver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Receive/TranscriptionDelegateReceiver.swift b/Sources/LiveKit/Agent/Chat/Receive/TranscriptionDelegateReceiver.swift index c9b24bb1d..b3c47f5db 100644 --- a/Sources/LiveKit/Agent/Chat/Receive/TranscriptionDelegateReceiver.swift +++ b/Sources/LiveKit/Agent/Chat/Receive/TranscriptionDelegateReceiver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Receive/TranscriptionStreamReceiver.swift b/Sources/LiveKit/Agent/Chat/Receive/TranscriptionStreamReceiver.swift index bec7674cc..7ffbecc4a 100644 --- a/Sources/LiveKit/Agent/Chat/Receive/TranscriptionStreamReceiver.swift +++ b/Sources/LiveKit/Agent/Chat/Receive/TranscriptionStreamReceiver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Send/MessageSender.swift b/Sources/LiveKit/Agent/Chat/Send/MessageSender.swift index a9bdc86fb..ea24201ac 100644 --- a/Sources/LiveKit/Agent/Chat/Send/MessageSender.swift +++ b/Sources/LiveKit/Agent/Chat/Send/MessageSender.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Chat/Send/TextMessageSender.swift b/Sources/LiveKit/Agent/Chat/Send/TextMessageSender.swift index d1c7e6a86..3fd8f673e 100644 --- a/Sources/LiveKit/Agent/Chat/Send/TextMessageSender.swift +++ b/Sources/LiveKit/Agent/Chat/Send/TextMessageSender.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Participant+Agent.swift b/Sources/LiveKit/Agent/Participant+Agent.swift index b222e38d2..776c74f6e 100644 --- a/Sources/LiveKit/Agent/Participant+Agent.swift +++ b/Sources/LiveKit/Agent/Participant+Agent.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Room+Agent.swift b/Sources/LiveKit/Agent/Room+Agent.swift index 23a1dfdda..7ff14a802 100644 --- a/Sources/LiveKit/Agent/Room+Agent.swift +++ b/Sources/LiveKit/Agent/Room+Agent.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Agent/Session.swift b/Sources/LiveKit/Agent/Session.swift index 43d954939..5c8d5c48b 100644 --- a/Sources/LiveKit/Agent/Session.swift +++ b/Sources/LiveKit/Agent/Session.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -110,7 +110,8 @@ open class Session: ObservableObject { // MARK: - Internal state - private var waitForAgentTask: Task? + private var tasks = Set() + private var waitForAgentTask: AnyTaskCancellable? // MARK: - Init @@ -193,17 +194,10 @@ open class Session: ObservableObject { receivers: receivers) } - deinit { - waitForAgentTask?.cancel() - } - private func observe(room: Room) { - Task { [weak self] in - for try await _ in room.changes { - guard let self else { return } - updateAgent(in: room) - } - } + room.changes.subscribeOnMainActor(self) { observer, _ in + observer.updateAgent(in: room) + }.store(in: &tasks) } private func updateAgent(in room: Room) { @@ -221,18 +215,25 @@ open class Session: ObservableObject { } private func observe(receivers: [any MessageReceiver]) { + let (stream, continuation) = AsyncStream.makeStream(of: ReceivedMessage.self) + + // Multiple producers → single stream for receiver in receivers { Task { [weak self] in do { for await message in try await receiver.messages() { - guard let self else { return } - messagesDict.updateValue(message, forKey: message.id) + continuation.yield(message) } } catch { self?.error = .receiver(error) } - } + }.cancellable().store(in: &tasks) } + + // Single consumer + stream.subscribeOnMainActor(self) { observer, message in + observer.messagesDict.updateValue(message, forKey: message.id) + }.store(in: &tasks) } // MARK: - Lifecycle @@ -242,7 +243,7 @@ open class Session: ObservableObject { guard connectionState == .disconnected else { return } error = nil - waitForAgentTask?.cancel() + waitForAgentTask = nil let timeout = options.agentConnectTimeout @@ -278,7 +279,7 @@ open class Session: ObservableObject { if isConnected, !agent.isConnected { agent.failed(error: .timeout) } - } + }.cancellable() } } catch { self.error = .connection(error) diff --git a/Sources/LiveKit/Agent/SessionOptions.swift b/Sources/LiveKit/Agent/SessionOptions.swift index 96bddf01c..fa1e7fe64 100644 --- a/Sources/LiveKit/Agent/SessionOptions.swift +++ b/Sources/LiveKit/Agent/SessionOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift b/Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift index 3c431c46e..b1ce7fec7 100644 --- a/Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift +++ b/Sources/LiveKit/Audio/AudioDeviceModuleDelegateAdapter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/AudioEngineObserver.swift b/Sources/LiveKit/Audio/AudioEngineObserver.swift index 1f82a07ee..d9ec721b0 100644 --- a/Sources/LiveKit/Audio/AudioEngineObserver.swift +++ b/Sources/LiveKit/Audio/AudioEngineObserver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/AudioSessionEngineObserver.swift b/Sources/LiveKit/Audio/AudioSessionEngineObserver.swift index a01ecab59..873f4d33a 100644 --- a/Sources/LiveKit/Audio/AudioSessionEngineObserver.swift +++ b/Sources/LiveKit/Audio/AudioSessionEngineObserver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift b/Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift index a2284fc14..e3e3afce5 100644 --- a/Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift +++ b/Sources/LiveKit/Audio/Manager/AudioManager+ModuleType.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/Manager/AudioManager+MuteMode.swift b/Sources/LiveKit/Audio/Manager/AudioManager+MuteMode.swift index e4210d8cf..46baf3767 100644 --- a/Sources/LiveKit/Audio/Manager/AudioManager+MuteMode.swift +++ b/Sources/LiveKit/Audio/Manager/AudioManager+MuteMode.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/Manager/AudioManager+Testing.swift b/Sources/LiveKit/Audio/Manager/AudioManager+Testing.swift index 04b96123c..46a02f4b9 100644 --- a/Sources/LiveKit/Audio/Manager/AudioManager+Testing.swift +++ b/Sources/LiveKit/Audio/Manager/AudioManager+Testing.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/Manager/AudioManager.swift b/Sources/LiveKit/Audio/Manager/AudioManager.swift index ead30da89..98a63c934 100644 --- a/Sources/LiveKit/Audio/Manager/AudioManager.swift +++ b/Sources/LiveKit/Audio/Manager/AudioManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Audio/MixerEngineObserver.swift b/Sources/LiveKit/Audio/MixerEngineObserver.swift index 7ae8d8f66..64ecb49ee 100644 --- a/Sources/LiveKit/Audio/MixerEngineObserver.swift +++ b/Sources/LiveKit/Audio/MixerEngineObserver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/BroadcastBundleInfo.swift b/Sources/LiveKit/Broadcast/BroadcastBundleInfo.swift index fb9108b54..6c7160088 100644 --- a/Sources/LiveKit/Broadcast/BroadcastBundleInfo.swift +++ b/Sources/LiveKit/Broadcast/BroadcastBundleInfo.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/BroadcastManager.swift b/Sources/LiveKit/Broadcast/BroadcastManager.swift index d64ea0945..6801bf092 100644 --- a/Sources/LiveKit/Broadcast/BroadcastManager.swift +++ b/Sources/LiveKit/Broadcast/BroadcastManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift b/Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift index ca61de5ed..08e8864f3 100644 --- a/Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift +++ b/Sources/LiveKit/Broadcast/BroadcastScreenCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/BroadcastAudioCodec.swift b/Sources/LiveKit/Broadcast/IPC/BroadcastAudioCodec.swift index cfe59c70d..8c596c8f1 100644 --- a/Sources/LiveKit/Broadcast/IPC/BroadcastAudioCodec.swift +++ b/Sources/LiveKit/Broadcast/IPC/BroadcastAudioCodec.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/BroadcastIPCHeader.swift b/Sources/LiveKit/Broadcast/IPC/BroadcastIPCHeader.swift index 607c708ce..8900d335a 100644 --- a/Sources/LiveKit/Broadcast/IPC/BroadcastIPCHeader.swift +++ b/Sources/LiveKit/Broadcast/IPC/BroadcastIPCHeader.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/BroadcastImageCodec.swift b/Sources/LiveKit/Broadcast/IPC/BroadcastImageCodec.swift index f3d001b6b..6241c3c10 100644 --- a/Sources/LiveKit/Broadcast/IPC/BroadcastImageCodec.swift +++ b/Sources/LiveKit/Broadcast/IPC/BroadcastImageCodec.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/BroadcastReceiver.swift b/Sources/LiveKit/Broadcast/IPC/BroadcastReceiver.swift index 4aecc3d41..8cdf0d7fb 100644 --- a/Sources/LiveKit/Broadcast/IPC/BroadcastReceiver.swift +++ b/Sources/LiveKit/Broadcast/IPC/BroadcastReceiver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/BroadcastUploader.swift b/Sources/LiveKit/Broadcast/IPC/BroadcastUploader.swift index ee7cd8ec3..cad020b36 100644 --- a/Sources/LiveKit/Broadcast/IPC/BroadcastUploader.swift +++ b/Sources/LiveKit/Broadcast/IPC/BroadcastUploader.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ final class BroadcastUploader: Sendable, Loggable { private struct State { var isUploadingImage = false var shouldUploadAudio = false + var messageLoopTask: AnyTaskCancellable? } private let state = StateSync(State()) @@ -40,8 +41,19 @@ final class BroadcastUploader: Sendable, Loggable { /// Creates an uploader with an open connection to another process. init(socketPath: SocketPath) async throws { - channel = try await IPCChannel(connectingTo: socketPath) - Task { try await handleIncomingMessages() } + let channel = try await IPCChannel(connectingTo: socketPath) + self.channel = channel + + let messageLoopTask = channel.incomingMessages(BroadcastIPCHeader.self).subscribe(self) { observer, message in + observer.processMessageHeader(message.0) + } onFailure: { observer, error in + observer.log("IPCChannel returned error: \(error)") + } + state.mutate { $0.messageLoopTask = messageLoopTask } + } + + deinit { + close() } /// Whether or not the connection to the receiver has been closed. @@ -92,15 +104,12 @@ final class BroadcastUploader: Sendable, Loggable { } } - private func handleIncomingMessages() async throws { - for try await (header, _) in channel.incomingMessages(BroadcastIPCHeader.self) { - switch header { - case let .wantsAudio(wantsAudio): - state.mutate { $0.shouldUploadAudio = wantsAudio } - default: - log("Unhandled incoming message: \(header)", .debug) - continue - } + private func processMessageHeader(_ header: BroadcastIPCHeader) { + switch header { + case let .wantsAudio(wantsAudio): + state.mutate { $0.shouldUploadAudio = wantsAudio } + default: + log("Unhandled incoming message: \(header)", .debug) } } } diff --git a/Sources/LiveKit/Broadcast/IPC/IPCChannel.swift b/Sources/LiveKit/Broadcast/IPC/IPCChannel.swift index 72b698504..db2af7d34 100644 --- a/Sources/LiveKit/Broadcast/IPC/IPCChannel.swift +++ b/Sources/LiveKit/Broadcast/IPC/IPCChannel.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/IPCProtocol.swift b/Sources/LiveKit/Broadcast/IPC/IPCProtocol.swift index 1586be5a6..c23cc24c0 100644 --- a/Sources/LiveKit/Broadcast/IPC/IPCProtocol.swift +++ b/Sources/LiveKit/Broadcast/IPC/IPCProtocol.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/IPC/SocketPath.swift b/Sources/LiveKit/Broadcast/IPC/SocketPath.swift index 936702949..5e19f28d9 100644 --- a/Sources/LiveKit/Broadcast/IPC/SocketPath.swift +++ b/Sources/LiveKit/Broadcast/IPC/SocketPath.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/LKSampleHandler.swift b/Sources/LiveKit/Broadcast/LKSampleHandler.swift index 31910a668..74671873f 100644 --- a/Sources/LiveKit/Broadcast/LKSampleHandler.swift +++ b/Sources/LiveKit/Broadcast/LKSampleHandler.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Broadcast/Support/DarwinNotificationCenter.swift b/Sources/LiveKit/Broadcast/Support/DarwinNotificationCenter.swift index b856a6141..afab1188d 100644 --- a/Sources/LiveKit/Broadcast/Support/DarwinNotificationCenter.swift +++ b/Sources/LiveKit/Broadcast/Support/DarwinNotificationCenter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Convenience/AudioProcessing.swift b/Sources/LiveKit/Convenience/AudioProcessing.swift index 166af2928..68c95f3b7 100644 --- a/Sources/LiveKit/Convenience/AudioProcessing.swift +++ b/Sources/LiveKit/Convenience/AudioProcessing.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/DataChannelPair.swift b/Sources/LiveKit/Core/DataChannelPair.swift index d335bfde7..4e78c1dc4 100644 --- a/Sources/LiveKit/Core/DataChannelPair.swift +++ b/Sources/LiveKit/Core/DataChannelPair.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,12 +52,19 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { guard let lossy, let reliable else { return false } return reliable.readyState == .open && lossy.readyState == .open } + } - var eventContinuation: AsyncStream.Continuation? + private struct Buffers: Sendable { + var lossyBuffer = SendBuffer() + var reliableBuffer = SendBuffer() + var reliableRetryBuffer = RetryBuffer(minAmount: DataChannelPair.reliableRetryAmount) } private let _state: StateSync + private let eventContinuation: AsyncStream.Continuation + private var eventLoopTask: AnyTaskCancellable? + fileprivate enum ChannelKind { case lossy, reliable } @@ -137,56 +144,47 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { // MARK: - Event handling // swiftlint:disable:next cyclomatic_complexity - private func handleEvents( - events: AsyncStream - ) async { - var lossyBuffer = SendBuffer() - var reliableBuffer = SendBuffer() - - var reliableRetryBuffer = RetryBuffer(minAmount: Self.reliableRetryAmount) - - for await event in events { - switch event.detail { - case let .publishData(request): - switch event.channelKind { - case .lossy: lossyBuffer.enqueue(request) - case .reliable: reliableBuffer.enqueue(request) - } - case let .publishedData(request): - switch event.channelKind { - case .lossy: () - case .reliable: reliableRetryBuffer.enqueue(request) - } - case let .bufferedAmountChanged(amount): - switch event.channelKind { - case .lossy: - updateTarget(buffer: &lossyBuffer, newAmount: amount) - case .reliable: - updateTarget(buffer: &reliableBuffer, newAmount: amount) - reliableRetryBuffer.trim(toAmount: amount) - } - case let .retryRequested(lastSeq): - switch event.channelKind { - case .lossy: () - case .reliable: retry(buffer: &reliableRetryBuffer, from: lastSeq) - } + private func processEvent(_ event: ChannelEvent, buffers: inout Buffers) { + switch event.detail { + case let .publishData(request): + switch event.channelKind { + case .lossy: buffers.lossyBuffer.enqueue(request) + case .reliable: buffers.reliableBuffer.enqueue(request) } - + case let .publishedData(request): + switch event.channelKind { + case .lossy: () + case .reliable: buffers.reliableRetryBuffer.enqueue(request) + } + case let .bufferedAmountChanged(amount): switch event.channelKind { case .lossy: - processSendQueue( - threshold: Self.lossyLowThreshold, - buffer: &lossyBuffer, - kind: .lossy - ) + updateTarget(buffer: &buffers.lossyBuffer, newAmount: amount) case .reliable: - processSendQueue( - threshold: Self.reliableLowThreshold, - buffer: &reliableBuffer, - kind: .reliable - ) + updateTarget(buffer: &buffers.reliableBuffer, newAmount: amount) + buffers.reliableRetryBuffer.trim(toAmount: amount) + } + case let .retryRequested(lastSeq): + switch event.channelKind { + case .lossy: () + case .reliable: retry(buffer: &buffers.reliableRetryBuffer, from: lastSeq) } } + + switch event.channelKind { + case .lossy: + processSendQueue( + threshold: Self.lossyLowThreshold, + buffer: &buffers.lossyBuffer, + kind: .lossy + ) + case .reliable: + processSendQueue( + threshold: Self.reliableLowThreshold, + buffer: &buffers.reliableBuffer, + kind: .reliable + ) + } } private func channel(for kind: ChannelKind) -> LKRTCDataChannel? { @@ -219,7 +217,7 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { request.continuation?.resume() let event = ChannelEvent(channelKind: kind, detail: .publishedData(request)) - _state.eventContinuation?.yield(event) + eventContinuation.yield(event) } } @@ -248,7 +246,7 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { assert(request.continuation == nil, "Continuation may fire multiple times while retrying causing crash") if request.sequence > lastSeq { let event = ChannelEvent(channelKind: .reliable, detail: .publishData(request)) - _state.eventContinuation?.yield(event) + eventContinuation.yield(event) } } } @@ -265,13 +263,14 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { if let delegate { delegates.add(delegate: delegate) } + + let (eventStream, continuation) = AsyncStream.makeStream(of: ChannelEvent.self) + eventContinuation = continuation + super.init() - Task { - let eventStream = AsyncStream { continuation in - _state.mutate { $0.eventContinuation = continuation } - } - await handleEvents(events: eventStream) + eventLoopTask = eventStream.subscribe(self, state: Buffers()) { observer, event, buffers in + observer.processEvent(event, buffers: &buffers) } } @@ -341,7 +340,7 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { channelKind: ChannelKind(packet.kind), // TODO: field is deprecated detail: .publishData(request) ) - _state.eventContinuation?.yield(event) + eventContinuation.yield(event) } } @@ -371,7 +370,7 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { func retryReliable(lastSequence: UInt32) { let event = ChannelEvent(channelKind: .reliable, detail: .retryRequested(lastSequence)) - _state.eventContinuation?.yield(event) + eventContinuation.yield(event) } // MARK: - Sync state @@ -402,7 +401,7 @@ class DataChannelPair: NSObject, @unchecked Sendable, Loggable { private static let reliableReceivedStateTTL: TimeInterval = 30 deinit { - _state.eventContinuation?.finish() + eventContinuation.finish() } } @@ -414,7 +413,7 @@ extension DataChannelPair: LKRTCDataChannelDelegate { channelKind: dataChannel.kind, detail: .bufferedAmountChanged(amount) ) - _state.eventContinuation?.yield(event) + eventContinuation.yield(event) } func dataChannelDidChangeState(_: LKRTCDataChannel) { diff --git a/Sources/LiveKit/Core/PreConnectAudioBuffer.swift b/Sources/LiveKit/Core/PreConnectAudioBuffer.swift index 7eebd7b9f..44ff6a13d 100644 --- a/Sources/LiveKit/Core/PreConnectAudioBuffer.swift +++ b/Sources/LiveKit/Core/PreConnectAudioBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ public final class PreConnectAudioBuffer: NSObject, Sendable, Loggable { weak var room: Room? var recorder: LocalAudioTrackRecorder? var audioStream: LocalAudioTrackRecorder.Stream? - var timeoutTask: Task? + var timeoutTask: AnyTaskCancellable? var sent: Bool = false var onError: OnError? } @@ -94,7 +94,6 @@ public final class PreConnectAudioBuffer: NSObject, Sendable, Loggable { let stream = try await newRecorder.start() log("Started capturing audio", .info) - state.timeoutTask?.cancel() state.mutate { state in state.recorder = newRecorder state.audioStream = stream @@ -102,7 +101,7 @@ public final class PreConnectAudioBuffer: NSObject, Sendable, Loggable { try await Task.sleep(nanoseconds: UInt64(timeout) * NSEC_PER_SEC) try Task.checkCancellation() self?.stopRecording(flush: true) - } + }.cancellable() state.sent = false } } diff --git a/Sources/LiveKit/Core/RPC.swift b/Sources/LiveKit/Core/RPC.swift index fc38ebee1..40bed62f7 100644 --- a/Sources/LiveKit/Core/RPC.swift +++ b/Sources/LiveKit/Core/RPC.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/RTC.swift b/Sources/LiveKit/Core/RTC.swift index 95cd19be4..8efc78f40 100644 --- a/Sources/LiveKit/Core/RTC.swift +++ b/Sources/LiveKit/Core/RTC.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+Convenience.swift b/Sources/LiveKit/Core/Room+Convenience.swift index fa84c043b..5f9846eef 100644 --- a/Sources/LiveKit/Core/Room+Convenience.swift +++ b/Sources/LiveKit/Core/Room+Convenience.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+DataStream.swift b/Sources/LiveKit/Core/Room+DataStream.swift index d5dd62fc5..bfa9f51c7 100644 --- a/Sources/LiveKit/Core/Room+DataStream.swift +++ b/Sources/LiveKit/Core/Room+DataStream.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+Debug.swift b/Sources/LiveKit/Core/Room+Debug.swift index fefdf71ca..1737e38e2 100644 --- a/Sources/LiveKit/Core/Room+Debug.swift +++ b/Sources/LiveKit/Core/Room+Debug.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+Engine.swift b/Sources/LiveKit/Core/Room+Engine.swift index eec036cee..cab977f96 100644 --- a/Sources/LiveKit/Core/Room+Engine.swift +++ b/Sources/LiveKit/Core/Room+Engine.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -410,7 +410,7 @@ extension Room { } _state.mutate { - $0.reconnectTask = reconnectTask + $0.reconnectTask = reconnectTask.cancellable() } try await reconnectTask.value diff --git a/Sources/LiveKit/Core/Room+EngineDelegate.swift b/Sources/LiveKit/Core/Room+EngineDelegate.swift index 2e5da1487..dd1fcdc85 100644 --- a/Sources/LiveKit/Core/Room+EngineDelegate.swift +++ b/Sources/LiveKit/Core/Room+EngineDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+MulticastDelegate.swift b/Sources/LiveKit/Core/Room+MulticastDelegate.swift index 3899e6d4d..7e64e0fe0 100644 --- a/Sources/LiveKit/Core/Room+MulticastDelegate.swift +++ b/Sources/LiveKit/Core/Room+MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+PreConnect.swift b/Sources/LiveKit/Core/Room+PreConnect.swift index b836f678d..5af50afcf 100644 --- a/Sources/LiveKit/Core/Room+PreConnect.swift +++ b/Sources/LiveKit/Core/Room+PreConnect.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+RPC.swift b/Sources/LiveKit/Core/Room+RPC.swift index f986e96b0..e2a8bf802 100644 --- a/Sources/LiveKit/Core/Room+RPC.swift +++ b/Sources/LiveKit/Core/Room+RPC.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+SignalClientDelegate.swift b/Sources/LiveKit/Core/Room+SignalClientDelegate.swift index 3298e72c4..166888293 100644 --- a/Sources/LiveKit/Core/Room+SignalClientDelegate.swift +++ b/Sources/LiveKit/Core/Room+SignalClientDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room+TransportDelegate.swift b/Sources/LiveKit/Core/Room+TransportDelegate.swift index 9df9e9b70..66cde4098 100644 --- a/Sources/LiveKit/Core/Room+TransportDelegate.swift +++ b/Sources/LiveKit/Core/Room+TransportDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Core/Room.swift b/Sources/LiveKit/Core/Room.swift index 9bf663cfa..a27571ccd 100644 --- a/Sources/LiveKit/Core/Room.swift +++ b/Sources/LiveKit/Core/Room.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,7 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable { // MARK: - Metrics - private lazy var metricsManager = MetricsManager() + lazy var metricsManager = MetricsManager() // MARK: - Public @@ -173,7 +173,7 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable { var nextReconnectMode: ReconnectMode? var isReconnectingWithMode: ReconnectMode? var connectionState: ConnectionState = .disconnected - var reconnectTask: Task? + var reconnectTask: AnyTaskCancellable? var disconnectError: LiveKitError? var connectStopwatch = Stopwatch(label: "connect") var hasPublished: Bool = false @@ -454,8 +454,6 @@ public class Room: NSObject, @unchecked Sendable, ObservableObject, Loggable { private func cancelReconnect() { _state.mutate { - log("Cancelling reconnect task: \(String(describing: $0.reconnectTask))") - $0.reconnectTask?.cancel() $0.reconnectTask = nil } } diff --git a/Sources/LiveKit/Core/SignalClient.swift b/Sources/LiveKit/Core/SignalClient.swift index 26013a3b8..939eb8cc2 100644 --- a/Sources/LiveKit/Core/SignalClient.swift +++ b/Sources/LiveKit/Core/SignalClient.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@ actor SignalClient: Loggable { var connectionState: ConnectionState = .disconnected var disconnectError: LiveKitError? var socket: WebSocket? - var messageLoopTask: Task? + var messageLoopTask: AnyTaskCancellable? var lastJoinResponse: Livekit_JoinResponse? var rtt: Int64 = 0 } @@ -142,17 +142,12 @@ actor SignalClient: Loggable { token: token, connectOptions: connectOptions) - let task = Task.detached { - self.log("Did enter WebSocket message loop...") - do { - for try await message in socket { - await self._onWebSocketMessage(message: message) - } - } catch { - await self.cleanUp(withError: error) - } + let messageLoopTask = socket.subscribe(self) { observer, message in + await observer.onWebSocketMessage(message) + } onFailure: { observer, error in + await observer.cleanUp(withError: error) } - _state.mutate { $0.messageLoopTask = task } + _state.mutate { $0.messageLoopTask = messageLoopTask } let connectResponse = try await _connectResponseCompleter.wait() // Check cancellation after received join response @@ -210,6 +205,8 @@ actor SignalClient: Loggable { } func cleanUp(withError disconnectError: Error? = nil) async { + if Task.isCancelled { return } + log("withError: \(String(describing: disconnectError))") // Cancel ping/pong timers immediately to prevent stale timers from affecting future connections @@ -217,7 +214,6 @@ actor SignalClient: Loggable { _pingTimeoutTimer.cancel() _state.mutate { - $0.messageLoopTask?.cancel() $0.messageLoopTask = nil $0.socket?.close() $0.socket = nil @@ -250,7 +246,7 @@ private extension SignalClient { await _requestQueue.processIfResumed(request, elseEnqueue: request.canBeQueued()) } - func _onWebSocketMessage(message: URLSessionWebSocketTask.Message) async { + func onWebSocketMessage(_ message: URLSessionWebSocketTask.Message) async { let response: Livekit_SignalResponse? = switch message { case let .data(data): try? Livekit_SignalResponse(serializedBytes: data) case let .string(string): try? Livekit_SignalResponse(jsonString: string) diff --git a/Sources/LiveKit/Core/Transport.swift b/Sources/LiveKit/Core/Transport.swift index 0b97d301a..62a717e23 100644 --- a/Sources/LiveKit/Core/Transport.swift +++ b/Sources/LiveKit/Core/Transport.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/FileInfo.swift b/Sources/LiveKit/DataStream/FileInfo.swift index 62092aae8..d6b414fe7 100644 --- a/Sources/LiveKit/DataStream/FileInfo.swift +++ b/Sources/LiveKit/DataStream/FileInfo.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Incoming/ByteStreamReader.swift b/Sources/LiveKit/DataStream/Incoming/ByteStreamReader.swift index 7902e5b18..27db750c1 100644 --- a/Sources/LiveKit/DataStream/Incoming/ByteStreamReader.swift +++ b/Sources/LiveKit/DataStream/Incoming/ByteStreamReader.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Incoming/IncomingStreamManager.swift b/Sources/LiveKit/DataStream/Incoming/IncomingStreamManager.swift index 8699fbec9..2bb68a620 100644 --- a/Sources/LiveKit/DataStream/Incoming/IncomingStreamManager.swift +++ b/Sources/LiveKit/DataStream/Incoming/IncomingStreamManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ actor IncomingStreamManager: Loggable { let info: StreamInfo let openTime: TimeInterval let continuation: StreamReaderSource.Continuation + var task: AnyTaskCancellable? var readLength = 0 } @@ -42,16 +43,20 @@ actor IncomingStreamManager: Loggable { } private let eventContinuation: AsyncStream.Continuation + private var eventLoopTask: AnyTaskCancellable? init() { let (stream, continuation) = AsyncStream.makeStream(of: StreamEvent.self) eventContinuation = continuation - Task { [weak self] in - for await event in stream { - guard let self else { break } - await process(event) - } + Task { + await observe(events: stream) + } + } + + private func observe(events stream: AsyncStream) { + eventLoopTask = stream.subscribe(self) { observer, event in + await observer.process(event) } } @@ -131,13 +136,13 @@ actor IncomingStreamManager: Loggable { let descriptor = Descriptor( info: info, openTime: Date.timeIntervalSinceReferenceDate, - continuation: continuation + continuation: continuation, + task: Task { + try await handler(source, identity) + }.cancellable() ) - openStreams[info.id] = descriptor - Task.detached { - try await handler(source, identity) - } + openStreams[info.id] = descriptor } /// Close the stream with the given id. diff --git a/Sources/LiveKit/DataStream/Incoming/StreamReaderSource.swift b/Sources/LiveKit/DataStream/Incoming/StreamReaderSource.swift index 8e76353ad..24b2ee660 100644 --- a/Sources/LiveKit/DataStream/Incoming/StreamReaderSource.swift +++ b/Sources/LiveKit/DataStream/Incoming/StreamReaderSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Incoming/TextStreamReader.swift b/Sources/LiveKit/DataStream/Incoming/TextStreamReader.swift index 91b648b4d..ff1f28927 100644 --- a/Sources/LiveKit/DataStream/Incoming/TextStreamReader.swift +++ b/Sources/LiveKit/DataStream/Incoming/TextStreamReader.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Outgoing/ByteStreamWriter.swift b/Sources/LiveKit/DataStream/Outgoing/ByteStreamWriter.swift index 0079710a1..18be0a5dc 100644 --- a/Sources/LiveKit/DataStream/Outgoing/ByteStreamWriter.swift +++ b/Sources/LiveKit/DataStream/Outgoing/ByteStreamWriter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Outgoing/OutgoingStreamManager.swift b/Sources/LiveKit/DataStream/Outgoing/OutgoingStreamManager.swift index 4798c08cc..15545ee03 100644 --- a/Sources/LiveKit/DataStream/Outgoing/OutgoingStreamManager.swift +++ b/Sources/LiveKit/DataStream/Outgoing/OutgoingStreamManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Outgoing/StreamData.swift b/Sources/LiveKit/DataStream/Outgoing/StreamData.swift index bb58f3205..8bf69e3e7 100644 --- a/Sources/LiveKit/DataStream/Outgoing/StreamData.swift +++ b/Sources/LiveKit/DataStream/Outgoing/StreamData.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Outgoing/StreamWriterDestination.swift b/Sources/LiveKit/DataStream/Outgoing/StreamWriterDestination.swift index 04a6f682a..d95192d64 100644 --- a/Sources/LiveKit/DataStream/Outgoing/StreamWriterDestination.swift +++ b/Sources/LiveKit/DataStream/Outgoing/StreamWriterDestination.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/Outgoing/TextStreamWriter.swift b/Sources/LiveKit/DataStream/Outgoing/TextStreamWriter.swift index 474ed7191..e295aa520 100644 --- a/Sources/LiveKit/DataStream/Outgoing/TextStreamWriter.swift +++ b/Sources/LiveKit/DataStream/Outgoing/TextStreamWriter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/StreamError.swift b/Sources/LiveKit/DataStream/StreamError.swift index 74e78ef31..64b10fdc3 100644 --- a/Sources/LiveKit/DataStream/StreamError.swift +++ b/Sources/LiveKit/DataStream/StreamError.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/StreamInfo.swift b/Sources/LiveKit/DataStream/StreamInfo.swift index 2f23ced0a..6260d5473 100644 --- a/Sources/LiveKit/DataStream/StreamInfo.swift +++ b/Sources/LiveKit/DataStream/StreamInfo.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/DataStream/StreamOptions.swift b/Sources/LiveKit/DataStream/StreamOptions.swift index 09f87deb5..bf1239dab 100644 --- a/Sources/LiveKit/DataStream/StreamOptions.swift +++ b/Sources/LiveKit/DataStream/StreamOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/E2EE/E2EEManager.swift b/Sources/LiveKit/E2EE/E2EEManager.swift index 9e22315fd..75d7e8173 100644 --- a/Sources/LiveKit/E2EE/E2EEManager.swift +++ b/Sources/LiveKit/E2EE/E2EEManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/E2EE/KeyProvider.swift b/Sources/LiveKit/E2EE/KeyProvider.swift index a321e438d..3dd5923d1 100644 --- a/Sources/LiveKit/E2EE/KeyProvider.swift +++ b/Sources/LiveKit/E2EE/KeyProvider.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/E2EE/Options.swift b/Sources/LiveKit/E2EE/Options.swift index 710c46a1d..a5881c6ff 100644 --- a/Sources/LiveKit/E2EE/Options.swift +++ b/Sources/LiveKit/E2EE/Options.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/E2EE/Protos+E2EE.swift b/Sources/LiveKit/E2EE/Protos+E2EE.swift index e8fd852fc..41cc7fe22 100644 --- a/Sources/LiveKit/E2EE/Protos+E2EE.swift +++ b/Sources/LiveKit/E2EE/Protos+E2EE.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/E2EE/State.swift b/Sources/LiveKit/E2EE/State.swift index 6c333ccbd..b3877c824 100644 --- a/Sources/LiveKit/E2EE/State.swift +++ b/Sources/LiveKit/E2EE/State.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Errors.swift b/Sources/LiveKit/Errors.swift index 947c789b5..e06710eed 100644 --- a/Sources/LiveKit/Errors.swift +++ b/Sources/LiveKit/Errors.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/AVAudioPCMBuffer.swift b/Sources/LiveKit/Extensions/AVAudioPCMBuffer.swift index c52f0ce27..e61bc5e01 100644 --- a/Sources/LiveKit/Extensions/AVAudioPCMBuffer.swift +++ b/Sources/LiveKit/Extensions/AVAudioPCMBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/AVCaptureDevice.swift b/Sources/LiveKit/Extensions/AVCaptureDevice.swift index 75f5ca7f8..107fedfe0 100644 --- a/Sources/LiveKit/Extensions/AVCaptureDevice.swift +++ b/Sources/LiveKit/Extensions/AVCaptureDevice.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/AsyncSequence.swift b/Sources/LiveKit/Extensions/AsyncSequence.swift index b467cc073..9939bea5f 100644 --- a/Sources/LiveKit/Extensions/AsyncSequence.swift +++ b/Sources/LiveKit/Extensions/AsyncSequence.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/CGFloat.swift b/Sources/LiveKit/Extensions/CGFloat.swift index b421e7063..696ed79dc 100644 --- a/Sources/LiveKit/Extensions/CGFloat.swift +++ b/Sources/LiveKit/Extensions/CGFloat.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/Codable.swift b/Sources/LiveKit/Extensions/Codable.swift index 92c01ed64..8355ab03d 100644 --- a/Sources/LiveKit/Extensions/Codable.swift +++ b/Sources/LiveKit/Extensions/Codable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/CoreImage.swift b/Sources/LiveKit/Extensions/CoreImage.swift index b93430054..cf5df9d39 100644 --- a/Sources/LiveKit/Extensions/CoreImage.swift +++ b/Sources/LiveKit/Extensions/CoreImage.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/CustomStringConvertible.swift b/Sources/LiveKit/Extensions/CustomStringConvertible.swift index ab4c24ead..271619b2a 100644 --- a/Sources/LiveKit/Extensions/CustomStringConvertible.swift +++ b/Sources/LiveKit/Extensions/CustomStringConvertible.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/DispatchQueue.swift b/Sources/LiveKit/Extensions/DispatchQueue.swift index be01497d1..f8af264f8 100644 --- a/Sources/LiveKit/Extensions/DispatchQueue.swift +++ b/Sources/LiveKit/Extensions/DispatchQueue.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/LKRTCRtpSender.swift b/Sources/LiveKit/Extensions/LKRTCRtpSender.swift index 8d4fa7cb7..e100c608e 100644 --- a/Sources/LiveKit/Extensions/LKRTCRtpSender.swift +++ b/Sources/LiveKit/Extensions/LKRTCRtpSender.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/PixelBuffer.swift b/Sources/LiveKit/Extensions/PixelBuffer.swift index 30bb87f69..761bc78bc 100644 --- a/Sources/LiveKit/Extensions/PixelBuffer.swift +++ b/Sources/LiveKit/Extensions/PixelBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/Primitives.swift b/Sources/LiveKit/Extensions/Primitives.swift index c695349a5..f6113f41d 100644 --- a/Sources/LiveKit/Extensions/Primitives.swift +++ b/Sources/LiveKit/Extensions/Primitives.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCConfiguration.swift b/Sources/LiveKit/Extensions/RTCConfiguration.swift index b10738037..30c76814a 100644 --- a/Sources/LiveKit/Extensions/RTCConfiguration.swift +++ b/Sources/LiveKit/Extensions/RTCConfiguration.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCDataChannel+Util.swift b/Sources/LiveKit/Extensions/RTCDataChannel+Util.swift index 8c0ab8ba1..bc98e1fda 100644 --- a/Sources/LiveKit/Extensions/RTCDataChannel+Util.swift +++ b/Sources/LiveKit/Extensions/RTCDataChannel+Util.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCI420Buffer.swift b/Sources/LiveKit/Extensions/RTCI420Buffer.swift index 77fac3a2d..f0a6fb40a 100644 --- a/Sources/LiveKit/Extensions/RTCI420Buffer.swift +++ b/Sources/LiveKit/Extensions/RTCI420Buffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCMediaConstraints.swift b/Sources/LiveKit/Extensions/RTCMediaConstraints.swift index 408eda72c..18396bcc0 100644 --- a/Sources/LiveKit/Extensions/RTCMediaConstraints.swift +++ b/Sources/LiveKit/Extensions/RTCMediaConstraints.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCRtpTransceiver.swift b/Sources/LiveKit/Extensions/RTCRtpTransceiver.swift index 141042051..02c2ea37d 100644 --- a/Sources/LiveKit/Extensions/RTCRtpTransceiver.swift +++ b/Sources/LiveKit/Extensions/RTCRtpTransceiver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/RTCVideoCapturerDelegate+Buffer.swift b/Sources/LiveKit/Extensions/RTCVideoCapturerDelegate+Buffer.swift index cb38a2578..a64651a2d 100644 --- a/Sources/LiveKit/Extensions/RTCVideoCapturerDelegate+Buffer.swift +++ b/Sources/LiveKit/Extensions/RTCVideoCapturerDelegate+Buffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/Sendable.swift b/Sources/LiveKit/Extensions/Sendable.swift index 7cd1187dd..7cc50b616 100644 --- a/Sources/LiveKit/Extensions/Sendable.swift +++ b/Sources/LiveKit/Extensions/Sendable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/String.swift b/Sources/LiveKit/Extensions/String.swift index 8fe3927a6..0ea84835a 100644 --- a/Sources/LiveKit/Extensions/String.swift +++ b/Sources/LiveKit/Extensions/String.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/TimeInterval.swift b/Sources/LiveKit/Extensions/TimeInterval.swift index 4a965affa..c0ade1b6f 100644 --- a/Sources/LiveKit/Extensions/TimeInterval.swift +++ b/Sources/LiveKit/Extensions/TimeInterval.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Extensions/URL.swift b/Sources/LiveKit/Extensions/URL.swift index 95ea6b5f9..1b4854494 100644 --- a/Sources/LiveKit/Extensions/URL.swift +++ b/Sources/LiveKit/Extensions/URL.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/LiveKit+DeviceHelpers.swift b/Sources/LiveKit/LiveKit+DeviceHelpers.swift index 64ddf0883..12bfe1d69 100644 --- a/Sources/LiveKit/LiveKit+DeviceHelpers.swift +++ b/Sources/LiveKit/LiveKit+DeviceHelpers.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/LiveKit.swift b/Sources/LiveKit/LiveKit.swift index 1c1279ec1..dcacde98d 100644 --- a/Sources/LiveKit/LiveKit.swift +++ b/Sources/LiveKit/LiveKit.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/LocalParticipant+DataStream.swift b/Sources/LiveKit/Participant/LocalParticipant+DataStream.swift index 5a8f0a44a..703f4f51d 100644 --- a/Sources/LiveKit/Participant/LocalParticipant+DataStream.swift +++ b/Sources/LiveKit/Participant/LocalParticipant+DataStream.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/LocalParticipant+RPC.swift b/Sources/LiveKit/Participant/LocalParticipant+RPC.swift index b45cef27b..104fea1fd 100644 --- a/Sources/LiveKit/Participant/LocalParticipant+RPC.swift +++ b/Sources/LiveKit/Participant/LocalParticipant+RPC.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/LocalParticipant.swift b/Sources/LiveKit/Participant/LocalParticipant.swift index 8159bd9d5..cdf765672 100644 --- a/Sources/LiveKit/Participant/LocalParticipant.swift +++ b/Sources/LiveKit/Participant/LocalParticipant.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant+Convenience.swift b/Sources/LiveKit/Participant/Participant+Convenience.swift index b3399346d..a3b98340d 100644 --- a/Sources/LiveKit/Participant/Participant+Convenience.swift +++ b/Sources/LiveKit/Participant/Participant+Convenience.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant+Equatable.swift b/Sources/LiveKit/Participant/Participant+Equatable.swift index 4a6291803..f6669be75 100644 --- a/Sources/LiveKit/Participant/Participant+Equatable.swift +++ b/Sources/LiveKit/Participant/Participant+Equatable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant+Identifiable.swift b/Sources/LiveKit/Participant/Participant+Identifiable.swift index f3c066d1d..e928a9821 100644 --- a/Sources/LiveKit/Participant/Participant+Identifiable.swift +++ b/Sources/LiveKit/Participant/Participant+Identifiable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant+Kind.swift b/Sources/LiveKit/Participant/Participant+Kind.swift index 7bbd924ab..9ac42c0a5 100644 --- a/Sources/LiveKit/Participant/Participant+Kind.swift +++ b/Sources/LiveKit/Participant/Participant+Kind.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant+MulticastDelegate.swift b/Sources/LiveKit/Participant/Participant+MulticastDelegate.swift index 5d500386a..bb67ef06a 100644 --- a/Sources/LiveKit/Participant/Participant+MulticastDelegate.swift +++ b/Sources/LiveKit/Participant/Participant+MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/Participant.swift b/Sources/LiveKit/Participant/Participant.swift index c6b577f38..037cce000 100644 --- a/Sources/LiveKit/Participant/Participant.swift +++ b/Sources/LiveKit/Participant/Participant.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/RemoteParticipant+Active.swift b/Sources/LiveKit/Participant/RemoteParticipant+Active.swift index faf5b6293..4603b07ce 100644 --- a/Sources/LiveKit/Participant/RemoteParticipant+Active.swift +++ b/Sources/LiveKit/Participant/RemoteParticipant+Active.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Participant/RemoteParticipant.swift b/Sources/LiveKit/Participant/RemoteParticipant.swift index 63d06bed2..69b1270a2 100644 --- a/Sources/LiveKit/Participant/RemoteParticipant.swift +++ b/Sources/LiveKit/Participant/RemoteParticipant.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift b/Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift index eb58eee6b..86b84b56c 100644 --- a/Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift +++ b/Sources/LiveKit/Protocols/AudioCustomProcessingDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/AudioRenderer.swift b/Sources/LiveKit/Protocols/AudioRenderer.swift index 1804fa2c0..9b4c5f2c9 100644 --- a/Sources/LiveKit/Protocols/AudioRenderer.swift +++ b/Sources/LiveKit/Protocols/AudioRenderer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/MediaEncoding.swift b/Sources/LiveKit/Protocols/MediaEncoding.swift index 3c3b103ec..88e24d340 100644 --- a/Sources/LiveKit/Protocols/MediaEncoding.swift +++ b/Sources/LiveKit/Protocols/MediaEncoding.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/Mirrorable.swift b/Sources/LiveKit/Protocols/Mirrorable.swift index 757417ae1..fec536e13 100644 --- a/Sources/LiveKit/Protocols/Mirrorable.swift +++ b/Sources/LiveKit/Protocols/Mirrorable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/NextInvokable.swift b/Sources/LiveKit/Protocols/NextInvokable.swift index 232e6480f..b3ec0c13c 100644 --- a/Sources/LiveKit/Protocols/NextInvokable.swift +++ b/Sources/LiveKit/Protocols/NextInvokable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/ParticipantDelegate.swift b/Sources/LiveKit/Protocols/ParticipantDelegate.swift index 7f0112e9b..57cd5750d 100644 --- a/Sources/LiveKit/Protocols/ParticipantDelegate.swift +++ b/Sources/LiveKit/Protocols/ParticipantDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/RoomDelegate.swift b/Sources/LiveKit/Protocols/RoomDelegate.swift index c276f746d..15ceb4d94 100644 --- a/Sources/LiveKit/Protocols/RoomDelegate.swift +++ b/Sources/LiveKit/Protocols/RoomDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/SignalClientDelegate.swift b/Sources/LiveKit/Protocols/SignalClientDelegate.swift index bff50161b..01452daa7 100644 --- a/Sources/LiveKit/Protocols/SignalClientDelegate.swift +++ b/Sources/LiveKit/Protocols/SignalClientDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/TrackDelegate.swift b/Sources/LiveKit/Protocols/TrackDelegate.swift index eea955eb6..c4df66968 100644 --- a/Sources/LiveKit/Protocols/TrackDelegate.swift +++ b/Sources/LiveKit/Protocols/TrackDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/TransportDelegate.swift b/Sources/LiveKit/Protocols/TransportDelegate.swift index 9e7557ece..4bebeae5e 100644 --- a/Sources/LiveKit/Protocols/TransportDelegate.swift +++ b/Sources/LiveKit/Protocols/TransportDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/VideoProcessor.swift b/Sources/LiveKit/Protocols/VideoProcessor.swift index 8acc68b95..232747563 100644 --- a/Sources/LiveKit/Protocols/VideoProcessor.swift +++ b/Sources/LiveKit/Protocols/VideoProcessor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/VideoRenderer.swift b/Sources/LiveKit/Protocols/VideoRenderer.swift index 1461fca68..6c8827253 100644 --- a/Sources/LiveKit/Protocols/VideoRenderer.swift +++ b/Sources/LiveKit/Protocols/VideoRenderer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Protocols/VideoViewDelegate.swift b/Sources/LiveKit/Protocols/VideoViewDelegate.swift index 3089f81b3..2606458cf 100644 --- a/Sources/LiveKit/Protocols/VideoViewDelegate.swift +++ b/Sources/LiveKit/Protocols/VideoViewDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AppStateListener.swift b/Sources/LiveKit/Support/AppStateListener.swift index dc6719ba8..7c0cef5c9 100644 --- a/Sources/LiveKit/Support/AppStateListener.swift +++ b/Sources/LiveKit/Support/AppStateListener.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AsyncCompleter.swift b/Sources/LiveKit/Support/Async/AsyncCompleter.swift similarity index 99% rename from Sources/LiveKit/Support/AsyncCompleter.swift rename to Sources/LiveKit/Support/Async/AsyncCompleter.swift index 54467d81b..a00a0a297 100644 --- a/Sources/LiveKit/Support/AsyncCompleter.swift +++ b/Sources/LiveKit/Support/Async/AsyncCompleter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AsyncDebounce.swift b/Sources/LiveKit/Support/Async/AsyncDebounce.swift similarity index 92% rename from Sources/LiveKit/Support/AsyncDebounce.swift rename to Sources/LiveKit/Support/Async/AsyncDebounce.swift index dc7adfa8b..10a1f0608 100644 --- a/Sources/LiveKit/Support/AsyncDebounce.swift +++ b/Sources/LiveKit/Support/Async/AsyncDebounce.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import Foundation actor Debounce { - private var _task: Task? + private var _task: AnyTaskCancellable? private let _delay: TimeInterval init(delay: TimeInterval) { @@ -39,6 +39,6 @@ actor Debounce { if !Task.isCancelled { try? await action() } - } + }.cancellable() } } diff --git a/Sources/LiveKit/Support/AsyncFileStream.swift b/Sources/LiveKit/Support/Async/AsyncFileStream.swift similarity index 99% rename from Sources/LiveKit/Support/AsyncFileStream.swift rename to Sources/LiveKit/Support/Async/AsyncFileStream.swift index 15d92f509..55305d05a 100644 --- a/Sources/LiveKit/Support/AsyncFileStream.swift +++ b/Sources/LiveKit/Support/Async/AsyncFileStream.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AsyncRetry.swift b/Sources/LiveKit/Support/Async/AsyncRetry.swift similarity index 98% rename from Sources/LiveKit/Support/AsyncRetry.swift rename to Sources/LiveKit/Support/Async/AsyncRetry.swift index decbd9fe2..f05558104 100644 --- a/Sources/LiveKit/Support/AsyncRetry.swift +++ b/Sources/LiveKit/Support/Async/AsyncRetry.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Async/AsyncSequence+Subscribe.swift b/Sources/LiveKit/Support/Async/AsyncSequence+Subscribe.swift new file mode 100644 index 000000000..3e6cb840e --- /dev/null +++ b/Sources/LiveKit/Support/Async/AsyncSequence+Subscribe.swift @@ -0,0 +1,193 @@ +/* + * Copyright 2026 LiveKit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Combine +import Foundation + +extension AsyncSequence where Element: Sendable, Self: Sendable { + /// Subscribe to an AsyncSequence with a lifecycle tied to an observer. + /// + /// The loop automatically terminates if the observer is deallocated. + /// + /// - Parameters: + /// - observer: The observer object (captured weakly). + /// - priority: The priority of the task. + /// - state: The initial mutable state. + /// - onElement: Called for each element. + /// - onFailure: Called when the sequence terminates with an error. Cancellation errors are ignored. + /// - Returns: The task cancellable. + func subscribe( + _ observer: O, + priority: TaskPriority? = nil, + state: State, + onElement: @escaping @Sendable (O, Element, inout State) async -> Void, + onFailure: (@Sendable (O, Error, inout State) async -> Void)? = nil + ) -> AnyTaskCancellable { + Task(priority: priority) { [weak observer] in + var state = state + do { + for try await element in self { + guard let observer else { break } + await onElement(observer, element, &state) + } + } catch { + if error is CancellationError { return } + if let observer, let onFailure { + await onFailure(observer, error, &state) + } + } + }.cancellable() + } + + /// Subscribe to an AsyncSequence with a lifecycle tied to an observer. + /// + /// The loop automatically terminates if the observer is deallocated. + /// + /// - Parameters: + /// - observer: The observer object (captured weakly). + /// - priority: The priority of the task. + /// - onElement: Called for each element. + /// - onFailure: Called when the sequence terminates with an error. Cancellation errors are ignored. + /// - Returns: The task cancellable. + func subscribe( + _ observer: O, + priority: TaskPriority? = nil, + onElement: @escaping @Sendable (O, Element) async -> Void, + onFailure: (@Sendable (O, Error) async -> Void)? = nil + ) -> AnyTaskCancellable { + subscribe( + observer, + priority: priority, + state: (), + onElement: { observer, element, _ in await onElement(observer, element) }, + onFailure: { observer, error, _ in + if let onFailure { await onFailure(observer, error) } + } + ) + } + + /// Subscribe to an AsyncSequence with a lifecycle tied to an observer on the MainActor. + /// + /// The loop automatically terminates if the observer is deallocated. + /// + /// - Parameters: + /// - observer: The observer object (captured weakly). + /// - priority: The priority of the task. + /// - state: The initial mutable state. + /// - onElement: Called for each element on the MainActor. + /// - onFailure: Called when the sequence terminates with an error on the MainActor. Cancellation errors are ignored. + /// - Returns: The task cancellable. + @MainActor + func subscribeOnMainActor( + _ observer: O, + priority: TaskPriority? = nil, + state: State, + onElement: @escaping @MainActor (O, Element, inout State) async -> Void, + onFailure: (@MainActor (O, Error, inout State) async -> Void)? = nil + ) -> AnyTaskCancellable { + Task(priority: priority) { @MainActor [weak observer] in + var state = state + do { + for try await element in self { + guard let observer else { break } + await onElement(observer, element, &state) + } + } catch { + if error is CancellationError { return } + if let observer, let onFailure { + await onFailure(observer, error, &state) + } + } + }.cancellable() + } + + /// Subscribe to an AsyncSequence with a lifecycle tied to an observer on the MainActor. + /// + /// The loop automatically terminates if the observer is deallocated. + /// + /// - Parameters: + /// - observer: The observer object (captured weakly). + /// - priority: The priority of the task. + /// - onElement: Called for each element on the MainActor. + /// - onFailure: Called when the sequence terminates with an error on the MainActor. Cancellation errors are ignored. + /// - Returns: The task cancellable. + @MainActor + func subscribeOnMainActor( + _ observer: O, + priority: TaskPriority? = nil, + onElement: @escaping @MainActor (O, Element) async -> Void, + onFailure: (@MainActor (O, Error) async -> Void)? = nil + ) -> AnyTaskCancellable { + subscribeOnMainActor( + observer, + priority: priority, + state: (), + onElement: { observer, element, _ in await onElement(observer, element) }, + onFailure: { observer, error, _ in + if let onFailure { await onFailure(observer, error) } + } + ) + } +} + +extension Task { + func cancellable() -> AnyTaskCancellable { + AnyTaskCancellable(self) + } +} + +/// A Sendable variant of Combine's AnyCancellable. +final class AnyTaskCancellable: Cancellable, Sendable, Hashable { + private let _cancel: @Sendable () -> Void + + init(_ task: Task) { + #if swift(>=6.0) + _cancel = task.cancel + #else + _cancel = { @Sendable in task.cancel() } + #endif + } + + deinit { + _cancel() + } + + func cancel() { + _cancel() + } + + func store(in set: inout Set) { + set.insert(self) + } + + func store(in collection: inout C) where C: RangeReplaceableCollection, C.Element == AnyTaskCancellable { + collection.append(self) + } + + static func == (lhs: AnyTaskCancellable, rhs: AnyTaskCancellable) -> Bool { + ObjectIdentifier(lhs) == ObjectIdentifier(rhs) + } + + func hash(into hasher: inout Hasher) { + ObjectIdentifier(self).hash(into: &hasher) + } +} + +extension AnyTaskCancellable { + func eraseToAnyCancellable() -> AnyCancellable { + AnyCancellable(cancel) + } +} diff --git a/Sources/LiveKit/Support/AsyncSerialDelegate.swift b/Sources/LiveKit/Support/Async/AsyncSerialDelegate.swift similarity index 98% rename from Sources/LiveKit/Support/AsyncSerialDelegate.swift rename to Sources/LiveKit/Support/Async/AsyncSerialDelegate.swift index 290b50c18..6d8b0fecd 100644 --- a/Sources/LiveKit/Support/AsyncSerialDelegate.swift +++ b/Sources/LiveKit/Support/Async/AsyncSerialDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AsyncTimer.swift b/Sources/LiveKit/Support/Async/AsyncTimer.swift similarity index 96% rename from Sources/LiveKit/Support/AsyncTimer.swift rename to Sources/LiveKit/Support/Async/AsyncTimer.swift index 727f8a479..ffd78d894 100644 --- a/Sources/LiveKit/Support/AsyncTimer.swift +++ b/Sources/LiveKit/Support/Async/AsyncTimer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ final class AsyncTimer: Sendable, Loggable { struct State: Sendable { var isStarted: Bool = false var interval: TimeInterval - var task: Task? + var task: AnyTaskCancellable? var block: TimerBlock? } @@ -77,7 +77,7 @@ final class AsyncTimer: Sendable, Loggable { log("Error in timer block: \(error)", .error) } await scheduleNextInvocation() - } + }.cancellable() _state.mutate { $0.task = task } } diff --git a/Sources/LiveKit/Support/AsyncTryMapSequence.swift b/Sources/LiveKit/Support/Async/AsyncTryMapSequence.swift similarity index 98% rename from Sources/LiveKit/Support/AsyncTryMapSequence.swift rename to Sources/LiveKit/Support/Async/AsyncTryMapSequence.swift index 634a2ade5..582b9ac88 100644 --- a/Sources/LiveKit/Support/AsyncTryMapSequence.swift +++ b/Sources/LiveKit/Support/Async/AsyncTryMapSequence.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/ObservableObject+.swift b/Sources/LiveKit/Support/Async/ObservableObject+.swift similarity index 97% rename from Sources/LiveKit/Support/ObservableObject+.swift rename to Sources/LiveKit/Support/Async/ObservableObject+.swift index 8be4f1558..656447625 100644 --- a/Sources/LiveKit/Support/ObservableObject+.swift +++ b/Sources/LiveKit/Support/Async/ObservableObject+.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Audio/AVAudioPCMRingBuffer.swift b/Sources/LiveKit/Support/Audio/AVAudioPCMRingBuffer.swift index 24df44fc9..436033fef 100644 --- a/Sources/LiveKit/Support/Audio/AVAudioPCMRingBuffer.swift +++ b/Sources/LiveKit/Support/Audio/AVAudioPCMRingBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Audio/AudioConverter.swift b/Sources/LiveKit/Support/Audio/AudioConverter.swift index ce497a070..4323ea8b8 100644 --- a/Sources/LiveKit/Support/Audio/AudioConverter.swift +++ b/Sources/LiveKit/Support/Audio/AudioConverter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AudioMixRecorder.swift b/Sources/LiveKit/Support/Audio/AudioMixRecorder.swift similarity index 99% rename from Sources/LiveKit/Support/AudioMixRecorder.swift rename to Sources/LiveKit/Support/Audio/AudioMixRecorder.swift index 70e94f7e0..2096edaa0 100644 --- a/Sources/LiveKit/Support/AudioMixRecorder.swift +++ b/Sources/LiveKit/Support/Audio/AudioMixRecorder.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/AudioPlayerRenderer.swift b/Sources/LiveKit/Support/Audio/AudioPlayerRenderer.swift similarity index 98% rename from Sources/LiveKit/Support/AudioPlayerRenderer.swift rename to Sources/LiveKit/Support/Audio/AudioPlayerRenderer.swift index 9d4567f92..8ac4e20f3 100644 --- a/Sources/LiveKit/Support/AudioPlayerRenderer.swift +++ b/Sources/LiveKit/Support/Audio/AudioPlayerRenderer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/FFTProcessor.swift b/Sources/LiveKit/Support/Audio/FFTProcessor.swift similarity index 99% rename from Sources/LiveKit/Support/FFTProcessor.swift rename to Sources/LiveKit/Support/Audio/FFTProcessor.swift index 3c971d43d..10d531e53 100755 --- a/Sources/LiveKit/Support/FFTProcessor.swift +++ b/Sources/LiveKit/Support/Audio/FFTProcessor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/MapTable.swift b/Sources/LiveKit/Support/DataStructures/MapTable.swift similarity index 98% rename from Sources/LiveKit/Support/MapTable.swift rename to Sources/LiveKit/Support/DataStructures/MapTable.swift index ac8fe043b..6749559bd 100644 --- a/Sources/LiveKit/Support/MapTable.swift +++ b/Sources/LiveKit/Support/DataStructures/MapTable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/RingBuffer.swift b/Sources/LiveKit/Support/DataStructures/RingBuffer.swift similarity index 98% rename from Sources/LiveKit/Support/RingBuffer.swift rename to Sources/LiveKit/Support/DataStructures/RingBuffer.swift index 7f9847a5d..489375114 100644 --- a/Sources/LiveKit/Support/RingBuffer.swift +++ b/Sources/LiveKit/Support/DataStructures/RingBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/TTLDictionary.swift b/Sources/LiveKit/Support/DataStructures/TTLDictionary.swift similarity index 99% rename from Sources/LiveKit/Support/TTLDictionary.swift rename to Sources/LiveKit/Support/DataStructures/TTLDictionary.swift index 89379e72d..4d5cccae1 100644 --- a/Sources/LiveKit/Support/TTLDictionary.swift +++ b/Sources/LiveKit/Support/DataStructures/TTLDictionary.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Global.swift b/Sources/LiveKit/Support/Global.swift index a525f1346..32c663a05 100644 --- a/Sources/LiveKit/Support/Global.swift +++ b/Sources/LiveKit/Support/Global.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Logger.swift b/Sources/LiveKit/Support/Logger.swift index 9549e39c9..4794f1927 100644 --- a/Sources/LiveKit/Support/Logger.swift +++ b/Sources/LiveKit/Support/Logger.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -120,6 +120,7 @@ open class OSLogger: Logger, @unchecked Sendable { private var logs: [String: OSLog] = [:] private lazy var rtcLogger = LKRTCCallbackLogger() + private var ffiTask: AnyTaskCancellable? private let minLevel: LogLevel @@ -189,18 +190,13 @@ open class OSLogger: Logger, @unchecked Sendable { private func startFFILogForwarding(minLevel: LogLevel) { Task(priority: .utility) { [weak self] in - guard self != nil else { return } // don't initialize global level when releasing + guard let self else { return } // don't initialize global level when releasing logForwardBootstrap(level: minLevel.logForwardFilter) let ffiLog = OSLog(subsystem: Self.subsystem, category: "FFI") - let ffiStream = AsyncStream(unfolding: logForwardReceive) - for await entry in ffiStream { - guard self != nil else { return } - - let message = "\(entry.target) \(entry.message)" - - os_log("%{public}@", log: ffiLog, type: entry.level.osLogType, message) + ffiTask = AsyncStream(unfolding: logForwardReceive).subscribe(self, priority: .utility) { _, entry in + os_log("%{public}@", log: ffiLog, type: entry.level.osLogType, "\(entry.target) \(entry.message)") } } } @@ -313,7 +309,9 @@ extension LogForwardLevel { case .warn: .default case .info: .info case .debug, .trace: .debug + #if swift(>=6.0) @unknown default: .debug + #endif } } } diff --git a/Sources/LiveKit/Support/MulticastDelegate.swift b/Sources/LiveKit/Support/MulticastDelegate.swift index 8758ad32e..3c0979ff6 100644 --- a/Sources/LiveKit/Support/MulticastDelegate.swift +++ b/Sources/LiveKit/Support/MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/ConnectivityListener.swift b/Sources/LiveKit/Support/Network/ConnectivityListener.swift similarity index 99% rename from Sources/LiveKit/Support/ConnectivityListener.swift rename to Sources/LiveKit/Support/Network/ConnectivityListener.swift index 377378c1e..a4b9bc4c9 100644 --- a/Sources/LiveKit/Support/ConnectivityListener.swift +++ b/Sources/LiveKit/Support/Network/ConnectivityListener.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/HTTP.swift b/Sources/LiveKit/Support/Network/HTTP.swift similarity index 98% rename from Sources/LiveKit/Support/HTTP.swift rename to Sources/LiveKit/Support/Network/HTTP.swift index 3d373d098..f7ddf35ad 100644 --- a/Sources/LiveKit/Support/HTTP.swift +++ b/Sources/LiveKit/Support/Network/HTTP.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/WebSocket.swift b/Sources/LiveKit/Support/Network/WebSocket.swift similarity index 99% rename from Sources/LiveKit/Support/WebSocket.swift rename to Sources/LiveKit/Support/Network/WebSocket.swift index 6a7abd17a..c288903f1 100644 --- a/Sources/LiveKit/Support/WebSocket.swift +++ b/Sources/LiveKit/Support/Network/WebSocket.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/QueueActor.swift b/Sources/LiveKit/Support/Schedulers/QueueActor.swift similarity index 98% rename from Sources/LiveKit/Support/QueueActor.swift rename to Sources/LiveKit/Support/Schedulers/QueueActor.swift index bb80697e7..ffed9eaa2 100644 --- a/Sources/LiveKit/Support/QueueActor.swift +++ b/Sources/LiveKit/Support/Schedulers/QueueActor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/SerialRunnerActor.swift b/Sources/LiveKit/Support/Schedulers/SerialRunnerActor.swift similarity index 98% rename from Sources/LiveKit/Support/SerialRunnerActor.swift rename to Sources/LiveKit/Support/Schedulers/SerialRunnerActor.swift index 398fbd86e..f29f3fecf 100644 --- a/Sources/LiveKit/Support/SerialRunnerActor.swift +++ b/Sources/LiveKit/Support/Schedulers/SerialRunnerActor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Stopwatch.swift b/Sources/LiveKit/Support/Stopwatch.swift index e1199a455..242d30fad 100644 --- a/Sources/LiveKit/Support/Stopwatch.swift +++ b/Sources/LiveKit/Support/Stopwatch.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Locks.swift b/Sources/LiveKit/Support/Sync/Locks.swift similarity index 99% rename from Sources/LiveKit/Support/Locks.swift rename to Sources/LiveKit/Support/Sync/Locks.swift index 22104fdf1..5f8b6abd4 100644 --- a/Sources/LiveKit/Support/Locks.swift +++ b/Sources/LiveKit/Support/Sync/Locks.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/StateSync.swift b/Sources/LiveKit/Support/Sync/StateSync.swift similarity index 99% rename from Sources/LiveKit/Support/StateSync.swift rename to Sources/LiveKit/Support/Sync/StateSync.swift index b3fbd088a..582365fa3 100644 --- a/Sources/LiveKit/Support/StateSync.swift +++ b/Sources/LiveKit/Support/Sync/StateSync.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/Utils.swift b/Sources/LiveKit/Support/Utils.swift index 666f6bb28..17b7ca99e 100644 --- a/Sources/LiveKit/Support/Utils.swift +++ b/Sources/LiveKit/Support/Utils.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/ValueOrAbsent.swift b/Sources/LiveKit/Support/ValueOrAbsent.swift index e5b180794..b17882015 100644 --- a/Sources/LiveKit/Support/ValueOrAbsent.swift +++ b/Sources/LiveKit/Support/ValueOrAbsent.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/DeviceManager.swift b/Sources/LiveKit/Support/Video/DeviceManager.swift similarity index 99% rename from Sources/LiveKit/Support/DeviceManager.swift rename to Sources/LiveKit/Support/Video/DeviceManager.swift index 272199d9c..2575d6bc5 100644 --- a/Sources/LiveKit/Support/DeviceManager.swift +++ b/Sources/LiveKit/Support/Video/DeviceManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/NativeView.swift b/Sources/LiveKit/Support/View/NativeView.swift similarity index 98% rename from Sources/LiveKit/Support/NativeView.swift rename to Sources/LiveKit/Support/View/NativeView.swift index d6f963c97..dbf97532b 100644 --- a/Sources/LiveKit/Support/NativeView.swift +++ b/Sources/LiveKit/Support/View/NativeView.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/NativeViewRepresentable.swift b/Sources/LiveKit/Support/View/NativeViewRepresentable.swift similarity index 98% rename from Sources/LiveKit/Support/NativeViewRepresentable.swift rename to Sources/LiveKit/Support/View/NativeViewRepresentable.swift index cdbf11bed..c81b3dd7a 100644 --- a/Sources/LiveKit/Support/NativeViewRepresentable.swift +++ b/Sources/LiveKit/Support/View/NativeViewRepresentable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Support/TextView.swift b/Sources/LiveKit/Support/View/TextView.swift similarity index 99% rename from Sources/LiveKit/Support/TextView.swift rename to Sources/LiveKit/Support/View/TextView.swift index f0ae63360..713f4625c 100644 --- a/Sources/LiveKit/Support/TextView.swift +++ b/Sources/LiveKit/Support/View/TextView.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/SwiftUI/LocalMedia.swift b/Sources/LiveKit/SwiftUI/LocalMedia.swift index e637001f9..3b0cb0e3b 100644 --- a/Sources/LiveKit/SwiftUI/LocalMedia.swift +++ b/Sources/LiveKit/SwiftUI/LocalMedia.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import Foundation /// microphone and camera, and selecting audio and video devices. It is designed to be used /// in SwiftUI views. @MainActor -open class LocalMedia: ObservableObject { +open class LocalMedia: ObservableObject, Loggable { // MARK: - Error public enum Error: LocalizedError { @@ -73,6 +73,7 @@ open class LocalMedia: ObservableObject { // MARK: - Dependencies private var localParticipant: LocalParticipant + private var tasks = Set() // MARK: - Initialization @@ -98,25 +99,25 @@ open class LocalMedia: ObservableObject { } private func observe(_ localParticipant: LocalParticipant) { - Task { [weak self] in - for try await _ in localParticipant.changes { - guard let self else { return } - - microphoneTrack = localParticipant.firstAudioTrack - cameraTrack = localParticipant.firstCameraVideoTrack - screenShareTrack = localParticipant.firstScreenShareVideoTrack - - isMicrophoneEnabled = localParticipant.isMicrophoneEnabled() - isCameraEnabled = localParticipant.isCameraEnabled() - isScreenShareEnabled = localParticipant.isScreenShareEnabled() - } - } + localParticipant.changes.subscribeOnMainActor(self) { observer, _ in + observer.microphoneTrack = localParticipant.firstAudioTrack + observer.cameraTrack = localParticipant.firstCameraVideoTrack + observer.screenShareTrack = localParticipant.firstScreenShareVideoTrack + + observer.isMicrophoneEnabled = localParticipant.isMicrophoneEnabled() + observer.isCameraEnabled = localParticipant.isCameraEnabled() + observer.isScreenShareEnabled = localParticipant.isScreenShareEnabled() + }.store(in: &tasks) } private func observeDevices() { try? AudioManager.shared.set(microphoneMuteMode: .inputMixer) // don't play mute sound effect Task { - try await AudioManager.shared.setRecordingAlwaysPreparedMode(true) + do { + try await AudioManager.shared.setRecordingAlwaysPreparedMode(true) + } catch { + log("Failed to setRecordingAlwaysPreparedMode: \(error)", .error) + } } AudioManager.shared.onDeviceUpdate = { _ in @@ -127,9 +128,13 @@ open class LocalMedia: ObservableObject { } Task { - canSwitchCamera = try await CameraCapturer.canSwitchPosition() - videoDevices = try await CameraCapturer.captureDevices() - selectedVideoDeviceID = videoDevices.first?.uniqueID + do { + canSwitchCamera = try await CameraCapturer.canSwitchPosition() + videoDevices = try await CameraCapturer.captureDevices() + selectedVideoDeviceID = videoDevices.first?.uniqueID + } catch { + log("Failed to configure camera devices: \(error)", .error) + } } } diff --git a/Sources/LiveKit/SwiftUI/SwiftUIAudioRoutePickerButton.swift b/Sources/LiveKit/SwiftUI/SwiftUIAudioRoutePickerButton.swift index 379fd498e..8e66b1bfb 100644 --- a/Sources/LiveKit/SwiftUI/SwiftUIAudioRoutePickerButton.swift +++ b/Sources/LiveKit/SwiftUI/SwiftUIAudioRoutePickerButton.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/SwiftUI/SwiftUIVideoView.swift b/Sources/LiveKit/SwiftUI/SwiftUIVideoView.swift index ec20a5e44..a1389da89 100644 --- a/Sources/LiveKit/SwiftUI/SwiftUIVideoView.swift +++ b/Sources/LiveKit/SwiftUI/SwiftUIVideoView.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/SwiftUI/TrackDelegateObserver.swift b/Sources/LiveKit/SwiftUI/TrackDelegateObserver.swift index 67b50bba3..57fd887f7 100644 --- a/Sources/LiveKit/SwiftUI/TrackDelegateObserver.swift +++ b/Sources/LiveKit/SwiftUI/TrackDelegateObserver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Token/CachingTokenSource.swift b/Sources/LiveKit/Token/CachingTokenSource.swift index 49ebff99e..0f649233f 100644 --- a/Sources/LiveKit/Token/CachingTokenSource.swift +++ b/Sources/LiveKit/Token/CachingTokenSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Token/EndpointTokenSource.swift b/Sources/LiveKit/Token/EndpointTokenSource.swift index 71dbff924..490888151 100644 --- a/Sources/LiveKit/Token/EndpointTokenSource.swift +++ b/Sources/LiveKit/Token/EndpointTokenSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Token/LiteralTokenSource.swift b/Sources/LiveKit/Token/LiteralTokenSource.swift index 4c83c23e1..400f9df83 100644 --- a/Sources/LiveKit/Token/LiteralTokenSource.swift +++ b/Sources/LiveKit/Token/LiteralTokenSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Token/SandboxTokenSource.swift b/Sources/LiveKit/Token/SandboxTokenSource.swift index 54b76c9ff..f58097d65 100644 --- a/Sources/LiveKit/Token/SandboxTokenSource.swift +++ b/Sources/LiveKit/Token/SandboxTokenSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Token/TokenSource.swift b/Sources/LiveKit/Token/TokenSource.swift index dd0ba842a..395768bdc 100644 --- a/Sources/LiveKit/Token/TokenSource.swift +++ b/Sources/LiveKit/Token/TokenSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/AudioTrack.swift b/Sources/LiveKit/Track/AudioTrack.swift index f9aa26cfd..9bd5300ab 100644 --- a/Sources/LiveKit/Track/AudioTrack.swift +++ b/Sources/LiveKit/Track/AudioTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift b/Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift index bbcb353e9..5020a13ce 100644 --- a/Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/ARCameraCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import Foundation internal import LiveKitWebRTC @available(visionOS 2.0, *) -public class ARCameraCapturer: VideoCapturer { +public class ARCameraCapturer: VideoCapturer, @unchecked Sendable { private let capturer = RTC.createVideoCapturer() private let arKitSession = ARKitSession() private let cameraFrameProvider = CameraFrameProvider() @@ -29,7 +29,7 @@ public class ARCameraCapturer: VideoCapturer { /// The ``ARCaptureOptions`` used for this capturer. public let options: ARCameraCaptureOptions - private var captureTask: Task? + private var captureTask: AnyTaskCancellable? init(delegate: LKRTCVideoCapturerDelegate, options: ARCameraCaptureOptions) { self.options = options @@ -58,7 +58,7 @@ public class ARCameraCapturer: VideoCapturer { capture(pixelBuffer: sample.pixelBuffer, capturer: capturer, options: options) } } - } + }.cancellable() return true } @@ -83,7 +83,6 @@ public class ARCameraCapturer: VideoCapturer { guard didStop else { return false } arKitSession.stop() - captureTask?.cancel() captureTask = nil return true diff --git a/Sources/LiveKit/Track/Capturers/BufferCapturer.swift b/Sources/LiveKit/Track/Capturers/BufferCapturer.swift index add4142ed..20fdfa835 100644 --- a/Sources/LiveKit/Track/Capturers/BufferCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/BufferCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Capturers/CameraCapturer.swift b/Sources/LiveKit/Track/Capturers/CameraCapturer.swift index 716ac312a..75637e987 100644 --- a/Sources/LiveKit/Track/Capturers/CameraCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/CameraCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Capturers/InAppCapturer.swift b/Sources/LiveKit/Track/Capturers/InAppCapturer.swift index 59f9be159..40f095d8d 100644 --- a/Sources/LiveKit/Track/Capturers/InAppCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/InAppCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift b/Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift index 32aebe3d8..e047c1011 100644 --- a/Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/MacOSScreenCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ public class MacOSScreenCapturer: VideoCapturer, @unchecked Sendable { var scStream: SCStream? // Cached frame for resending to maintain minimum of 1 fps var lastFrame: LKRTCVideoFrame? - var resendTimer: Task? + var resendTimer: AnyTaskCancellable? } private var _screenCapturerState = StateSync(State()) @@ -127,7 +127,6 @@ public class MacOSScreenCapturer: VideoCapturer, @unchecked Sendable { // Stop resending paused frames _screenCapturerState.mutate { - $0.resendTimer?.cancel() $0.resendTimer = nil } @@ -256,10 +255,9 @@ extension MacOSScreenCapturer: SCStreamOutput { guard let self else { break } try await _capturePreviousFrame() } - } + }.cancellable() _screenCapturerState.mutate { - $0.resendTimer?.cancel() $0.resendTimer = newTimer } diff --git a/Sources/LiveKit/Track/Capturers/VideoCapturer+MulticastDelegate.swift b/Sources/LiveKit/Track/Capturers/VideoCapturer+MulticastDelegate.swift index 258dca9eb..b31d0bf63 100644 --- a/Sources/LiveKit/Track/Capturers/VideoCapturer+MulticastDelegate.swift +++ b/Sources/LiveKit/Track/Capturers/VideoCapturer+MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Capturers/VideoCapturer.swift b/Sources/LiveKit/Track/Capturers/VideoCapturer.swift index fcd664c91..421acf16a 100644 --- a/Sources/LiveKit/Track/Capturers/VideoCapturer.swift +++ b/Sources/LiveKit/Track/Capturers/VideoCapturer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Local/LocalAudioTrack.swift b/Sources/LiveKit/Track/Local/LocalAudioTrack.swift index a9f3d3e6b..a1dc28f9b 100644 --- a/Sources/LiveKit/Track/Local/LocalAudioTrack.swift +++ b/Sources/LiveKit/Track/Local/LocalAudioTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Local/LocalTrack.swift b/Sources/LiveKit/Track/Local/LocalTrack.swift index 4a9144380..a54aa7738 100644 --- a/Sources/LiveKit/Track/Local/LocalTrack.swift +++ b/Sources/LiveKit/Track/Local/LocalTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Local/LocalVideoTrack.swift b/Sources/LiveKit/Track/Local/LocalVideoTrack.swift index c47b14c20..d25edd190 100644 --- a/Sources/LiveKit/Track/Local/LocalVideoTrack.swift +++ b/Sources/LiveKit/Track/Local/LocalVideoTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Metrics/MetricsManager.swift b/Sources/LiveKit/Track/Metrics/MetricsManager.swift index 57cdece0e..562e3cf3b 100644 --- a/Sources/LiveKit/Track/Metrics/MetricsManager.swift +++ b/Sources/LiveKit/Track/Metrics/MetricsManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Recorders/LocalAudioTrackRecorder.swift b/Sources/LiveKit/Track/Recorders/LocalAudioTrackRecorder.swift index 5e002e9a6..b52ca849d 100644 --- a/Sources/LiveKit/Track/Recorders/LocalAudioTrackRecorder.swift +++ b/Sources/LiveKit/Track/Recorders/LocalAudioTrackRecorder.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift b/Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift index 30589bd54..67480e42c 100644 --- a/Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift +++ b/Sources/LiveKit/Track/Remote/RemoteAudioTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Remote/RemoteTrack.swift b/Sources/LiveKit/Track/Remote/RemoteTrack.swift index 51460cdb5..9af9695fb 100644 --- a/Sources/LiveKit/Track/Remote/RemoteTrack.swift +++ b/Sources/LiveKit/Track/Remote/RemoteTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift b/Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift index 0927f5967..9f06bfa1f 100644 --- a/Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift +++ b/Sources/LiveKit/Track/Remote/RemoteVideoTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Support/Extensions.swift b/Sources/LiveKit/Track/Support/Extensions.swift index 183dde9e2..43c6389fa 100644 --- a/Sources/LiveKit/Track/Support/Extensions.swift +++ b/Sources/LiveKit/Track/Support/Extensions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Track+Equatable.swift b/Sources/LiveKit/Track/Track+Equatable.swift index 9af8d5b86..8b4231edf 100644 --- a/Sources/LiveKit/Track/Track+Equatable.swift +++ b/Sources/LiveKit/Track/Track+Equatable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Track+MulticastDelegate.swift b/Sources/LiveKit/Track/Track+MulticastDelegate.swift index 10ea62ca6..3908f2831 100644 --- a/Sources/LiveKit/Track/Track+MulticastDelegate.swift +++ b/Sources/LiveKit/Track/Track+MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/Track.swift b/Sources/LiveKit/Track/Track.swift index 33d7ba986..a5cd12fd2 100644 --- a/Sources/LiveKit/Track/Track.swift +++ b/Sources/LiveKit/Track/Track.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Track/VideoTrack.swift b/Sources/LiveKit/Track/VideoTrack.swift index d3da770c6..ca569a7f5 100644 --- a/Sources/LiveKit/Track/VideoTrack.swift +++ b/Sources/LiveKit/Track/VideoTrack.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/TrackPublications/LocalTrackPublication.swift b/Sources/LiveKit/TrackPublications/LocalTrackPublication.swift index 00c3e0538..bcbe65366 100644 --- a/Sources/LiveKit/TrackPublications/LocalTrackPublication.swift +++ b/Sources/LiveKit/TrackPublications/LocalTrackPublication.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/TrackPublications/RemoteTrackPublication.swift b/Sources/LiveKit/TrackPublications/RemoteTrackPublication.swift index 10e134453..926b5ed4f 100644 --- a/Sources/LiveKit/TrackPublications/RemoteTrackPublication.swift +++ b/Sources/LiveKit/TrackPublications/RemoteTrackPublication.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/TrackPublications/TrackPublication+Equatable.swift b/Sources/LiveKit/TrackPublications/TrackPublication+Equatable.swift index 859696f7c..7d21b6ab2 100644 --- a/Sources/LiveKit/TrackPublications/TrackPublication+Equatable.swift +++ b/Sources/LiveKit/TrackPublications/TrackPublication+Equatable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/TrackPublications/TrackPublication+Identifiable.swift b/Sources/LiveKit/TrackPublications/TrackPublication+Identifiable.swift index 64fe31e14..490e24adc 100644 --- a/Sources/LiveKit/TrackPublications/TrackPublication+Identifiable.swift +++ b/Sources/LiveKit/TrackPublications/TrackPublication+Identifiable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/TrackPublications/TrackPublication.swift b/Sources/LiveKit/TrackPublications/TrackPublication.swift index b692b1da4..a4c5c4fcd 100644 --- a/Sources/LiveKit/TrackPublications/TrackPublication.swift +++ b/Sources/LiveKit/TrackPublications/TrackPublication.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Attributes/AttributeTypings.swift b/Sources/LiveKit/Types/Attributes/AttributeTypings.swift index 3dce1667c..adb214111 100644 --- a/Sources/LiveKit/Types/Attributes/AttributeTypings.swift +++ b/Sources/LiveKit/Types/Attributes/AttributeTypings.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioBuffer.swift b/Sources/LiveKit/Types/AudioBuffer.swift index 17dd54ac0..3261df023 100644 --- a/Sources/LiveKit/Types/AudioBuffer.swift +++ b/Sources/LiveKit/Types/AudioBuffer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioDevice.swift b/Sources/LiveKit/Types/AudioDevice.swift index 356668a28..9f7227760 100644 --- a/Sources/LiveKit/Types/AudioDevice.swift +++ b/Sources/LiveKit/Types/AudioDevice.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioDuckingLevel.swift b/Sources/LiveKit/Types/AudioDuckingLevel.swift index 6caa49673..c65e6ac76 100644 --- a/Sources/LiveKit/Types/AudioDuckingLevel.swift +++ b/Sources/LiveKit/Types/AudioDuckingLevel.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioEncoding+Comparable.swift b/Sources/LiveKit/Types/AudioEncoding+Comparable.swift index b0948314b..2af9b92c8 100644 --- a/Sources/LiveKit/Types/AudioEncoding+Comparable.swift +++ b/Sources/LiveKit/Types/AudioEncoding+Comparable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioEncoding.swift b/Sources/LiveKit/Types/AudioEncoding.swift index 26d34bf07..06fdc54b7 100644 --- a/Sources/LiveKit/Types/AudioEncoding.swift +++ b/Sources/LiveKit/Types/AudioEncoding.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioEngineAvailability.swift b/Sources/LiveKit/Types/AudioEngineAvailability.swift index ce427ec18..1832f8e89 100644 --- a/Sources/LiveKit/Types/AudioEngineAvailability.swift +++ b/Sources/LiveKit/Types/AudioEngineAvailability.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/AudioSessionConfiguration.swift b/Sources/LiveKit/Types/AudioSessionConfiguration.swift index 09da944b2..c6fb590e5 100644 --- a/Sources/LiveKit/Types/AudioSessionConfiguration.swift +++ b/Sources/LiveKit/Types/AudioSessionConfiguration.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Codec/Codec.swift b/Sources/LiveKit/Types/Codec/Codec.swift index 666683aee..8f18565c2 100644 --- a/Sources/LiveKit/Types/Codec/Codec.swift +++ b/Sources/LiveKit/Types/Codec/Codec.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Codec/VideoCodec.swift b/Sources/LiveKit/Types/Codec/VideoCodec.swift index 03f0669d3..ef88acc87 100644 --- a/Sources/LiveKit/Types/Codec/VideoCodec.swift +++ b/Sources/LiveKit/Types/Codec/VideoCodec.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ConnectionQuality.swift b/Sources/LiveKit/Types/ConnectionQuality.swift index 84f2cfedd..e7c0022c8 100644 --- a/Sources/LiveKit/Types/ConnectionQuality.swift +++ b/Sources/LiveKit/Types/ConnectionQuality.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ConnectionState.swift b/Sources/LiveKit/Types/ConnectionState.swift index 7d81637af..e2cf4f884 100644 --- a/Sources/LiveKit/Types/ConnectionState.swift +++ b/Sources/LiveKit/Types/ConnectionState.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/DegradationPreference.swift b/Sources/LiveKit/Types/DegradationPreference.swift index d3335b9d4..3440360d7 100644 --- a/Sources/LiveKit/Types/DegradationPreference.swift +++ b/Sources/LiveKit/Types/DegradationPreference.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Dimensions.swift b/Sources/LiveKit/Types/Dimensions.swift index 5bb3fd560..7fc3c7cac 100644 --- a/Sources/LiveKit/Types/Dimensions.swift +++ b/Sources/LiveKit/Types/Dimensions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/IceCandidate.swift b/Sources/LiveKit/Types/IceCandidate.swift index 9e0bbb418..7eb0ebc26 100644 --- a/Sources/LiveKit/Types/IceCandidate.swift +++ b/Sources/LiveKit/Types/IceCandidate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/IceServer.swift b/Sources/LiveKit/Types/IceServer.swift index 983a50933..dcae92a45 100644 --- a/Sources/LiveKit/Types/IceServer.swift +++ b/Sources/LiveKit/Types/IceServer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/IceTransportPolicy.swift b/Sources/LiveKit/Types/IceTransportPolicy.swift index 1d7a520ff..49b5648e2 100644 --- a/Sources/LiveKit/Types/IceTransportPolicy.swift +++ b/Sources/LiveKit/Types/IceTransportPolicy.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/MediaDevice.swift b/Sources/LiveKit/Types/MediaDevice.swift index ace45bc7c..e73eac2ab 100644 --- a/Sources/LiveKit/Types/MediaDevice.swift +++ b/Sources/LiveKit/Types/MediaDevice.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/ARCameraCaptureOptions.swift b/Sources/LiveKit/Types/Options/ARCameraCaptureOptions.swift index 45484ad7a..57b1e815d 100644 --- a/Sources/LiveKit/Types/Options/ARCameraCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/ARCameraCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/AudioCaptureOptions.swift b/Sources/LiveKit/Types/Options/AudioCaptureOptions.swift index 94464b17e..f49bb711a 100644 --- a/Sources/LiveKit/Types/Options/AudioCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/AudioCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/AudioPublishOptions.swift b/Sources/LiveKit/Types/Options/AudioPublishOptions.swift index 2d487689e..bec8f407e 100644 --- a/Sources/LiveKit/Types/Options/AudioPublishOptions.swift +++ b/Sources/LiveKit/Types/Options/AudioPublishOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/BufferCaptureOptions.swift b/Sources/LiveKit/Types/Options/BufferCaptureOptions.swift index 9ec955822..1b2cfc9eb 100644 --- a/Sources/LiveKit/Types/Options/BufferCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/BufferCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/CameraCaptureOptions+Copy.swift b/Sources/LiveKit/Types/Options/CameraCaptureOptions+Copy.swift index 8a1151536..2ca49fc41 100644 --- a/Sources/LiveKit/Types/Options/CameraCaptureOptions+Copy.swift +++ b/Sources/LiveKit/Types/Options/CameraCaptureOptions+Copy.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/CameraCaptureOptions.swift b/Sources/LiveKit/Types/Options/CameraCaptureOptions.swift index 84642b894..449929e06 100644 --- a/Sources/LiveKit/Types/Options/CameraCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/CameraCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/CaptureOptions.swift b/Sources/LiveKit/Types/Options/CaptureOptions.swift index 72003eca7..af2d233a0 100644 --- a/Sources/LiveKit/Types/Options/CaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/CaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/ConnectOptions+Copy.swift b/Sources/LiveKit/Types/Options/ConnectOptions+Copy.swift index 8cab09830..d19b5034d 100644 --- a/Sources/LiveKit/Types/Options/ConnectOptions+Copy.swift +++ b/Sources/LiveKit/Types/Options/ConnectOptions+Copy.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/ConnectOptions.swift b/Sources/LiveKit/Types/Options/ConnectOptions.swift index 4a6847cd0..f49babd10 100644 --- a/Sources/LiveKit/Types/Options/ConnectOptions.swift +++ b/Sources/LiveKit/Types/Options/ConnectOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/DataPublishOptions.swift b/Sources/LiveKit/Types/Options/DataPublishOptions.swift index c0af00dfc..966604224 100644 --- a/Sources/LiveKit/Types/Options/DataPublishOptions.swift +++ b/Sources/LiveKit/Types/Options/DataPublishOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/PublishOptions.swift b/Sources/LiveKit/Types/Options/PublishOptions.swift index a320e7356..4acbac237 100644 --- a/Sources/LiveKit/Types/Options/PublishOptions.swift +++ b/Sources/LiveKit/Types/Options/PublishOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/RoomOptions.swift b/Sources/LiveKit/Types/Options/RoomOptions.swift index e20e93100..e3085a662 100644 --- a/Sources/LiveKit/Types/Options/RoomOptions.swift +++ b/Sources/LiveKit/Types/Options/RoomOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/ScreenShareCaptureOptions.swift b/Sources/LiveKit/Types/Options/ScreenShareCaptureOptions.swift index 0b1b64ccb..19db61ae9 100644 --- a/Sources/LiveKit/Types/Options/ScreenShareCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/ScreenShareCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/VideoCaptureOptions.swift b/Sources/LiveKit/Types/Options/VideoCaptureOptions.swift index 3b7bf0974..a058a0f1f 100644 --- a/Sources/LiveKit/Types/Options/VideoCaptureOptions.swift +++ b/Sources/LiveKit/Types/Options/VideoCaptureOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Options/VideoPublishOptions.swift b/Sources/LiveKit/Types/Options/VideoPublishOptions.swift index 85cece936..9970579b3 100644 --- a/Sources/LiveKit/Types/Options/VideoPublishOptions.swift +++ b/Sources/LiveKit/Types/Options/VideoPublishOptions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Participant+Types.swift b/Sources/LiveKit/Types/Participant+Types.swift index 9e6b7caac..7916f15b9 100644 --- a/Sources/LiveKit/Types/Participant+Types.swift +++ b/Sources/LiveKit/Types/Participant+Types.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ParticipantPermissions.swift b/Sources/LiveKit/Types/ParticipantPermissions.swift index bc4c1d8ae..23f46e68c 100644 --- a/Sources/LiveKit/Types/ParticipantPermissions.swift +++ b/Sources/LiveKit/Types/ParticipantPermissions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ParticipantState.swift b/Sources/LiveKit/Types/ParticipantState.swift index d2774f35b..9b0d6a650 100644 --- a/Sources/LiveKit/Types/ParticipantState.swift +++ b/Sources/LiveKit/Types/ParticipantState.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ParticipantTrackPermission.swift b/Sources/LiveKit/Types/ParticipantTrackPermission.swift index edaa1f153..8165dfc60 100644 --- a/Sources/LiveKit/Types/ParticipantTrackPermission.swift +++ b/Sources/LiveKit/Types/ParticipantTrackPermission.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ProtocolVersion.swift b/Sources/LiveKit/Types/ProtocolVersion.swift index ee28be56b..16d5ba4d0 100644 --- a/Sources/LiveKit/Types/ProtocolVersion.swift +++ b/Sources/LiveKit/Types/ProtocolVersion.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Room+Types.swift b/Sources/LiveKit/Types/Room+Types.swift index 6ef10f7bf..946da6b2f 100644 --- a/Sources/LiveKit/Types/Room+Types.swift +++ b/Sources/LiveKit/Types/Room+Types.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/RoomConfiguration.swift b/Sources/LiveKit/Types/RoomConfiguration.swift index bbf197f6d..0f417c978 100644 --- a/Sources/LiveKit/Types/RoomConfiguration.swift +++ b/Sources/LiveKit/Types/RoomConfiguration.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/ScalabilityMode.swift b/Sources/LiveKit/Types/ScalabilityMode.swift index e947a0b57..80e9fd3ae 100644 --- a/Sources/LiveKit/Types/ScalabilityMode.swift +++ b/Sources/LiveKit/Types/ScalabilityMode.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/SessionDescription.swift b/Sources/LiveKit/Types/SessionDescription.swift index 862f6f865..1459fadb6 100644 --- a/Sources/LiveKit/Types/SessionDescription.swift +++ b/Sources/LiveKit/Types/SessionDescription.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/SpeechActivityEvent.swift b/Sources/LiveKit/Types/SpeechActivityEvent.swift index 85ba4be2a..3fb1cfca2 100644 --- a/Sources/LiveKit/Types/SpeechActivityEvent.swift +++ b/Sources/LiveKit/Types/SpeechActivityEvent.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Statistics.swift b/Sources/LiveKit/Types/Statistics.swift index 2954d8117..351a104fc 100644 --- a/Sources/LiveKit/Types/Statistics.swift +++ b/Sources/LiveKit/Types/Statistics.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/Track+Types.swift b/Sources/LiveKit/Types/Track+Types.swift index 64c64c117..f2882ad98 100644 --- a/Sources/LiveKit/Types/Track+Types.swift +++ b/Sources/LiveKit/Types/Track+Types.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TrackSettings.swift b/Sources/LiveKit/Types/TrackSettings.swift index a2cccea05..6f58d0de6 100644 --- a/Sources/LiveKit/Types/TrackSettings.swift +++ b/Sources/LiveKit/Types/TrackSettings.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TrackSource.swift b/Sources/LiveKit/Types/TrackSource.swift index 79651c660..767217be9 100644 --- a/Sources/LiveKit/Types/TrackSource.swift +++ b/Sources/LiveKit/Types/TrackSource.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TrackStatistics.swift b/Sources/LiveKit/Types/TrackStatistics.swift index 1c36e7efc..b4372dd5f 100644 --- a/Sources/LiveKit/Types/TrackStatistics.swift +++ b/Sources/LiveKit/Types/TrackStatistics.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TrackStreamState.swift b/Sources/LiveKit/Types/TrackStreamState.swift index 85a5192ec..a83fa1046 100644 --- a/Sources/LiveKit/Types/TrackStreamState.swift +++ b/Sources/LiveKit/Types/TrackStreamState.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TrackType.swift b/Sources/LiveKit/Types/TrackType.swift index 0bd9a9974..a37a27d9b 100644 --- a/Sources/LiveKit/Types/TrackType.swift +++ b/Sources/LiveKit/Types/TrackType.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/TranscriptionSegment.swift b/Sources/LiveKit/Types/TranscriptionSegment.swift index 60c949edc..15f64a729 100644 --- a/Sources/LiveKit/Types/TranscriptionSegment.swift +++ b/Sources/LiveKit/Types/TranscriptionSegment.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoEncoding+Comparable.swift b/Sources/LiveKit/Types/VideoEncoding+Comparable.swift index 9b3b4523f..3f7d5fd52 100644 --- a/Sources/LiveKit/Types/VideoEncoding+Comparable.swift +++ b/Sources/LiveKit/Types/VideoEncoding+Comparable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoEncoding.swift b/Sources/LiveKit/Types/VideoEncoding.swift index 52860955e..b6aa56151 100644 --- a/Sources/LiveKit/Types/VideoEncoding.swift +++ b/Sources/LiveKit/Types/VideoEncoding.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoFrame.swift b/Sources/LiveKit/Types/VideoFrame.swift index d468a1b05..6563ed6a0 100644 --- a/Sources/LiveKit/Types/VideoFrame.swift +++ b/Sources/LiveKit/Types/VideoFrame.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoParameters+Comparable.swift b/Sources/LiveKit/Types/VideoParameters+Comparable.swift index c48cad3f7..4034388d2 100644 --- a/Sources/LiveKit/Types/VideoParameters+Comparable.swift +++ b/Sources/LiveKit/Types/VideoParameters+Comparable.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoParameters.swift b/Sources/LiveKit/Types/VideoParameters.swift index e98173d8f..02995a7fd 100644 --- a/Sources/LiveKit/Types/VideoParameters.swift +++ b/Sources/LiveKit/Types/VideoParameters.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoQuality.swift b/Sources/LiveKit/Types/VideoQuality.swift index 0721ccef0..553fe7801 100644 --- a/Sources/LiveKit/Types/VideoQuality.swift +++ b/Sources/LiveKit/Types/VideoQuality.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Types/VideoRotation.swift b/Sources/LiveKit/Types/VideoRotation.swift index 0d54c69e2..7da6a4f1e 100644 --- a/Sources/LiveKit/Types/VideoRotation.swift +++ b/Sources/LiveKit/Types/VideoRotation.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/VideoProcessors/BackgroundBlurVideoProcessor.swift b/Sources/LiveKit/VideoProcessors/BackgroundBlurVideoProcessor.swift index 6907dd1f5..3f9190fa3 100644 --- a/Sources/LiveKit/VideoProcessors/BackgroundBlurVideoProcessor.swift +++ b/Sources/LiveKit/VideoProcessors/BackgroundBlurVideoProcessor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Views/SampleBufferVideoRenderer.swift b/Sources/LiveKit/Views/SampleBufferVideoRenderer.swift index c79bca371..08ec0bdf2 100644 --- a/Sources/LiveKit/Views/SampleBufferVideoRenderer.swift +++ b/Sources/LiveKit/Views/SampleBufferVideoRenderer.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Views/VideoView+MulticastDelegate.swift b/Sources/LiveKit/Views/VideoView+MulticastDelegate.swift index e78dd9cc0..701021734 100644 --- a/Sources/LiveKit/Views/VideoView+MulticastDelegate.swift +++ b/Sources/LiveKit/Views/VideoView+MulticastDelegate.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Views/VideoView+PinchToZoom.swift b/Sources/LiveKit/Views/VideoView+PinchToZoom.swift index b8f855b5b..de1674b22 100644 --- a/Sources/LiveKit/Views/VideoView+PinchToZoom.swift +++ b/Sources/LiveKit/Views/VideoView+PinchToZoom.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Sources/LiveKit/Views/VideoView.swift b/Sources/LiveKit/Views/VideoView.swift index bbfe5eb0f..751269b71 100644 --- a/Sources/LiveKit/Views/VideoView.swift +++ b/Sources/LiveKit/Views/VideoView.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LKTestHost/LKTestHost/LKTestHostApp.swift b/Tests/LKTestHost/LKTestHost/LKTestHostApp.swift index 11c368f11..71827e399 100644 --- a/Tests/LKTestHost/LKTestHost/LKTestHostApp.swift +++ b/Tests/LKTestHost/LKTestHost/LKTestHostApp.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioEngineAvailability.swift b/Tests/LiveKitAudioTests/AudioEngineAvailability.swift index 618a2adab..1b142b9ae 100644 --- a/Tests/LiveKitAudioTests/AudioEngineAvailability.swift +++ b/Tests/LiveKitAudioTests/AudioEngineAvailability.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioEngineObserver.swift b/Tests/LiveKitAudioTests/AudioEngineObserver.swift index b1c2e68d9..100931224 100644 --- a/Tests/LiveKitAudioTests/AudioEngineObserver.swift +++ b/Tests/LiveKitAudioTests/AudioEngineObserver.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioEnginePermission.swift b/Tests/LiveKitAudioTests/AudioEnginePermission.swift index 5a35ffb01..70de783a1 100644 --- a/Tests/LiveKitAudioTests/AudioEnginePermission.swift +++ b/Tests/LiveKitAudioTests/AudioEnginePermission.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioEngineTests.swift b/Tests/LiveKitAudioTests/AudioEngineTests.swift index 8620670f6..3dad2d01d 100644 --- a/Tests/LiveKitAudioTests/AudioEngineTests.swift +++ b/Tests/LiveKitAudioTests/AudioEngineTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioManagerTests.swift b/Tests/LiveKitAudioTests/AudioManagerTests.swift index 2f8dd3cd2..38f7af83d 100644 --- a/Tests/LiveKitAudioTests/AudioManagerTests.swift +++ b/Tests/LiveKitAudioTests/AudioManagerTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioProcessingLifecycle.swift b/Tests/LiveKitAudioTests/AudioProcessingLifecycle.swift index 5c18c46c0..9522c2aa1 100644 --- a/Tests/LiveKitAudioTests/AudioProcessingLifecycle.swift +++ b/Tests/LiveKitAudioTests/AudioProcessingLifecycle.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/AudioProcessingTests.swift b/Tests/LiveKitAudioTests/AudioProcessingTests.swift index c7502fc9c..830ac059c 100644 --- a/Tests/LiveKitAudioTests/AudioProcessingTests.swift +++ b/Tests/LiveKitAudioTests/AudioProcessingTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/DeviceManager.swift b/Tests/LiveKitAudioTests/DeviceManager.swift index 5d463abf8..c2031a184 100644 --- a/Tests/LiveKitAudioTests/DeviceManager.swift +++ b/Tests/LiveKitAudioTests/DeviceManager.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/LocalAudioTrackRecorderTests.swift b/Tests/LiveKitAudioTests/LocalAudioTrackRecorderTests.swift index da9f2f7fa..0af0c1ff3 100644 --- a/Tests/LiveKitAudioTests/LocalAudioTrackRecorderTests.swift +++ b/Tests/LiveKitAudioTests/LocalAudioTrackRecorderTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/MuteTests.swift b/Tests/LiveKitAudioTests/MuteTests.swift index 86b6c4078..06a7d6917 100644 --- a/Tests/LiveKitAudioTests/MuteTests.swift +++ b/Tests/LiveKitAudioTests/MuteTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/PreConnectAudioBufferTests.swift b/Tests/LiveKitAudioTests/PreConnectAudioBufferTests.swift index 3a28bf3cc..d4bbce92c 100644 --- a/Tests/LiveKitAudioTests/PreConnectAudioBufferTests.swift +++ b/Tests/LiveKitAudioTests/PreConnectAudioBufferTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/PublishDeviceOptimization.swift b/Tests/LiveKitAudioTests/PublishDeviceOptimization.swift index 5c8126f2b..a5f96d990 100644 --- a/Tests/LiveKitAudioTests/PublishDeviceOptimization.swift +++ b/Tests/LiveKitAudioTests/PublishDeviceOptimization.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/PublishMicrophoneTests.swift b/Tests/LiveKitAudioTests/PublishMicrophoneTests.swift index 2f4822f68..4a240db6a 100644 --- a/Tests/LiveKitAudioTests/PublishMicrophoneTests.swift +++ b/Tests/LiveKitAudioTests/PublishMicrophoneTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/SinWaveSourceNode.swift b/Tests/LiveKitAudioTests/SinWaveSourceNode.swift index 258a720b3..99e9e9d39 100644 --- a/Tests/LiveKitAudioTests/SinWaveSourceNode.swift +++ b/Tests/LiveKitAudioTests/SinWaveSourceNode.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitAudioTests/TestAudioRecorder.swift b/Tests/LiveKitAudioTests/TestAudioRecorder.swift index a89c51940..13dfdb9f1 100644 --- a/Tests/LiveKitAudioTests/TestAudioRecorder.swift +++ b/Tests/LiveKitAudioTests/TestAudioRecorder.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMBufferTests.swift b/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMBufferTests.swift index 3dd280fca..a675b3beb 100644 --- a/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMBufferTests.swift +++ b/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMBufferTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMRingBufferTests.swift b/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMRingBufferTests.swift index a3cfca2ff..3a632cccf 100644 --- a/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMRingBufferTests.swift +++ b/Tests/LiveKitCoreTests/AVFoundation/AVAudioPCMRingBufferTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/AVFoundation/AudioConverterTests.swift b/Tests/LiveKitCoreTests/AVFoundation/AudioConverterTests.swift index 1b23ba0b1..ac3238f82 100644 --- a/Tests/LiveKitCoreTests/AVFoundation/AudioConverterTests.swift +++ b/Tests/LiveKitCoreTests/AVFoundation/AudioConverterTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/AVFoundation/AudioMixRecorderTests.swift b/Tests/LiveKitCoreTests/AVFoundation/AudioMixRecorderTests.swift index bc6a7ba8a..0a6d534f5 100644 --- a/Tests/LiveKitCoreTests/AVFoundation/AudioMixRecorderTests.swift +++ b/Tests/LiveKitCoreTests/AVFoundation/AudioMixRecorderTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Agent/TranscriptionTests.swift b/Tests/LiveKitCoreTests/Agent/TranscriptionTests.swift index 33713d152..6a1f81610 100644 --- a/Tests/LiveKitCoreTests/Agent/TranscriptionTests.swift +++ b/Tests/LiveKitCoreTests/Agent/TranscriptionTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ class TranscriptionTests: LKTestCase, @unchecked Sendable { private var receiver: TranscriptionStreamReceiver! private var senderRoom: Room! private var messageCollector: MessageCollector! - private var collectionTask: Task! + private var collectionTask: AnyTaskCancellable! private var messageExpectation: XCTestExpectation! // Same segment, same stream @@ -84,12 +84,9 @@ class TranscriptionTests: LKTestCase, @unchecked Sendable { messageCollector = MessageCollector() senderRoom = rooms[1] - collectionTask = Task { @Sendable in - var iterator = messageStream.makeAsyncIterator() - while let message = await iterator.next() { - await self.messageCollector.add(message) - self.messageExpectation.fulfill() - } + collectionTask = messageStream.subscribe(self) { observer, message in + await observer.messageCollector.add(message) + observer.messageExpectation.fulfill() } } diff --git a/Tests/LiveKitCoreTests/AsyncFileStreamTests.swift b/Tests/LiveKitCoreTests/AsyncFileStreamTests.swift index c1e053a13..6be2e9802 100644 --- a/Tests/LiveKitCoreTests/AsyncFileStreamTests.swift +++ b/Tests/LiveKitCoreTests/AsyncFileStreamTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/AsyncRetryTests.swift b/Tests/LiveKitCoreTests/AsyncRetryTests.swift index a08ac58ef..f3122ffe3 100644 --- a/Tests/LiveKitCoreTests/AsyncRetryTests.swift +++ b/Tests/LiveKitCoreTests/AsyncRetryTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Broadcast/BroadcastAudioCodecTests.swift b/Tests/LiveKitCoreTests/Broadcast/BroadcastAudioCodecTests.swift index d7f05826a..b7dacb173 100644 --- a/Tests/LiveKitCoreTests/Broadcast/BroadcastAudioCodecTests.swift +++ b/Tests/LiveKitCoreTests/Broadcast/BroadcastAudioCodecTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Broadcast/BroadcastImageCodecTests.swift b/Tests/LiveKitCoreTests/Broadcast/BroadcastImageCodecTests.swift index bd56304c7..d2da512af 100644 --- a/Tests/LiveKitCoreTests/Broadcast/BroadcastImageCodecTests.swift +++ b/Tests/LiveKitCoreTests/Broadcast/BroadcastImageCodecTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Broadcast/IPCChannelTests.swift b/Tests/LiveKitCoreTests/Broadcast/IPCChannelTests.swift index f3b68aa94..95342d710 100644 --- a/Tests/LiveKitCoreTests/Broadcast/IPCChannelTests.swift +++ b/Tests/LiveKitCoreTests/Broadcast/IPCChannelTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Broadcast/SocketPathTests.swift b/Tests/LiveKitCoreTests/Broadcast/SocketPathTests.swift index 4308ca4b7..ce6fab2cf 100644 --- a/Tests/LiveKitCoreTests/Broadcast/SocketPathTests.swift +++ b/Tests/LiveKitCoreTests/Broadcast/SocketPathTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/BroadcastManagerTests.swift b/Tests/LiveKitCoreTests/BroadcastManagerTests.swift index 777bc430c..97896d7ee 100644 --- a/Tests/LiveKitCoreTests/BroadcastManagerTests.swift +++ b/Tests/LiveKitCoreTests/BroadcastManagerTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/CodecTests.swift b/Tests/LiveKitCoreTests/CodecTests.swift index 11e81c883..1deaf7242 100644 --- a/Tests/LiveKitCoreTests/CodecTests.swift +++ b/Tests/LiveKitCoreTests/CodecTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/CompleterTests.swift b/Tests/LiveKitCoreTests/CompleterTests.swift index 58102011f..617f51034 100644 --- a/Tests/LiveKitCoreTests/CompleterTests.swift +++ b/Tests/LiveKitCoreTests/CompleterTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DarwinNotificationCenterTests.swift b/Tests/LiveKitCoreTests/DarwinNotificationCenterTests.swift index 8d1eafb64..206aa29fd 100644 --- a/Tests/LiveKitCoreTests/DarwinNotificationCenterTests.swift +++ b/Tests/LiveKitCoreTests/DarwinNotificationCenterTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataChannel/EncryptedDataChannelTests.swift b/Tests/LiveKitCoreTests/DataChannel/EncryptedDataChannelTests.swift index 210244a40..f7e08bc5a 100644 --- a/Tests/LiveKitCoreTests/DataChannel/EncryptedDataChannelTests.swift +++ b/Tests/LiveKitCoreTests/DataChannel/EncryptedDataChannelTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataChannel/RealiableDataChannelTests.swift b/Tests/LiveKitCoreTests/DataChannel/RealiableDataChannelTests.swift index 4671dbd85..6c6b47f7f 100644 --- a/Tests/LiveKitCoreTests/DataChannel/RealiableDataChannelTests.swift +++ b/Tests/LiveKitCoreTests/DataChannel/RealiableDataChannelTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/ByteStreamInfoTests.swift b/Tests/LiveKitCoreTests/DataStream/ByteStreamInfoTests.swift index 91a951698..7a323081d 100644 --- a/Tests/LiveKitCoreTests/DataStream/ByteStreamInfoTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/ByteStreamInfoTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/ByteStreamReaderTests.swift b/Tests/LiveKitCoreTests/DataStream/ByteStreamReaderTests.swift index c49585cf8..28d895a5d 100644 --- a/Tests/LiveKitCoreTests/DataStream/ByteStreamReaderTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/ByteStreamReaderTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/DataStreamTests.swift b/Tests/LiveKitCoreTests/DataStream/DataStreamTests.swift index df65e717c..9e1759070 100644 --- a/Tests/LiveKitCoreTests/DataStream/DataStreamTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/DataStreamTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/FileInfoTests.swift b/Tests/LiveKitCoreTests/DataStream/FileInfoTests.swift index d53741cef..f31347568 100644 --- a/Tests/LiveKitCoreTests/DataStream/FileInfoTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/FileInfoTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/IncomingStreamManagerTests.swift b/Tests/LiveKitCoreTests/DataStream/IncomingStreamManagerTests.swift index 2469c3d80..6b66c8b99 100644 --- a/Tests/LiveKitCoreTests/DataStream/IncomingStreamManagerTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/IncomingStreamManagerTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/OutgoingStreamManagerTests.swift b/Tests/LiveKitCoreTests/DataStream/OutgoingStreamManagerTests.swift index 4f5ab78f3..aae8e0b40 100644 --- a/Tests/LiveKitCoreTests/DataStream/OutgoingStreamManagerTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/OutgoingStreamManagerTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/StreamDataTests.swift b/Tests/LiveKitCoreTests/DataStream/StreamDataTests.swift index 10f0a45fc..401b4f419 100644 --- a/Tests/LiveKitCoreTests/DataStream/StreamDataTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/StreamDataTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/TextStreamInfoTests.swift b/Tests/LiveKitCoreTests/DataStream/TextStreamInfoTests.swift index 04cc795b1..977ae024b 100644 --- a/Tests/LiveKitCoreTests/DataStream/TextStreamInfoTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/TextStreamInfoTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/DataStream/TextStreamReaderTests.swift b/Tests/LiveKitCoreTests/DataStream/TextStreamReaderTests.swift index 2f5a0ec9a..269c6e83d 100644 --- a/Tests/LiveKitCoreTests/DataStream/TextStreamReaderTests.swift +++ b/Tests/LiveKitCoreTests/DataStream/TextStreamReaderTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/E2EE/Thread.swift b/Tests/LiveKitCoreTests/E2EE/Thread.swift index 7bd4d70ed..73792c80a 100644 --- a/Tests/LiveKitCoreTests/E2EE/Thread.swift +++ b/Tests/LiveKitCoreTests/E2EE/Thread.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Extensions/StringTests.swift b/Tests/LiveKitCoreTests/Extensions/StringTests.swift index bdfc63008..3ee5a67e5 100644 --- a/Tests/LiveKitCoreTests/Extensions/StringTests.swift +++ b/Tests/LiveKitCoreTests/Extensions/StringTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/FunctionTests.swift b/Tests/LiveKitCoreTests/FunctionTests.swift index b9c8f8a13..6876a675b 100644 --- a/Tests/LiveKitCoreTests/FunctionTests.swift +++ b/Tests/LiveKitCoreTests/FunctionTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/ObjCHelpersTests.swift b/Tests/LiveKitCoreTests/ObjCHelpersTests.swift index 5105b6043..9e29b0a21 100644 --- a/Tests/LiveKitCoreTests/ObjCHelpersTests.swift +++ b/Tests/LiveKitCoreTests/ObjCHelpersTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Participant/RemoteParticipantTests.swift b/Tests/LiveKitCoreTests/Participant/RemoteParticipantTests.swift index 9acffdf45..71597751e 100644 --- a/Tests/LiveKitCoreTests/Participant/RemoteParticipantTests.swift +++ b/Tests/LiveKitCoreTests/Participant/RemoteParticipantTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/ParticipantTests.swift b/Tests/LiveKitCoreTests/ParticipantTests.swift index ea067ea5e..d272ff062 100644 --- a/Tests/LiveKitCoreTests/ParticipantTests.swift +++ b/Tests/LiveKitCoreTests/ParticipantTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Proto/ProtoConverterTests.swift b/Tests/LiveKitCoreTests/Proto/ProtoConverterTests.swift index 3898480fb..39d34690a 100644 --- a/Tests/LiveKitCoreTests/Proto/ProtoConverterTests.swift +++ b/Tests/LiveKitCoreTests/Proto/ProtoConverterTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/PublishBufferCapturerTests.swift b/Tests/LiveKitCoreTests/PublishBufferCapturerTests.swift index 536a55691..d74ea1087 100644 --- a/Tests/LiveKitCoreTests/PublishBufferCapturerTests.swift +++ b/Tests/LiveKitCoreTests/PublishBufferCapturerTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/PublishDataTests.swift b/Tests/LiveKitCoreTests/PublishDataTests.swift index 58c5205dd..7b1ac97a2 100644 --- a/Tests/LiveKitCoreTests/PublishDataTests.swift +++ b/Tests/LiveKitCoreTests/PublishDataTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/PublishTrackTests.swift b/Tests/LiveKitCoreTests/PublishTrackTests.swift index f85dde6a3..4e5a4df11 100644 --- a/Tests/LiveKitCoreTests/PublishTrackTests.swift +++ b/Tests/LiveKitCoreTests/PublishTrackTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/QueueActorTests.swift b/Tests/LiveKitCoreTests/QueueActorTests.swift index 5b8febfbe..0d13c105e 100644 --- a/Tests/LiveKitCoreTests/QueueActorTests.swift +++ b/Tests/LiveKitCoreTests/QueueActorTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Room/RoomTests.swift b/Tests/LiveKitCoreTests/Room/RoomTests.swift index 48eb311b9..365443c6a 100644 --- a/Tests/LiveKitCoreTests/Room/RoomTests.swift +++ b/Tests/LiveKitCoreTests/Room/RoomTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,37 @@ class RoomTests: LKTestCase, @unchecked Sendable { try await withRooms([RoomTestingOptions()]) { rooms in let room = rooms[0] + self.noLeaks(of: room.signalClient) let socket = await room.signalClient._state.socket - self.noLeaks(of: socket!) + try self.noLeaks(of: XCTUnwrap(socket)) + + let (publisher, subscriber) = room._state.read { ($0.publisher, $0.subscriber) } + if let publisher { self.noLeaks(of: publisher) } + if let subscriber { self.noLeaks(of: subscriber) } + + self.noLeaks(of: room.publisherDataChannel) + self.noLeaks(of: room.subscriberDataChannel) + + self.noLeaks(of: room.incomingStreamManager) + self.noLeaks(of: room.outgoingStreamManager) + + if let e2eeManager = room.e2eeManager { self.noLeaks(of: e2eeManager) } + self.noLeaks(of: room.preConnectBuffer) + self.noLeaks(of: room.rpcState) + self.noLeaks(of: room.metricsManager) + + self.noLeaks(of: room.delegates) + self.noLeaks(of: room.activeParticipantCompleters) + self.noLeaks(of: room.primaryTransportConnectedCompleter) + self.noLeaks(of: room.publisherTransportConnectedCompleter) + + self.noLeaks(of: room.localParticipant) + for remoteParticipant in room.remoteParticipants.values { + self.noLeaks(of: remoteParticipant) + } + + self.noLeaks(of: room._state) + self.noLeaks(of: room) } } diff --git a/Tests/LiveKitCoreTests/RpcTests.swift b/Tests/LiveKitCoreTests/RpcTests.swift index 3b5a12865..acc4f9aa7 100644 --- a/Tests/LiveKitCoreTests/RpcTests.swift +++ b/Tests/LiveKitCoreTests/RpcTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/SDKTests.swift b/Tests/LiveKitCoreTests/SDKTests.swift index eafef7303..7f25a3d51 100644 --- a/Tests/LiveKitCoreTests/SDKTests.swift +++ b/Tests/LiveKitCoreTests/SDKTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/SerialRunnerActor.swift b/Tests/LiveKitCoreTests/SerialRunnerActor.swift index 13a5b3426..0e66bd535 100644 --- a/Tests/LiveKitCoreTests/SerialRunnerActor.swift +++ b/Tests/LiveKitCoreTests/SerialRunnerActor.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/TTLDictionaryTests.swift b/Tests/LiveKitCoreTests/TTLDictionaryTests.swift index ed2be775c..00a62ca66 100644 --- a/Tests/LiveKitCoreTests/TTLDictionaryTests.swift +++ b/Tests/LiveKitCoreTests/TTLDictionaryTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/TaskObserveTests.swift b/Tests/LiveKitCoreTests/TaskObserveTests.swift new file mode 100644 index 000000000..fa5f66565 --- /dev/null +++ b/Tests/LiveKitCoreTests/TaskObserveTests.swift @@ -0,0 +1,128 @@ +/* + * Copyright 2026 LiveKit + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@testable import LiveKit +#if canImport(LiveKitTestSupport) +import LiveKitTestSupport +#endif + +// MARK: - Test Observer + +actor TestObserver { + let id: String + private(set) var processedItems: [Int] = [] + + init(id: String = "test") { + self.id = id + } + + func recordItem(_ item: Int) { + processedItems.append(item) + } +} + +// MARK: - Tests + +class TaskObserveTests: LKTestCase { + func testStreamProcessesAllElements() async throws { + let observer = TestObserver() + let stream = AsyncStream { continuation in + for i in 1 ... 5 { + continuation.yield(i) + } + continuation.finish() + } + + _ = stream.subscribe(observer) { observer, element in + await observer.recordItem(element) + } + + try await Task.sleep(nanoseconds: 100_000_000) + + let items = await observer.processedItems + XCTAssertEqual(items, [1, 2, 3, 4, 5]) + } + + func testStreamBreaksWhenObserverDeallocates() async throws { + var observer: TestObserver? = TestObserver(id: "dealloc-test") + weak var weakObserver = observer + + let (stream, continuation) = AsyncStream.makeStream(of: Int.self) + + _ = stream.subscribe(observer!) { observer, element in + await observer.recordItem(element) + } + + continuation.yield(1) + continuation.yield(2) + try await Task.sleep(nanoseconds: 50_000_000) + + let itemsBeforeDealloc = await observer?.processedItems + XCTAssertEqual(itemsBeforeDealloc, [1, 2]) + + observer = nil + + try await Task.sleep(nanoseconds: 50_000_000) + + XCTAssertNil(weakObserver, "Observer should have been deallocated") + weakObserver = nil + + continuation.yield(3) + continuation.yield(4) + try await Task.sleep(nanoseconds: 50_000_000) + } + + func testStreamCancellation() async throws { + let observer = TestObserver() + let (stream, continuation) = AsyncStream.makeStream(of: Int.self) + + let task = stream.subscribe(observer) { observer, element in + await observer.recordItem(element) + } + + continuation.yield(1) + try await Task.sleep(nanoseconds: 50_000_000) + + let itemsBeforeCancel = await observer.processedItems + XCTAssertEqual(itemsBeforeCancel, [1]) + + task.cancel() + + continuation.yield(2) + try await Task.sleep(nanoseconds: 50_000_000) + + let itemsAfterCancel = await observer.processedItems + XCTAssertTrue(itemsAfterCancel.count <= 2) + } + + func testStreamFinishEndsTask() async throws { + let observer = TestObserver() + let (stream, continuation) = AsyncStream.makeStream(of: Int.self) + + _ = stream.subscribe(observer) { observer, element in + await observer.recordItem(element) + } + + continuation.yield(1) + continuation.yield(2) + continuation.finish() + + try await Task.sleep(nanoseconds: 100_000_000) + + let items = await observer.processedItems + XCTAssertEqual(items, [1, 2]) + } +} diff --git a/Tests/LiveKitCoreTests/ThreadSafetyTests.swift b/Tests/LiveKitCoreTests/ThreadSafetyTests.swift index c0050032e..fc4f6ce13 100644 --- a/Tests/LiveKitCoreTests/ThreadSafetyTests.swift +++ b/Tests/LiveKitCoreTests/ThreadSafetyTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/TimeIntervalTests.swift b/Tests/LiveKitCoreTests/TimeIntervalTests.swift index d81ab0eb1..4767ab778 100644 --- a/Tests/LiveKitCoreTests/TimeIntervalTests.swift +++ b/Tests/LiveKitCoreTests/TimeIntervalTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Token/TokenSourceTests.swift b/Tests/LiveKitCoreTests/Token/TokenSourceTests.swift index 854a25213..9871abed2 100644 --- a/Tests/LiveKitCoreTests/Token/TokenSourceTests.swift +++ b/Tests/LiveKitCoreTests/Token/TokenSourceTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitCoreTests/Track/TrackTests.swift b/Tests/LiveKitCoreTests/Track/TrackTests.swift index 84042b878..097a37360 100644 --- a/Tests/LiveKitCoreTests/Track/TrackTests.swift +++ b/Tests/LiveKitCoreTests/Track/TrackTests.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/Assertions.swift b/Tests/LiveKitTestSupport/Assertions.swift index 7546a949e..f463ad17b 100644 --- a/Tests/LiveKitTestSupport/Assertions.swift +++ b/Tests/LiveKitTestSupport/Assertions.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/Backports.swift b/Tests/LiveKitTestSupport/Backports.swift index dcee81b3f..6e9525f00 100644 --- a/Tests/LiveKitTestSupport/Backports.swift +++ b/Tests/LiveKitTestSupport/Backports.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/ConcurrentCounter.swift b/Tests/LiveKitTestSupport/ConcurrentCounter.swift index 9ae2f199a..24ebdaf51 100644 --- a/Tests/LiveKitTestSupport/ConcurrentCounter.swift +++ b/Tests/LiveKitTestSupport/ConcurrentCounter.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/LKTestCase.swift b/Tests/LiveKitTestSupport/LKTestCase.swift index 20f26adb4..bc2a4c7f8 100644 --- a/Tests/LiveKitTestSupport/LKTestCase.swift +++ b/Tests/LiveKitTestSupport/LKTestCase.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/MockDataChannelPair.swift b/Tests/LiveKitTestSupport/MockDataChannelPair.swift index 1fe2b0f2c..0067d6eda 100644 --- a/Tests/LiveKitTestSupport/MockDataChannelPair.swift +++ b/Tests/LiveKitTestSupport/MockDataChannelPair.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/Room.swift b/Tests/LiveKitTestSupport/Room.swift index 9b8ef3747..d910f18c1 100644 --- a/Tests/LiveKitTestSupport/Room.swift +++ b/Tests/LiveKitTestSupport/Room.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/TokenGenerator.swift b/Tests/LiveKitTestSupport/TokenGenerator.swift index 02df2d8c4..0cef096a7 100644 --- a/Tests/LiveKitTestSupport/TokenGenerator.swift +++ b/Tests/LiveKitTestSupport/TokenGenerator.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/Tests/LiveKitTestSupport/Tracks.swift b/Tests/LiveKitTestSupport/Tracks.swift index bf48f3b07..f8ea9cffd 100644 --- a/Tests/LiveKitTestSupport/Tracks.swift +++ b/Tests/LiveKitTestSupport/Tracks.swift @@ -1,5 +1,5 @@ /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/scripts/create_version.swift b/scripts/create_version.swift index 200f7b562..09397fd66 100755 --- a/scripts/create_version.swift +++ b/scripts/create_version.swift @@ -1,7 +1,7 @@ #!/usr/bin/env swift /* - * Copyright 2025 LiveKit + * Copyright 2026 LiveKit * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.