Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions NextcloudTalk/Calls/NCCallController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 3 additions & 1 deletion NextcloudTalk/WebRTC/WebRTCCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
])

Expand Down
Loading