Server-driven connection quality detection (#167)

This commit is contained in:
David Zhao authored and GitHub committed 2021-11-03 21:05:20 -07:00
1 parent 862a212b93
commit aa9534b7fb
14 files changed
+818 -81

No files matched your search

+11 -3
View File
@@ -53,8 +53,13 @@ type Participant interface {
SendSpeakerUpdate(speakers []*livekit.SpeakerInfo) error
SendDataPacket(packet *livekit.DataPacket) error
SendRoomUpdate(room *livekit.Room) error
SendConnectionQualityUpdate(update *livekit.ConnectionQualityUpdate) error
SetTrackMuted(trackId string, muted bool, fromAdmin bool)
GetAudioLevel() (level uint8, active bool)
GetConnectionQuality() livekit.ConnectionQuality
IsSubscribedTo(identity string) bool
// returns list of participant identities that the current participant is subscribed to
GetSubscribedParticipants() []string
// permissions
@@ -78,9 +83,8 @@ type Participant interface {
OnClose(func(Participant))
// package methods
AddSubscribedTrack(participantId string, st SubscribedTrack)
RemoveSubscribedTrack(participantId string, st SubscribedTrack)
AddSubscribedTrack(st SubscribedTrack)
RemoveSubscribedTrack(st SubscribedTrack)
SubscriberPC() *webrtc.PeerConnection
DebugInfo() map[string]interface{}
@@ -104,6 +108,9 @@ type PublishedTrack interface {
RemoveAllSubscribers()
// returns quality information that's appropriate for width & height
GetQualityForDimension(width, height uint32) livekit.VideoQuality
// returns number of uptracks that are publishing, registered
NumUpTracks() (uint32, uint32)
PublishLossPercentage() uint32
ToProto() *livekit.TrackInfo
// callbacks
@@ -118,6 +125,7 @@ type SubscribedTrack interface {
IsMuted() bool
SetPublisherMuted(muted bool)
UpdateSubscriberSettings(enabled bool, quality livekit.VideoQuality)
SubscribeLossPercentage() uint32
}
// interface for properties of webrtc.TrackRemote
+298 -24
View File
@@ -25,11 +25,10 @@ type FakeParticipant struct {
addICECandidateReturnsOnCall map[int]struct {
result1 error
}
AddSubscribedTrackStub func(string, types.SubscribedTrack)
AddSubscribedTrackStub func(types.SubscribedTrack)
addSubscribedTrackMutex sync.RWMutex
addSubscribedTrackArgsForCall []struct {
arg1 string
arg2 types.SubscribedTrack
arg1 types.SubscribedTrack
}
AddSubscriberStub func(types.Participant) (int, error)
addSubscriberMutex sync.RWMutex
@@ -121,6 +120,16 @@ type FakeParticipant struct {
result1 uint8
result2 bool
}
GetConnectionQualityStub func() livekit.ConnectionQuality
getConnectionQualityMutex sync.RWMutex
getConnectionQualityArgsForCall []struct {
}
getConnectionQualityReturns struct {
result1 livekit.ConnectionQuality
}
getConnectionQualityReturnsOnCall map[int]struct {
result1 livekit.ConnectionQuality
}
GetPublishedTrackStub func(string) types.PublishedTrack
getPublishedTrackMutex sync.RWMutex
getPublishedTrackArgsForCall []struct {
@@ -152,6 +161,16 @@ type FakeParticipant struct {
getResponseSinkReturnsOnCall map[int]struct {
result1 routing.MessageSink
}
GetSubscribedParticipantsStub func() []string
getSubscribedParticipantsMutex sync.RWMutex
getSubscribedParticipantsArgsForCall []struct {
}
getSubscribedParticipantsReturns struct {
result1 []string
}
getSubscribedParticipantsReturnsOnCall map[int]struct {
result1 []string
}
GetSubscribedTrackStub func(string) types.SubscribedTrack
getSubscribedTrackMutex sync.RWMutex
getSubscribedTrackArgsForCall []struct {
@@ -247,6 +266,17 @@ type FakeParticipant struct {
isReadyReturnsOnCall map[int]struct {
result1 bool
}
IsSubscribedToStub func(string) bool
isSubscribedToMutex sync.RWMutex
isSubscribedToArgsForCall []struct {
arg1 string
}
isSubscribedToReturns struct {
result1 bool
}
isSubscribedToReturnsOnCall map[int]struct {
result1 bool
}
NegotiateStub func()
negotiateMutex sync.RWMutex
negotiateArgsForCall []struct {
@@ -301,17 +331,27 @@ type FakeParticipant struct {
rTCPChanReturnsOnCall map[int]struct {
result1 chan []rtcp.Packet
}
RemoveSubscribedTrackStub func(string, types.SubscribedTrack)
RemoveSubscribedTrackStub func(types.SubscribedTrack)
removeSubscribedTrackMutex sync.RWMutex
removeSubscribedTrackArgsForCall []struct {
arg1 string
arg2 types.SubscribedTrack
arg1 types.SubscribedTrack
}
RemoveSubscriberStub func(string)
removeSubscriberMutex sync.RWMutex
removeSubscriberArgsForCall []struct {
arg1 string
}
SendConnectionQualityUpdateStub func(*livekit.ConnectionQualityUpdate) error
sendConnectionQualityUpdateMutex sync.RWMutex
sendConnectionQualityUpdateArgsForCall []struct {
arg1 *livekit.ConnectionQualityUpdate
}
sendConnectionQualityUpdateReturns struct {
result1 error
}
sendConnectionQualityUpdateReturnsOnCall map[int]struct {
result1 error
}
SendDataPacketStub func(*livekit.DataPacket) error
sendDataPacketMutex sync.RWMutex
sendDataPacketArgsForCall []struct {
@@ -502,17 +542,16 @@ func (fake *FakeParticipant) AddICECandidateReturnsOnCall(i int, result1 error)
}{result1}
}
func (fake *FakeParticipant) AddSubscribedTrack(arg1 string, arg2 types.SubscribedTrack) {
func (fake *FakeParticipant) AddSubscribedTrack(arg1 types.SubscribedTrack) {
fake.addSubscribedTrackMutex.Lock()
fake.addSubscribedTrackArgsForCall = append(fake.addSubscribedTrackArgsForCall, struct {
arg1 string
arg2 types.SubscribedTrack
}{arg1, arg2})
arg1 types.SubscribedTrack
}{arg1})
stub := fake.AddSubscribedTrackStub
fake.recordInvocation("AddSubscribedTrack", []interface{}{arg1, arg2})
fake.recordInvocation("AddSubscribedTrack", []interface{}{arg1})
fake.addSubscribedTrackMutex.Unlock()
if stub != nil {
fake.AddSubscribedTrackStub(arg1, arg2)
fake.AddSubscribedTrackStub(arg1)
}
}
@@ -522,17 +561,17 @@ func (fake *FakeParticipant) AddSubscribedTrackCallCount() int {
return len(fake.addSubscribedTrackArgsForCall)
}
func (fake *FakeParticipant) AddSubscribedTrackCalls(stub func(string, types.SubscribedTrack)) {
func (fake *FakeParticipant) AddSubscribedTrackCalls(stub func(types.SubscribedTrack)) {
fake.addSubscribedTrackMutex.Lock()
defer fake.addSubscribedTrackMutex.Unlock()
fake.AddSubscribedTrackStub = stub
}
func (fake *FakeParticipant) AddSubscribedTrackArgsForCall(i int) (string, types.SubscribedTrack) {
func (fake *FakeParticipant) AddSubscribedTrackArgsForCall(i int) types.SubscribedTrack {
fake.addSubscribedTrackMutex.RLock()
defer fake.addSubscribedTrackMutex.RUnlock()
argsForCall := fake.addSubscribedTrackArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
return argsForCall.arg1
}
func (fake *FakeParticipant) AddSubscriber(arg1 types.Participant) (int, error) {
@@ -1005,6 +1044,59 @@ func (fake *FakeParticipant) GetAudioLevelReturnsOnCall(i int, result1 uint8, re
}{result1, result2}
}
func (fake *FakeParticipant) GetConnectionQuality() livekit.ConnectionQuality {
fake.getConnectionQualityMutex.Lock()
ret, specificReturn := fake.getConnectionQualityReturnsOnCall[len(fake.getConnectionQualityArgsForCall)]
fake.getConnectionQualityArgsForCall = append(fake.getConnectionQualityArgsForCall, struct {
}{})
stub := fake.GetConnectionQualityStub
fakeReturns := fake.getConnectionQualityReturns
fake.recordInvocation("GetConnectionQuality", []interface{}{})
fake.getConnectionQualityMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) GetConnectionQualityCallCount() int {
fake.getConnectionQualityMutex.RLock()
defer fake.getConnectionQualityMutex.RUnlock()
return len(fake.getConnectionQualityArgsForCall)
}
func (fake *FakeParticipant) GetConnectionQualityCalls(stub func() livekit.ConnectionQuality) {
fake.getConnectionQualityMutex.Lock()
defer fake.getConnectionQualityMutex.Unlock()
fake.GetConnectionQualityStub = stub
}
func (fake *FakeParticipant) GetConnectionQualityReturns(result1 livekit.ConnectionQuality) {
fake.getConnectionQualityMutex.Lock()
defer fake.getConnectionQualityMutex.Unlock()
fake.GetConnectionQualityStub = nil
fake.getConnectionQualityReturns = struct {
result1 livekit.ConnectionQuality
}{result1}
}
func (fake *FakeParticipant) GetConnectionQualityReturnsOnCall(i int, result1 livekit.ConnectionQuality) {
fake.getConnectionQualityMutex.Lock()
defer fake.getConnectionQualityMutex.Unlock()
fake.GetConnectionQualityStub = nil
if fake.getConnectionQualityReturnsOnCall == nil {
fake.getConnectionQualityReturnsOnCall = make(map[int]struct {
result1 livekit.ConnectionQuality
})
}
fake.getConnectionQualityReturnsOnCall[i] = struct {
result1 livekit.ConnectionQuality
}{result1}
}
func (fake *FakeParticipant) GetPublishedTrack(arg1 string) types.PublishedTrack {
fake.getPublishedTrackMutex.Lock()
ret, specificReturn := fake.getPublishedTrackReturnsOnCall[len(fake.getPublishedTrackArgsForCall)]
@@ -1172,6 +1264,59 @@ func (fake *FakeParticipant) GetResponseSinkReturnsOnCall(i int, result1 routing
}{result1}
}
func (fake *FakeParticipant) GetSubscribedParticipants() []string {
fake.getSubscribedParticipantsMutex.Lock()
ret, specificReturn := fake.getSubscribedParticipantsReturnsOnCall[len(fake.getSubscribedParticipantsArgsForCall)]
fake.getSubscribedParticipantsArgsForCall = append(fake.getSubscribedParticipantsArgsForCall, struct {
}{})
stub := fake.GetSubscribedParticipantsStub
fakeReturns := fake.getSubscribedParticipantsReturns
fake.recordInvocation("GetSubscribedParticipants", []interface{}{})
fake.getSubscribedParticipantsMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) GetSubscribedParticipantsCallCount() int {
fake.getSubscribedParticipantsMutex.RLock()
defer fake.getSubscribedParticipantsMutex.RUnlock()
return len(fake.getSubscribedParticipantsArgsForCall)
}
func (fake *FakeParticipant) GetSubscribedParticipantsCalls(stub func() []string) {
fake.getSubscribedParticipantsMutex.Lock()
defer fake.getSubscribedParticipantsMutex.Unlock()
fake.GetSubscribedParticipantsStub = stub
}
func (fake *FakeParticipant) GetSubscribedParticipantsReturns(result1 []string) {
fake.getSubscribedParticipantsMutex.Lock()
defer fake.getSubscribedParticipantsMutex.Unlock()
fake.GetSubscribedParticipantsStub = nil
fake.getSubscribedParticipantsReturns = struct {
result1 []string
}{result1}
}
func (fake *FakeParticipant) GetSubscribedParticipantsReturnsOnCall(i int, result1 []string) {
fake.getSubscribedParticipantsMutex.Lock()
defer fake.getSubscribedParticipantsMutex.Unlock()
fake.GetSubscribedParticipantsStub = nil
if fake.getSubscribedParticipantsReturnsOnCall == nil {
fake.getSubscribedParticipantsReturnsOnCall = make(map[int]struct {
result1 []string
})
}
fake.getSubscribedParticipantsReturnsOnCall[i] = struct {
result1 []string
}{result1}
}
func (fake *FakeParticipant) GetSubscribedTrack(arg1 string) types.SubscribedTrack {
fake.getSubscribedTrackMutex.Lock()
ret, specificReturn := fake.getSubscribedTrackReturnsOnCall[len(fake.getSubscribedTrackArgsForCall)]
@@ -1676,6 +1821,67 @@ func (fake *FakeParticipant) IsReadyReturnsOnCall(i int, result1 bool) {
}{result1}
}
func (fake *FakeParticipant) IsSubscribedTo(arg1 string) bool {
fake.isSubscribedToMutex.Lock()
ret, specificReturn := fake.isSubscribedToReturnsOnCall[len(fake.isSubscribedToArgsForCall)]
fake.isSubscribedToArgsForCall = append(fake.isSubscribedToArgsForCall, struct {
arg1 string
}{arg1})
stub := fake.IsSubscribedToStub
fakeReturns := fake.isSubscribedToReturns
fake.recordInvocation("IsSubscribedTo", []interface{}{arg1})
fake.isSubscribedToMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) IsSubscribedToCallCount() int {
fake.isSubscribedToMutex.RLock()
defer fake.isSubscribedToMutex.RUnlock()
return len(fake.isSubscribedToArgsForCall)
}
func (fake *FakeParticipant) IsSubscribedToCalls(stub func(string) bool) {
fake.isSubscribedToMutex.Lock()
defer fake.isSubscribedToMutex.Unlock()
fake.IsSubscribedToStub = stub
}
func (fake *FakeParticipant) IsSubscribedToArgsForCall(i int) string {
fake.isSubscribedToMutex.RLock()
defer fake.isSubscribedToMutex.RUnlock()
argsForCall := fake.isSubscribedToArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeParticipant) IsSubscribedToReturns(result1 bool) {
fake.isSubscribedToMutex.Lock()
defer fake.isSubscribedToMutex.Unlock()
fake.IsSubscribedToStub = nil
fake.isSubscribedToReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeParticipant) IsSubscribedToReturnsOnCall(i int, result1 bool) {
fake.isSubscribedToMutex.Lock()
defer fake.isSubscribedToMutex.Unlock()
fake.IsSubscribedToStub = nil
if fake.isSubscribedToReturnsOnCall == nil {
fake.isSubscribedToReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isSubscribedToReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeParticipant) Negotiate() {
fake.negotiateMutex.Lock()
fake.negotiateArgsForCall = append(fake.negotiateArgsForCall, struct {
@@ -1998,17 +2204,16 @@ func (fake *FakeParticipant) RTCPChanReturnsOnCall(i int, result1 chan []rtcp.Pa
}{result1}
}
func (fake *FakeParticipant) RemoveSubscribedTrack(arg1 string, arg2 types.SubscribedTrack) {
func (fake *FakeParticipant) RemoveSubscribedTrack(arg1 types.SubscribedTrack) {
fake.removeSubscribedTrackMutex.Lock()
fake.removeSubscribedTrackArgsForCall = append(fake.removeSubscribedTrackArgsForCall, struct {
arg1 string
arg2 types.SubscribedTrack
}{arg1, arg2})
arg1 types.SubscribedTrack
}{arg1})
stub := fake.RemoveSubscribedTrackStub
fake.recordInvocation("RemoveSubscribedTrack", []interface{}{arg1, arg2})
fake.recordInvocation("RemoveSubscribedTrack", []interface{}{arg1})
fake.removeSubscribedTrackMutex.Unlock()
if stub != nil {
fake.RemoveSubscribedTrackStub(arg1, arg2)
fake.RemoveSubscribedTrackStub(arg1)
}
}
@@ -2018,17 +2223,17 @@ func (fake *FakeParticipant) RemoveSubscribedTrackCallCount() int {
return len(fake.removeSubscribedTrackArgsForCall)
}
func (fake *FakeParticipant) RemoveSubscribedTrackCalls(stub func(string, types.SubscribedTrack)) {
func (fake *FakeParticipant) RemoveSubscribedTrackCalls(stub func(types.SubscribedTrack)) {
fake.removeSubscribedTrackMutex.Lock()
defer fake.removeSubscribedTrackMutex.Unlock()
fake.RemoveSubscribedTrackStub = stub
}
func (fake *FakeParticipant) RemoveSubscribedTrackArgsForCall(i int) (string, types.SubscribedTrack) {
func (fake *FakeParticipant) RemoveSubscribedTrackArgsForCall(i int) types.SubscribedTrack {
fake.removeSubscribedTrackMutex.RLock()
defer fake.removeSubscribedTrackMutex.RUnlock()
argsForCall := fake.removeSubscribedTrackArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
return argsForCall.arg1
}
func (fake *FakeParticipant) RemoveSubscriber(arg1 string) {
@@ -2063,6 +2268,67 @@ func (fake *FakeParticipant) RemoveSubscriberArgsForCall(i int) string {
return argsForCall.arg1
}
func (fake *FakeParticipant) SendConnectionQualityUpdate(arg1 *livekit.ConnectionQualityUpdate) error {
fake.sendConnectionQualityUpdateMutex.Lock()
ret, specificReturn := fake.sendConnectionQualityUpdateReturnsOnCall[len(fake.sendConnectionQualityUpdateArgsForCall)]
fake.sendConnectionQualityUpdateArgsForCall = append(fake.sendConnectionQualityUpdateArgsForCall, struct {
arg1 *livekit.ConnectionQualityUpdate
}{arg1})
stub := fake.SendConnectionQualityUpdateStub
fakeReturns := fake.sendConnectionQualityUpdateReturns
fake.recordInvocation("SendConnectionQualityUpdate", []interface{}{arg1})
fake.sendConnectionQualityUpdateMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) SendConnectionQualityUpdateCallCount() int {
fake.sendConnectionQualityUpdateMutex.RLock()
defer fake.sendConnectionQualityUpdateMutex.RUnlock()
return len(fake.sendConnectionQualityUpdateArgsForCall)
}
func (fake *FakeParticipant) SendConnectionQualityUpdateCalls(stub func(*livekit.ConnectionQualityUpdate) error) {
fake.sendConnectionQualityUpdateMutex.Lock()
defer fake.sendConnectionQualityUpdateMutex.Unlock()
fake.SendConnectionQualityUpdateStub = stub
}
func (fake *FakeParticipant) SendConnectionQualityUpdateArgsForCall(i int) *livekit.ConnectionQualityUpdate {
fake.sendConnectionQualityUpdateMutex.RLock()
defer fake.sendConnectionQualityUpdateMutex.RUnlock()
argsForCall := fake.sendConnectionQualityUpdateArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeParticipant) SendConnectionQualityUpdateReturns(result1 error) {
fake.sendConnectionQualityUpdateMutex.Lock()
defer fake.sendConnectionQualityUpdateMutex.Unlock()
fake.SendConnectionQualityUpdateStub = nil
fake.sendConnectionQualityUpdateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) SendConnectionQualityUpdateReturnsOnCall(i int, result1 error) {
fake.sendConnectionQualityUpdateMutex.Lock()
defer fake.sendConnectionQualityUpdateMutex.Unlock()
fake.SendConnectionQualityUpdateStub = nil
if fake.sendConnectionQualityUpdateReturnsOnCall == nil {
fake.sendConnectionQualityUpdateReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.sendConnectionQualityUpdateReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) SendDataPacket(arg1 *livekit.DataPacket) error {
fake.sendDataPacketMutex.Lock()
ret, specificReturn := fake.sendDataPacketReturnsOnCall[len(fake.sendDataPacketArgsForCall)]
@@ -2782,12 +3048,16 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.debugInfoMutex.RUnlock()
fake.getAudioLevelMutex.RLock()
defer fake.getAudioLevelMutex.RUnlock()
fake.getConnectionQualityMutex.RLock()
defer fake.getConnectionQualityMutex.RUnlock()
fake.getPublishedTrackMutex.RLock()
defer fake.getPublishedTrackMutex.RUnlock()
fake.getPublishedTracksMutex.RLock()
defer fake.getPublishedTracksMutex.RUnlock()
fake.getResponseSinkMutex.RLock()
defer fake.getResponseSinkMutex.RUnlock()
fake.getSubscribedParticipantsMutex.RLock()
defer fake.getSubscribedParticipantsMutex.RUnlock()
fake.getSubscribedTrackMutex.RLock()
defer fake.getSubscribedTrackMutex.RUnlock()
fake.getSubscribedTracksMutex.RLock()
@@ -2806,6 +3076,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.identityMutex.RUnlock()
fake.isReadyMutex.RLock()
defer fake.isReadyMutex.RUnlock()
fake.isSubscribedToMutex.RLock()
defer fake.isSubscribedToMutex.RUnlock()
fake.negotiateMutex.RLock()
defer fake.negotiateMutex.RUnlock()
fake.onCloseMutex.RLock()
@@ -2828,6 +3100,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.removeSubscribedTrackMutex.RUnlock()
fake.removeSubscriberMutex.RLock()
defer fake.removeSubscriberMutex.RUnlock()
fake.sendConnectionQualityUpdateMutex.RLock()
defer fake.sendConnectionQualityUpdateMutex.RUnlock()
fake.sendDataPacketMutex.RLock()
defer fake.sendDataPacketMutex.RUnlock()
fake.sendJoinResponseMutex.RLock()
@@ -83,11 +83,33 @@ type FakePublishedTrack struct {
nameReturnsOnCall map[int]struct {
result1 string
}
NumUpTracksStub func() (uint32, uint32)
numUpTracksMutex sync.RWMutex
numUpTracksArgsForCall []struct {
}
numUpTracksReturns struct {
result1 uint32
result2 uint32
}
numUpTracksReturnsOnCall map[int]struct {
result1 uint32
result2 uint32
}
OnCloseStub func(func())
onCloseMutex sync.RWMutex
onCloseArgsForCall []struct {
arg1 func()
}
PublishLossPercentageStub func() uint32
publishLossPercentageMutex sync.RWMutex
publishLossPercentageArgsForCall []struct {
}
publishLossPercentageReturns struct {
result1 uint32
}
publishLossPercentageReturnsOnCall map[int]struct {
result1 uint32
}
RemoveAllSubscribersStub func()
removeAllSubscribersMutex sync.RWMutex
removeAllSubscribersArgsForCall []struct {
@@ -536,6 +558,62 @@ func (fake *FakePublishedTrack) NameReturnsOnCall(i int, result1 string) {
}{result1}
}
func (fake *FakePublishedTrack) NumUpTracks() (uint32, uint32) {
fake.numUpTracksMutex.Lock()
ret, specificReturn := fake.numUpTracksReturnsOnCall[len(fake.numUpTracksArgsForCall)]
fake.numUpTracksArgsForCall = append(fake.numUpTracksArgsForCall, struct {
}{})
stub := fake.NumUpTracksStub
fakeReturns := fake.numUpTracksReturns
fake.recordInvocation("NumUpTracks", []interface{}{})
fake.numUpTracksMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakePublishedTrack) NumUpTracksCallCount() int {
fake.numUpTracksMutex.RLock()
defer fake.numUpTracksMutex.RUnlock()
return len(fake.numUpTracksArgsForCall)
}
func (fake *FakePublishedTrack) NumUpTracksCalls(stub func() (uint32, uint32)) {
fake.numUpTracksMutex.Lock()
defer fake.numUpTracksMutex.Unlock()
fake.NumUpTracksStub = stub
}
func (fake *FakePublishedTrack) NumUpTracksReturns(result1 uint32, result2 uint32) {
fake.numUpTracksMutex.Lock()
defer fake.numUpTracksMutex.Unlock()
fake.NumUpTracksStub = nil
fake.numUpTracksReturns = struct {
result1 uint32
result2 uint32
}{result1, result2}
}
func (fake *FakePublishedTrack) NumUpTracksReturnsOnCall(i int, result1 uint32, result2 uint32) {
fake.numUpTracksMutex.Lock()
defer fake.numUpTracksMutex.Unlock()
fake.NumUpTracksStub = nil
if fake.numUpTracksReturnsOnCall == nil {
fake.numUpTracksReturnsOnCall = make(map[int]struct {
result1 uint32
result2 uint32
})
}
fake.numUpTracksReturnsOnCall[i] = struct {
result1 uint32
result2 uint32
}{result1, result2}
}
func (fake *FakePublishedTrack) OnClose(arg1 func()) {
fake.onCloseMutex.Lock()
fake.onCloseArgsForCall = append(fake.onCloseArgsForCall, struct {
@@ -568,6 +646,59 @@ func (fake *FakePublishedTrack) OnCloseArgsForCall(i int) func() {
return argsForCall.arg1
}
func (fake *FakePublishedTrack) PublishLossPercentage() uint32 {
fake.publishLossPercentageMutex.Lock()
ret, specificReturn := fake.publishLossPercentageReturnsOnCall[len(fake.publishLossPercentageArgsForCall)]
fake.publishLossPercentageArgsForCall = append(fake.publishLossPercentageArgsForCall, struct {
}{})
stub := fake.PublishLossPercentageStub
fakeReturns := fake.publishLossPercentageReturns
fake.recordInvocation("PublishLossPercentage", []interface{}{})
fake.publishLossPercentageMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakePublishedTrack) PublishLossPercentageCallCount() int {
fake.publishLossPercentageMutex.RLock()
defer fake.publishLossPercentageMutex.RUnlock()
return len(fake.publishLossPercentageArgsForCall)
}
func (fake *FakePublishedTrack) PublishLossPercentageCalls(stub func() uint32) {
fake.publishLossPercentageMutex.Lock()
defer fake.publishLossPercentageMutex.Unlock()
fake.PublishLossPercentageStub = stub
}
func (fake *FakePublishedTrack) PublishLossPercentageReturns(result1 uint32) {
fake.publishLossPercentageMutex.Lock()
defer fake.publishLossPercentageMutex.Unlock()
fake.PublishLossPercentageStub = nil
fake.publishLossPercentageReturns = struct {
result1 uint32
}{result1}
}
func (fake *FakePublishedTrack) PublishLossPercentageReturnsOnCall(i int, result1 uint32) {
fake.publishLossPercentageMutex.Lock()
defer fake.publishLossPercentageMutex.Unlock()
fake.PublishLossPercentageStub = nil
if fake.publishLossPercentageReturnsOnCall == nil {
fake.publishLossPercentageReturnsOnCall = make(map[int]struct {
result1 uint32
})
}
fake.publishLossPercentageReturnsOnCall[i] = struct {
result1 uint32
}{result1}
}
func (fake *FakePublishedTrack) RemoveAllSubscribers() {
fake.removeAllSubscribersMutex.Lock()
fake.removeAllSubscribersArgsForCall = append(fake.removeAllSubscribersArgsForCall, struct {
@@ -856,8 +987,12 @@ func (fake *FakePublishedTrack) Invocations() map[string][][]interface{} {
defer fake.kindMutex.RUnlock()
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
fake.numUpTracksMutex.RLock()
defer fake.numUpTracksMutex.RUnlock()
fake.onCloseMutex.RLock()
defer fake.onCloseMutex.RUnlock()
fake.publishLossPercentageMutex.RLock()
defer fake.publishLossPercentageMutex.RUnlock()
fake.removeAllSubscribersMutex.RLock()
defer fake.removeAllSubscribersMutex.RUnlock()
fake.removeSubscriberMutex.RLock()
@@ -55,6 +55,16 @@ type FakeSubscribedTrack struct {
setPublisherMutedArgsForCall []struct {
arg1 bool
}
SubscribeLossPercentageStub func() uint32
subscribeLossPercentageMutex sync.RWMutex
subscribeLossPercentageArgsForCall []struct {
}
subscribeLossPercentageReturns struct {
result1 uint32
}
subscribeLossPercentageReturnsOnCall map[int]struct {
result1 uint32
}
UpdateSubscriberSettingsStub func(bool, livekit.VideoQuality)
updateSubscriberSettingsMutex sync.RWMutex
updateSubscriberSettingsArgsForCall []struct {
@@ -309,6 +319,59 @@ func (fake *FakeSubscribedTrack) SetPublisherMutedArgsForCall(i int) bool {
return argsForCall.arg1
}
func (fake *FakeSubscribedTrack) SubscribeLossPercentage() uint32 {
fake.subscribeLossPercentageMutex.Lock()
ret, specificReturn := fake.subscribeLossPercentageReturnsOnCall[len(fake.subscribeLossPercentageArgsForCall)]
fake.subscribeLossPercentageArgsForCall = append(fake.subscribeLossPercentageArgsForCall, struct {
}{})
stub := fake.SubscribeLossPercentageStub
fakeReturns := fake.subscribeLossPercentageReturns
fake.recordInvocation("SubscribeLossPercentage", []interface{}{})
fake.subscribeLossPercentageMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeSubscribedTrack) SubscribeLossPercentageCallCount() int {
fake.subscribeLossPercentageMutex.RLock()
defer fake.subscribeLossPercentageMutex.RUnlock()
return len(fake.subscribeLossPercentageArgsForCall)
}
func (fake *FakeSubscribedTrack) SubscribeLossPercentageCalls(stub func() uint32) {
fake.subscribeLossPercentageMutex.Lock()
defer fake.subscribeLossPercentageMutex.Unlock()
fake.SubscribeLossPercentageStub = stub
}
func (fake *FakeSubscribedTrack) SubscribeLossPercentageReturns(result1 uint32) {
fake.subscribeLossPercentageMutex.Lock()
defer fake.subscribeLossPercentageMutex.Unlock()
fake.SubscribeLossPercentageStub = nil
fake.subscribeLossPercentageReturns = struct {
result1 uint32
}{result1}
}
func (fake *FakeSubscribedTrack) SubscribeLossPercentageReturnsOnCall(i int, result1 uint32) {
fake.subscribeLossPercentageMutex.Lock()
defer fake.subscribeLossPercentageMutex.Unlock()
fake.SubscribeLossPercentageStub = nil
if fake.subscribeLossPercentageReturnsOnCall == nil {
fake.subscribeLossPercentageReturnsOnCall = make(map[int]struct {
result1 uint32
})
}
fake.subscribeLossPercentageReturnsOnCall[i] = struct {
result1 uint32
}{result1}
}
func (fake *FakeSubscribedTrack) UpdateSubscriberSettings(arg1 bool, arg2 livekit.VideoQuality) {
fake.updateSubscriberSettingsMutex.Lock()
fake.updateSubscriberSettingsArgsForCall = append(fake.updateSubscriberSettingsArgsForCall, struct {
@@ -355,6 +418,8 @@ func (fake *FakeSubscribedTrack) Invocations() map[string][][]interface{} {
defer fake.publisherIdentityMutex.RUnlock()
fake.setPublisherMutedMutex.RLock()
defer fake.setPublisherMutedMutex.RUnlock()
fake.subscribeLossPercentageMutex.RLock()
defer fake.subscribeLossPercentageMutex.RUnlock()
fake.updateSubscriberSettingsMutex.RLock()
defer fake.updateSubscriberSettingsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}