Move track update methods to LocalParticipant. (#2868)

This commit is contained in:
Raja Subramanian
2024-07-16 08:09:46 +05:30
committed by GitHub
parent f3d3ec1ce7
commit f7695cf9f4
2 changed files with 2 additions and 150 deletions
+2 -2
View File
@@ -280,8 +280,6 @@ type Participant interface {
timedVersion utils.TimedVersion,
resolverBySid func(participantID livekit.ParticipantID) LocalParticipant,
) error
UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error
UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error
DebugInfo() map[string]interface{}
}
@@ -332,6 +330,8 @@ type LocalParticipant interface {
SetName(name string)
SetMetadata(metadata string)
SetAttributes(attributes map[string]string)
UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error
UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error
// permissions
ClaimGrants() *auth.ClaimGrants
@@ -207,17 +207,6 @@ type FakeParticipant struct {
toProtoReturnsOnCall map[int]struct {
result1 *livekit.ParticipantInfo
}
UpdateAudioTrackStub func(*livekit.UpdateLocalAudioTrack) error
updateAudioTrackMutex sync.RWMutex
updateAudioTrackArgsForCall []struct {
arg1 *livekit.UpdateLocalAudioTrack
}
updateAudioTrackReturns struct {
result1 error
}
updateAudioTrackReturnsOnCall map[int]struct {
result1 error
}
UpdateSubscriptionPermissionStub func(*livekit.SubscriptionPermission, utils.TimedVersion, func(participantID livekit.ParticipantID) types.LocalParticipant) error
updateSubscriptionPermissionMutex sync.RWMutex
updateSubscriptionPermissionArgsForCall []struct {
@@ -231,17 +220,6 @@ type FakeParticipant struct {
updateSubscriptionPermissionReturnsOnCall map[int]struct {
result1 error
}
UpdateVideoTrackStub func(*livekit.UpdateLocalVideoTrack) error
updateVideoTrackMutex sync.RWMutex
updateVideoTrackArgsForCall []struct {
arg1 *livekit.UpdateLocalVideoTrack
}
updateVideoTrackReturns struct {
result1 error
}
updateVideoTrackReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
@@ -1267,67 +1245,6 @@ func (fake *FakeParticipant) ToProtoReturnsOnCall(i int, result1 *livekit.Partic
}{result1}
}
func (fake *FakeParticipant) UpdateAudioTrack(arg1 *livekit.UpdateLocalAudioTrack) error {
fake.updateAudioTrackMutex.Lock()
ret, specificReturn := fake.updateAudioTrackReturnsOnCall[len(fake.updateAudioTrackArgsForCall)]
fake.updateAudioTrackArgsForCall = append(fake.updateAudioTrackArgsForCall, struct {
arg1 *livekit.UpdateLocalAudioTrack
}{arg1})
stub := fake.UpdateAudioTrackStub
fakeReturns := fake.updateAudioTrackReturns
fake.recordInvocation("UpdateAudioTrack", []interface{}{arg1})
fake.updateAudioTrackMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) UpdateAudioTrackCallCount() int {
fake.updateAudioTrackMutex.RLock()
defer fake.updateAudioTrackMutex.RUnlock()
return len(fake.updateAudioTrackArgsForCall)
}
func (fake *FakeParticipant) UpdateAudioTrackCalls(stub func(*livekit.UpdateLocalAudioTrack) error) {
fake.updateAudioTrackMutex.Lock()
defer fake.updateAudioTrackMutex.Unlock()
fake.UpdateAudioTrackStub = stub
}
func (fake *FakeParticipant) UpdateAudioTrackArgsForCall(i int) *livekit.UpdateLocalAudioTrack {
fake.updateAudioTrackMutex.RLock()
defer fake.updateAudioTrackMutex.RUnlock()
argsForCall := fake.updateAudioTrackArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeParticipant) UpdateAudioTrackReturns(result1 error) {
fake.updateAudioTrackMutex.Lock()
defer fake.updateAudioTrackMutex.Unlock()
fake.UpdateAudioTrackStub = nil
fake.updateAudioTrackReturns = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) UpdateAudioTrackReturnsOnCall(i int, result1 error) {
fake.updateAudioTrackMutex.Lock()
defer fake.updateAudioTrackMutex.Unlock()
fake.UpdateAudioTrackStub = nil
if fake.updateAudioTrackReturnsOnCall == nil {
fake.updateAudioTrackReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.updateAudioTrackReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) UpdateSubscriptionPermission(arg1 *livekit.SubscriptionPermission, arg2 utils.TimedVersion, arg3 func(participantID livekit.ParticipantID) types.LocalParticipant) error {
fake.updateSubscriptionPermissionMutex.Lock()
ret, specificReturn := fake.updateSubscriptionPermissionReturnsOnCall[len(fake.updateSubscriptionPermissionArgsForCall)]
@@ -1391,67 +1308,6 @@ func (fake *FakeParticipant) UpdateSubscriptionPermissionReturnsOnCall(i int, re
}{result1}
}
func (fake *FakeParticipant) UpdateVideoTrack(arg1 *livekit.UpdateLocalVideoTrack) error {
fake.updateVideoTrackMutex.Lock()
ret, specificReturn := fake.updateVideoTrackReturnsOnCall[len(fake.updateVideoTrackArgsForCall)]
fake.updateVideoTrackArgsForCall = append(fake.updateVideoTrackArgsForCall, struct {
arg1 *livekit.UpdateLocalVideoTrack
}{arg1})
stub := fake.UpdateVideoTrackStub
fakeReturns := fake.updateVideoTrackReturns
fake.recordInvocation("UpdateVideoTrack", []interface{}{arg1})
fake.updateVideoTrackMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) UpdateVideoTrackCallCount() int {
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
return len(fake.updateVideoTrackArgsForCall)
}
func (fake *FakeParticipant) UpdateVideoTrackCalls(stub func(*livekit.UpdateLocalVideoTrack) error) {
fake.updateVideoTrackMutex.Lock()
defer fake.updateVideoTrackMutex.Unlock()
fake.UpdateVideoTrackStub = stub
}
func (fake *FakeParticipant) UpdateVideoTrackArgsForCall(i int) *livekit.UpdateLocalVideoTrack {
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
argsForCall := fake.updateVideoTrackArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeParticipant) UpdateVideoTrackReturns(result1 error) {
fake.updateVideoTrackMutex.Lock()
defer fake.updateVideoTrackMutex.Unlock()
fake.UpdateVideoTrackStub = nil
fake.updateVideoTrackReturns = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) UpdateVideoTrackReturnsOnCall(i int, result1 error) {
fake.updateVideoTrackMutex.Lock()
defer fake.updateVideoTrackMutex.Unlock()
fake.UpdateVideoTrackStub = nil
if fake.updateVideoTrackReturnsOnCall == nil {
fake.updateVideoTrackReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.updateVideoTrackReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
@@ -1493,12 +1349,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.subscriptionPermissionMutex.RUnlock()
fake.toProtoMutex.RLock()
defer fake.toProtoMutex.RUnlock()
fake.updateAudioTrackMutex.RLock()
defer fake.updateAudioTrackMutex.RUnlock()
fake.updateSubscriptionPermissionMutex.RLock()
defer fake.updateSubscriptionPermissionMutex.RUnlock()
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value