mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 19:43:01 +00:00
SVC with RID -> spatial layer mapping (#3754)
* SVC with RID -> spatial layer mapping There are cases where an SVC track comes in with a RID. As there is no RID announced in SDP, it maps to invalid layer. Seems to happen with older browsers. * test
This commit is contained in:
1 parent
c481396f5b
commit
01bf96855d
3 files changed
+29
-7
No files matched your search
@@ -351,6 +351,19 @@ func GetSpatialLayerForRid(rid string, ti *livekit.TrackInfo) int32 {
|
||||
if len(ti.Layers) == 1 {
|
||||
// single layer without RID
|
||||
return 0
|
||||
} else if len(ti.Layers) > 1 {
|
||||
// RID present in codec, but not specified via signalling
|
||||
// (happens with older browsers setting a rid for SVC codecs)
|
||||
hasRid := false
|
||||
for _, layer := range ti.Layers {
|
||||
if layer.Rid != "" {
|
||||
hasRid = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !hasRid {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
return InvalidLayerSpatial
|
||||
|
||||
Reference in new issue
Block a user