Add flag to control candidate fallback when udp unstable (#1630)

* Add flag to control candidate fallback when udp unstable

* Don't close rtcpreader if downtrack will be resumed
This commit is contained in:
cnderrauber
2023-04-19 14:56:16 +08:00
committed by GitHub
parent 4bd0646fdc
commit ab42aed360
2 changed files with 34 additions and 31 deletions
+2
View File
@@ -81,6 +81,7 @@ type ParticipantParams struct {
AdaptiveStream bool
AllowTCPFallback bool
TCPFallbackRTTThreshold int
AllowUDPUnstableFallback bool
TURNSEnabled bool
GetParticipantInfo func(pID livekit.ParticipantID) *livekit.ParticipantInfo
ReconnectOnPublicationError bool
@@ -989,6 +990,7 @@ func (p *ParticipantImpl) setupTransportManager() error {
Migration: p.params.Migration,
AllowTCPFallback: p.params.AllowTCPFallback,
TCPFallbackRTTThreshold: p.params.TCPFallbackRTTThreshold,
AllowUDPUnstableFallback: p.params.AllowUDPUnstableFallback,
TURNSEnabled: p.params.TURNSEnabled,
Logger: p.params.Logger,
})
+2 -1
View File
@@ -48,6 +48,7 @@ type TransportManagerParams struct {
Migration bool
AllowTCPFallback bool
TCPFallbackRTTThreshold int
AllowUDPUnstableFallback bool
TURNSEnabled bool
Logger logger.Logger
}
@@ -710,7 +711,7 @@ func (t *TransportManager) OnReceiverReport(dt *sfu.DownTrack, report *rtcp.Rece
}
func (t *TransportManager) onMediaLossUpdate(loss uint8) {
if t.params.TCPFallbackRTTThreshold == 0 {
if t.params.TCPFallbackRTTThreshold == 0 || !t.params.AllowUDPUnstableFallback {
return
}
t.lock.Lock()