Cache local candidates till local description is sent (#908)

This commit is contained in:
Raja Subramanian
2022-08-12 12:31:26 +05:30
committed by GitHub
parent 641f8d4519
commit 692c4d804f
4 changed files with 92 additions and 19 deletions
+9
View File
@@ -173,6 +173,10 @@ func (t *TransportManager) GetPublisherRTPReceiver(mid string) *webrtc.RTPReceiv
return t.publisher.GetRTPReceiver(mid)
}
func (t *TransportManager) SetPublisherLocalDescriptionSent(sent bool) {
t.publisher.SetLocalDescriptionSent(sent)
}
func (t *TransportManager) WritePublisherRTCP(pkts []rtcp.Packet) error {
return t.publisher.WriteRTCP(pkts)
}
@@ -197,6 +201,10 @@ func (t *TransportManager) OnSubscriberStreamStateChange(f func(update *sfu.Stre
t.subscriber.OnStreamStateChange(f)
}
func (t *TransportManager) SetSubscriberLocalDescriptionSent(sent bool) {
t.subscriber.SetLocalDescriptionSent(sent)
}
func (t *TransportManager) HasSubscriberEverConnected() bool {
return t.subscriber.HasEverConnected()
}
@@ -367,6 +375,7 @@ func (t *TransportManager) ICERestart(iceConfig *types.IceConfig) error {
t.SetICEConfig(*iceConfig)
}
t.subscriber.SetLocalDescriptionSent(false)
return t.subscriber.CreateAndSendOffer(&webrtc.OfferOptions{
ICERestart: true,
})