Experimental WARP (#4649)

* Experimental WARP

* fix panic

* go dep

* stats
This commit is contained in:
cnderrauber
2026-08-14 16:26:08 +08:00
committed by GitHub
parent df20578a78
commit dbe06aa8d1
16 changed files with 152 additions and 53 deletions
+10 -4
View File
@@ -233,6 +233,7 @@ type ParticipantParams struct {
EnableStartAtDesiredQuality bool
MigrationWaitDuration time.Duration
ExcludeIPv6LocalCandidates bool
EnableWarp bool
}
type ParticipantImpl struct {
@@ -1453,9 +1454,9 @@ func (p *ParticipantImpl) recordRTCState(closeReason types.ParticipantCloseReaso
}
if p.IsConnectionCanceled(closeReason) {
prometheus.IncrementParticipantRtcCanceled(1)
prometheus.IncrementParticipantRtcCanceled(1, p.params.EnableWarp)
} else {
prometheus.IncrementParticipantRtcFailure(1)
prometheus.IncrementParticipantRtcFailure(1, p.params.EnableWarp)
}
}
@@ -2100,6 +2101,7 @@ func (p *ParticipantImpl) setupTransportManager() error {
FireOnTrackBySdp: p.params.FireOnTrackBySdp,
EnableDataTracks: p.params.EnableDataTracks,
ExcludeIPv6LocalCandidates: p.params.ExcludeIPv6LocalCandidates,
EnableWarp: p.params.EnableWarp,
}
if p.params.SyncStreams && p.params.PlayoutDelay.GetEnabled() && p.params.ClientInfo.isFirefox() {
// we will disable playout delay for Firefox if the user is expecting
@@ -2683,8 +2685,8 @@ func (p *ParticipantImpl) onPrimaryTransportInitialConnected() {
}
if !p.sessionStartRecorded.Swap(true) {
prometheus.RecordSessionStartTime(int(p.ProtocolVersion()), time.Since(p.params.SessionStartTime))
prometheus.IncrementParticipantRtcSuccess(1)
prometheus.RecordSessionStartTime(int(p.ProtocolVersion()), p.params.EnableWarp, time.Since(p.params.SessionStartTime))
prometheus.IncrementParticipantRtcSuccess(1, p.params.EnableWarp)
}
p.updateState(livekit.ParticipantInfo_ACTIVE)
}
@@ -4442,3 +4444,7 @@ func (p *ParticipantImpl) PerformRpc(req *livekit.PerformRpcRequest, resultCh ch
p.rpcLock.Unlock()
}()
}
func (p *ParticipantImpl) IsWarpEnabled() bool {
return p.params.EnableWarp
}