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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changes/screensharing-vp9
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patch type="fixed" "Screen sharing not publishing frames with VP9/AV1 codecs"
3 changes: 2 additions & 1 deletion Sources/LiveKit/Support/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ class Utils: Loggable {
if let videoCodec, videoCodec.isSVC {
// SVC mode
log("Using SVC mode")
return [RTC.createRtpEncodingParameters(encoding: encoding, scalabilityMode: .L3T3_KEY)]
// VP9/AV1 with screen sharing requires single spatial layer
return [RTC.createRtpEncodingParameters(encoding: encoding, scalabilityMode: isScreenShare ? .L1T3 : .L3T3_KEY)]
} else if !publishOptions.simulcast {
// Not-simulcast mode
log("Simulcast not enabled")
Expand Down
10 changes: 9 additions & 1 deletion Sources/LiveKit/Types/ScalabilityMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ public enum ScalabilityMode: Int {
case L3T3 = 1
case L3T3_KEY = 2
case L3T3_KEY_SHIFT = 3
case L1T3 = 4
}

public extension ScalabilityMode {
static func fromString(_ rawString: String?) -> ScalabilityMode? {
switch rawString {
case "L1T3": .L1T3
case "L3T3": .L3T3
case "L3T3_KEY": .L3T3_KEY
case "L3T3_KEY_SHIFT": .L3T3_KEY_SHIFT
Expand All @@ -35,13 +37,19 @@ public extension ScalabilityMode {

var rawStringValue: String {
switch self {
case .L1T3: "L1T3"
case .L3T3: "L3T3"
case .L3T3_KEY: "L3T3_KEY"
case .L3T3_KEY_SHIFT: "L3T3_KEY_SHIFT"
}
}

var spatial: Int { 3 }
var spatial: Int {
switch self {
case .L1T3: 1
case .L3T3, .L3T3_KEY, .L3T3_KEY_SHIFT: 3
}
}

var temporal: Int { 3 }
}
Expand Down
Loading