Experimental WARP (#4649)
* Experimental WARP * fix panic * go dep * stats
This commit is contained in:
+10
-4
@@ -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
|
||||
}
|
||||
|
||||
@@ -1265,6 +1265,7 @@ func (r *Room) onStateChange(p types.LocalParticipant) {
|
||||
p.ToProto(),
|
||||
meta,
|
||||
false,
|
||||
p.IsWarpEnabled(),
|
||||
p.TelemetryGuard(),
|
||||
)
|
||||
|
||||
|
||||
@@ -330,6 +330,7 @@ type TransportParams struct {
|
||||
DatachannelMaxReceiverBufferSize int
|
||||
|
||||
EnableDataTracks bool
|
||||
EnableWarp bool
|
||||
}
|
||||
|
||||
func newPeerConnection(
|
||||
@@ -382,6 +383,11 @@ func newPeerConnection(
|
||||
se.EnableSCTPZeroChecksum(true)
|
||||
}
|
||||
|
||||
if params.EnableWarp {
|
||||
se.EnableSped(true)
|
||||
se.EnableSctpSnap(true)
|
||||
}
|
||||
|
||||
//
|
||||
// Disable SRTP replay protection (https://datatracker.ietf.org/doc/html/rfc3711#page-15).
|
||||
// Needed due to lack of RTX stream support in Pion.
|
||||
|
||||
@@ -100,6 +100,7 @@ type TransportManagerParams struct {
|
||||
FireOnTrackBySdp bool
|
||||
EnableDataTracks bool
|
||||
ExcludeIPv6LocalCandidates bool
|
||||
EnableWarp bool
|
||||
}
|
||||
|
||||
type TransportManager struct {
|
||||
@@ -172,6 +173,7 @@ func NewTransportManager(params TransportManagerParams) (*TransportManager, erro
|
||||
FireOnTrackBySdp: params.FireOnTrackBySdp,
|
||||
EnableDataTracks: params.EnableDataTracks,
|
||||
ExcludeIPv6LocalCandidates: params.ExcludeIPv6LocalCandidates,
|
||||
EnableWarp: params.EnableWarp,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -200,6 +202,7 @@ func NewTransportManager(params TransportManagerParams) (*TransportManager, erro
|
||||
FireOnTrackBySdp: params.FireOnTrackBySdp,
|
||||
EnableDataTracks: params.EnableDataTracks,
|
||||
ExcludeIPv6LocalCandidates: params.ExcludeIPv6LocalCandidates,
|
||||
EnableWarp: params.EnableWarp,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -430,6 +430,7 @@ type LocalParticipant interface {
|
||||
GetPublisherICESessionUfrag() (string, error)
|
||||
SupportsMoving() error
|
||||
GetLastReliableSequence(migrateOut bool) uint32
|
||||
IsWarpEnabled() bool
|
||||
|
||||
SwapResponseSink(sink routing.MessageSink, reason SignallingCloseReason)
|
||||
GetResponseSink() routing.MessageSink
|
||||
|
||||
@@ -965,6 +965,16 @@ type FakeLocalParticipant struct {
|
||||
isUsingSinglePeerConnectionReturnsOnCall map[int]struct {
|
||||
result1 bool
|
||||
}
|
||||
IsWarpEnabledStub func() bool
|
||||
isWarpEnabledMutex sync.RWMutex
|
||||
isWarpEnabledArgsForCall []struct {
|
||||
}
|
||||
isWarpEnabledReturns struct {
|
||||
result1 bool
|
||||
}
|
||||
isWarpEnabledReturnsOnCall map[int]struct {
|
||||
result1 bool
|
||||
}
|
||||
IssueFullReconnectStub func(types.ParticipantCloseReason)
|
||||
issueFullReconnectMutex sync.RWMutex
|
||||
issueFullReconnectArgsForCall []struct {
|
||||
@@ -6628,6 +6638,59 @@ func (fake *FakeLocalParticipant) IsUsingSinglePeerConnectionReturnsOnCall(i int
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IsWarpEnabled() bool {
|
||||
fake.isWarpEnabledMutex.Lock()
|
||||
ret, specificReturn := fake.isWarpEnabledReturnsOnCall[len(fake.isWarpEnabledArgsForCall)]
|
||||
fake.isWarpEnabledArgsForCall = append(fake.isWarpEnabledArgsForCall, struct {
|
||||
}{})
|
||||
stub := fake.IsWarpEnabledStub
|
||||
fakeReturns := fake.isWarpEnabledReturns
|
||||
fake.recordInvocation("IsWarpEnabled", []interface{}{})
|
||||
fake.isWarpEnabledMutex.Unlock()
|
||||
if stub != nil {
|
||||
return stub()
|
||||
}
|
||||
if specificReturn {
|
||||
return ret.result1
|
||||
}
|
||||
return fakeReturns.result1
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IsWarpEnabledCallCount() int {
|
||||
fake.isWarpEnabledMutex.RLock()
|
||||
defer fake.isWarpEnabledMutex.RUnlock()
|
||||
return len(fake.isWarpEnabledArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IsWarpEnabledCalls(stub func() bool) {
|
||||
fake.isWarpEnabledMutex.Lock()
|
||||
defer fake.isWarpEnabledMutex.Unlock()
|
||||
fake.IsWarpEnabledStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IsWarpEnabledReturns(result1 bool) {
|
||||
fake.isWarpEnabledMutex.Lock()
|
||||
defer fake.isWarpEnabledMutex.Unlock()
|
||||
fake.IsWarpEnabledStub = nil
|
||||
fake.isWarpEnabledReturns = struct {
|
||||
result1 bool
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IsWarpEnabledReturnsOnCall(i int, result1 bool) {
|
||||
fake.isWarpEnabledMutex.Lock()
|
||||
defer fake.isWarpEnabledMutex.Unlock()
|
||||
fake.IsWarpEnabledStub = nil
|
||||
if fake.isWarpEnabledReturnsOnCall == nil {
|
||||
fake.isWarpEnabledReturnsOnCall = make(map[int]struct {
|
||||
result1 bool
|
||||
})
|
||||
}
|
||||
fake.isWarpEnabledReturnsOnCall[i] = struct {
|
||||
result1 bool
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) IssueFullReconnect(arg1 types.ParticipantCloseReason) {
|
||||
fake.issueFullReconnectMutex.Lock()
|
||||
fake.issueFullReconnectArgsForCall = append(fake.issueFullReconnectArgsForCall, struct {
|
||||
|
||||
Reference in New Issue
Block a user