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:
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user