Normalize known rids. (#3779)

Normalize the rids in SDP to known patterns.
Currently,
- LK protocol uses q;h;f
- Sean's OBS WHIP uses 0;1;2

As the ordering in SDP could be different, normalize to known order.

For RIDs not in the known set, just use it as is.
This commit is contained in:
Raja Subramanian
2025-07-06 13:32:21 +05:30
committed by GitHub
parent ddd923296b
commit 40028dc33c
3 changed files with 205 additions and 106 deletions
+1 -4
View File
@@ -993,10 +993,6 @@ func (p *ParticipantImpl) synthesizeAddTrackRequests(offer webrtc.SessionDescrip
}
func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) {
if !p.params.UseOneShotSignallingMode {
return
}
if offer == nil {
return
}
@@ -1033,6 +1029,7 @@ func (p *ParticipantImpl) updateRidsFromSDP(offer *webrtc.SessionDescription) {
for i := n; i < len(pti.sdpRids); i++ {
pti.sdpRids[i] = ""
}
pti.sdpRids = buffer.NormalizeVideoLayersRid(pti.sdpRids)
p.pubLogger.Debugw(
"pending track rids updated",