Add Id to SDP signalling messages. (#3722)

* Add Id to SDP signalling messages.

Allows matching up offer/answer.
For now, the subscriber answer just logs if there is a mismatch.

* correct variable name

* test

* fixing rid

* revert

* clean up
This commit is contained in:
Raja Subramanian
2025-06-12 14:39:25 -07:00
committed by GitHub
parent 4ec828ce00
commit a9e2911645
14 changed files with 194 additions and 123 deletions
+4 -3
View File
@@ -80,14 +80,15 @@ func UnpackDataTrackLabel(packed string) (participantID livekit.ParticipantID, t
return
}
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
func ToProtoSessionDescription(sd webrtc.SessionDescription, id uint32) *livekit.SessionDescription {
return &livekit.SessionDescription{
Type: sd.Type.String(),
Sdp: sd.SDP,
Id: id,
}
}
func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription {
func FromProtoSessionDescription(sd *livekit.SessionDescription) (webrtc.SessionDescription, uint32) {
var sdType webrtc.SDPType
switch sd.Type {
case webrtc.SDPTypeOffer.String():
@@ -102,7 +103,7 @@ func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionD
return webrtc.SessionDescription{
Type: sdType,
SDP: sd.Sdp,
}
}, sd.Id
}
func ToProtoTrickle(candidateInit webrtc.ICECandidateInit, target livekit.SignalTarget, final bool) *livekit.TrickleRequest {