implement trickle and negotiate paths

This commit is contained in:
David Zhao
2020-10-31 00:36:35 -07:00
parent 54b59f00e2
commit 9a36a41800
2 changed files with 77 additions and 5 deletions
+19 -1
View File
@@ -6,9 +6,27 @@ import (
"github.com/livekit/livekit-server/proto/livekit"
)
func ToProtoSessionDescription(sd *webrtc.SessionDescription) *livekit.SessionDescription {
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
return &livekit.SessionDescription{
Type: sd.Type.String(),
Sdp: sd.SDP,
}
}
func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription {
var sdType webrtc.SDPType
switch sd.Type {
case webrtc.SDPTypeOffer.String():
sdType = webrtc.SDPTypeOffer
case webrtc.SDPTypeAnswer.String():
sdType = webrtc.SDPTypeAnswer
case webrtc.SDPTypePranswer.String():
sdType = webrtc.SDPTypePranswer
case webrtc.SDPTypeRollback.String():
sdType = webrtc.SDPTypeRollback
}
return webrtc.SessionDescription{
Type: sdType,
SDP: sd.Sdp,
}
}