Add GetClientInfo interface, to be used to decide migration vs full-reconenct (#1827)
This commit is contained in:
@@ -279,6 +279,12 @@ func (p *ParticipantImpl) ConnectedAt() time.Time {
|
|||||||
return p.connectedAt
|
return p.connectedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantImpl) GetClientInfo() *livekit.ClientInfo {
|
||||||
|
p.lock.RLock()
|
||||||
|
defer p.lock.RUnlock()
|
||||||
|
return p.params.ClientInfo.ClientInfo
|
||||||
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) GetClientConfiguration() *livekit.ClientConfiguration {
|
func (p *ParticipantImpl) GetClientConfiguration() *livekit.ClientConfiguration {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
defer p.lock.RUnlock()
|
defer p.lock.RUnlock()
|
||||||
|
|||||||
@@ -285,6 +285,7 @@ type LocalParticipant interface {
|
|||||||
IsDisconnected() bool
|
IsDisconnected() bool
|
||||||
IsIdle() bool
|
IsIdle() bool
|
||||||
SubscriberAsPrimary() bool
|
SubscriberAsPrimary() bool
|
||||||
|
GetClientInfo() *livekit.ClientInfo
|
||||||
GetClientConfiguration() *livekit.ClientConfiguration
|
GetClientConfiguration() *livekit.ClientConfiguration
|
||||||
GetICEConnectionType() ICEConnectionType
|
GetICEConnectionType() ICEConnectionType
|
||||||
GetBufferFactory() *buffer.Factory
|
GetBufferFactory() *buffer.Factory
|
||||||
|
|||||||
@@ -212,6 +212,16 @@ type FakeLocalParticipant struct {
|
|||||||
getClientConfigurationReturnsOnCall map[int]struct {
|
getClientConfigurationReturnsOnCall map[int]struct {
|
||||||
result1 *livekit.ClientConfiguration
|
result1 *livekit.ClientConfiguration
|
||||||
}
|
}
|
||||||
|
GetClientInfoStub func() *livekit.ClientInfo
|
||||||
|
getClientInfoMutex sync.RWMutex
|
||||||
|
getClientInfoArgsForCall []struct {
|
||||||
|
}
|
||||||
|
getClientInfoReturns struct {
|
||||||
|
result1 *livekit.ClientInfo
|
||||||
|
}
|
||||||
|
getClientInfoReturnsOnCall map[int]struct {
|
||||||
|
result1 *livekit.ClientInfo
|
||||||
|
}
|
||||||
GetConnectionQualityStub func() *livekit.ConnectionQualityInfo
|
GetConnectionQualityStub func() *livekit.ConnectionQualityInfo
|
||||||
getConnectionQualityMutex sync.RWMutex
|
getConnectionQualityMutex sync.RWMutex
|
||||||
getConnectionQualityArgsForCall []struct {
|
getConnectionQualityArgsForCall []struct {
|
||||||
@@ -1849,6 +1859,59 @@ func (fake *FakeLocalParticipant) GetClientConfigurationReturnsOnCall(i int, res
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) GetClientInfo() *livekit.ClientInfo {
|
||||||
|
fake.getClientInfoMutex.Lock()
|
||||||
|
ret, specificReturn := fake.getClientInfoReturnsOnCall[len(fake.getClientInfoArgsForCall)]
|
||||||
|
fake.getClientInfoArgsForCall = append(fake.getClientInfoArgsForCall, struct {
|
||||||
|
}{})
|
||||||
|
stub := fake.GetClientInfoStub
|
||||||
|
fakeReturns := fake.getClientInfoReturns
|
||||||
|
fake.recordInvocation("GetClientInfo", []interface{}{})
|
||||||
|
fake.getClientInfoMutex.Unlock()
|
||||||
|
if stub != nil {
|
||||||
|
return stub()
|
||||||
|
}
|
||||||
|
if specificReturn {
|
||||||
|
return ret.result1
|
||||||
|
}
|
||||||
|
return fakeReturns.result1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) GetClientInfoCallCount() int {
|
||||||
|
fake.getClientInfoMutex.RLock()
|
||||||
|
defer fake.getClientInfoMutex.RUnlock()
|
||||||
|
return len(fake.getClientInfoArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) GetClientInfoCalls(stub func() *livekit.ClientInfo) {
|
||||||
|
fake.getClientInfoMutex.Lock()
|
||||||
|
defer fake.getClientInfoMutex.Unlock()
|
||||||
|
fake.GetClientInfoStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) GetClientInfoReturns(result1 *livekit.ClientInfo) {
|
||||||
|
fake.getClientInfoMutex.Lock()
|
||||||
|
defer fake.getClientInfoMutex.Unlock()
|
||||||
|
fake.GetClientInfoStub = nil
|
||||||
|
fake.getClientInfoReturns = struct {
|
||||||
|
result1 *livekit.ClientInfo
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeLocalParticipant) GetClientInfoReturnsOnCall(i int, result1 *livekit.ClientInfo) {
|
||||||
|
fake.getClientInfoMutex.Lock()
|
||||||
|
defer fake.getClientInfoMutex.Unlock()
|
||||||
|
fake.GetClientInfoStub = nil
|
||||||
|
if fake.getClientInfoReturnsOnCall == nil {
|
||||||
|
fake.getClientInfoReturnsOnCall = make(map[int]struct {
|
||||||
|
result1 *livekit.ClientInfo
|
||||||
|
})
|
||||||
|
}
|
||||||
|
fake.getClientInfoReturnsOnCall[i] = struct {
|
||||||
|
result1 *livekit.ClientInfo
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
func (fake *FakeLocalParticipant) GetConnectionQuality() *livekit.ConnectionQualityInfo {
|
func (fake *FakeLocalParticipant) GetConnectionQuality() *livekit.ConnectionQualityInfo {
|
||||||
fake.getConnectionQualityMutex.Lock()
|
fake.getConnectionQualityMutex.Lock()
|
||||||
ret, specificReturn := fake.getConnectionQualityReturnsOnCall[len(fake.getConnectionQualityArgsForCall)]
|
ret, specificReturn := fake.getConnectionQualityReturnsOnCall[len(fake.getConnectionQualityArgsForCall)]
|
||||||
@@ -5475,6 +5538,8 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.getCachedDownTrackMutex.RUnlock()
|
defer fake.getCachedDownTrackMutex.RUnlock()
|
||||||
fake.getClientConfigurationMutex.RLock()
|
fake.getClientConfigurationMutex.RLock()
|
||||||
defer fake.getClientConfigurationMutex.RUnlock()
|
defer fake.getClientConfigurationMutex.RUnlock()
|
||||||
|
fake.getClientInfoMutex.RLock()
|
||||||
|
defer fake.getClientInfoMutex.RUnlock()
|
||||||
fake.getConnectionQualityMutex.RLock()
|
fake.getConnectionQualityMutex.RLock()
|
||||||
defer fake.getConnectionQualityMutex.RUnlock()
|
defer fake.getConnectionQualityMutex.RUnlock()
|
||||||
fake.getICEConnectionTypeMutex.RLock()
|
fake.getICEConnectionTypeMutex.RLock()
|
||||||
|
|||||||
Reference in New Issue
Block a user