From 58454b550065ef723d8eeb0e0106949521e00d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Fri, 9 Oct 2026 17:04:11 +0200 Subject: [PATCH] fix: Send all 3 simulcast layers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assisted-by: ClaudeCode:claude-opus-5.5 Signed-off-by: Marcel Müller --- NextcloudTalk/Calls/NCCallController.swift | 6 ++---- NextcloudTalk/WebRTC/WebRTCCommon.swift | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NextcloudTalk/Calls/NCCallController.swift b/NextcloudTalk/Calls/NCCallController.swift index afce1f0e4..ff952d032 100644 --- a/NextcloudTalk/Calls/NCCallController.swift +++ b/NextcloudTalk/Calls/NCCallController.swift @@ -1279,19 +1279,17 @@ internal class NCCallController: NSObject, NCPeerConnectionDelegate, NCSignaling // Same layers as web, but ordered from lowest to highest as the VP8 encoder requires private func simulcastSendEncodings() -> [RTCRtpEncodingParameters] { return [ - // Announced but not sent, keeps web's substream indices, the MCU falls back to medium - self.simulcastEncoding(rid: "l", scaleResolutionDownBy: 4, maxBitrateBps: 100_000, isActive: false), + self.simulcastEncoding(rid: "l", scaleResolutionDownBy: 4, maxBitrateBps: 100_000), self.simulcastEncoding(rid: "m", scaleResolutionDownBy: 2, maxBitrateBps: 300_000), self.simulcastEncoding(rid: "h", scaleResolutionDownBy: 1, maxBitrateBps: 900_000) ] } - private func simulcastEncoding(rid: String, scaleResolutionDownBy: Double, maxBitrateBps: Int, isActive: Bool = true) -> RTCRtpEncodingParameters { + private func simulcastEncoding(rid: String, scaleResolutionDownBy: Double, maxBitrateBps: Int) -> RTCRtpEncodingParameters { let encoding = RTCRtpEncodingParameters() encoding.rid = rid encoding.scaleResolutionDownBy = NSNumber(value: scaleResolutionDownBy) encoding.maxBitrateBps = NSNumber(value: maxBitrateBps) - encoding.isActive = isActive return encoding } diff --git a/NextcloudTalk/WebRTC/WebRTCCommon.swift b/NextcloudTalk/WebRTC/WebRTCCommon.swift index 06af00223..7441f415a 100644 --- a/NextcloudTalk/WebRTC/WebRTCCommon.swift +++ b/NextcloudTalk/WebRTC/WebRTCCommon.swift @@ -14,7 +14,9 @@ import Foundation // Ref https://issues.webrtc.org/issues/502461765 RTCInitFieldTrialDictionary([ kRTCFieldTrialUseNWPathMonitor: kRTCFieldTrialEnabledValue, - // Otherwise the highest simulcast layer is dropped for resolutions up to 640x480 + // Otherwise upper simulcast layers are dropped below 960x540. A legacy cap (webrtc:8785), only kept on by + // default for hardware encoders (webrtc:10849), our simulcast only runs on the libvpx software encoder + // and sets all layers explicitly. "WebRTC-LegacySimulcastLayerLimit": "Disabled" ])