Move track update methods to LocalParticipant. (#2868)
This commit is contained in:
@@ -280,8 +280,6 @@ type Participant interface {
|
|||||||
timedVersion utils.TimedVersion,
|
timedVersion utils.TimedVersion,
|
||||||
resolverBySid func(participantID livekit.ParticipantID) LocalParticipant,
|
resolverBySid func(participantID livekit.ParticipantID) LocalParticipant,
|
||||||
) error
|
) error
|
||||||
UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error
|
|
||||||
UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error
|
|
||||||
|
|
||||||
DebugInfo() map[string]interface{}
|
DebugInfo() map[string]interface{}
|
||||||
}
|
}
|
||||||
@@ -332,6 +330,8 @@ type LocalParticipant interface {
|
|||||||
SetName(name string)
|
SetName(name string)
|
||||||
SetMetadata(metadata string)
|
SetMetadata(metadata string)
|
||||||
SetAttributes(attributes map[string]string)
|
SetAttributes(attributes map[string]string)
|
||||||
|
UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error
|
||||||
|
UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error
|
||||||
|
|
||||||
// permissions
|
// permissions
|
||||||
ClaimGrants() *auth.ClaimGrants
|
ClaimGrants() *auth.ClaimGrants
|
||||||
|
|||||||
@@ -207,17 +207,6 @@ type FakeParticipant struct {
|
|||||||
toProtoReturnsOnCall map[int]struct {
|
toProtoReturnsOnCall map[int]struct {
|
||||||
result1 *livekit.ParticipantInfo
|
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
|
UpdateSubscriptionPermissionStub func(*livekit.SubscriptionPermission, utils.TimedVersion, func(participantID livekit.ParticipantID) types.LocalParticipant) error
|
||||||
updateSubscriptionPermissionMutex sync.RWMutex
|
updateSubscriptionPermissionMutex sync.RWMutex
|
||||||
updateSubscriptionPermissionArgsForCall []struct {
|
updateSubscriptionPermissionArgsForCall []struct {
|
||||||
@@ -231,17 +220,6 @@ type FakeParticipant struct {
|
|||||||
updateSubscriptionPermissionReturnsOnCall map[int]struct {
|
updateSubscriptionPermissionReturnsOnCall map[int]struct {
|
||||||
result1 error
|
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{}
|
invocations map[string][][]interface{}
|
||||||
invocationsMutex sync.RWMutex
|
invocationsMutex sync.RWMutex
|
||||||
}
|
}
|
||||||
@@ -1267,67 +1245,6 @@ func (fake *FakeParticipant) ToProtoReturnsOnCall(i int, result1 *livekit.Partic
|
|||||||
}{result1}
|
}{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 {
|
func (fake *FakeParticipant) UpdateSubscriptionPermission(arg1 *livekit.SubscriptionPermission, arg2 utils.TimedVersion, arg3 func(participantID livekit.ParticipantID) types.LocalParticipant) error {
|
||||||
fake.updateSubscriptionPermissionMutex.Lock()
|
fake.updateSubscriptionPermissionMutex.Lock()
|
||||||
ret, specificReturn := fake.updateSubscriptionPermissionReturnsOnCall[len(fake.updateSubscriptionPermissionArgsForCall)]
|
ret, specificReturn := fake.updateSubscriptionPermissionReturnsOnCall[len(fake.updateSubscriptionPermissionArgsForCall)]
|
||||||
@@ -1391,67 +1308,6 @@ func (fake *FakeParticipant) UpdateSubscriptionPermissionReturnsOnCall(i int, re
|
|||||||
}{result1}
|
}{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{} {
|
func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
||||||
fake.invocationsMutex.RLock()
|
fake.invocationsMutex.RLock()
|
||||||
defer fake.invocationsMutex.RUnlock()
|
defer fake.invocationsMutex.RUnlock()
|
||||||
@@ -1493,12 +1349,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.subscriptionPermissionMutex.RUnlock()
|
defer fake.subscriptionPermissionMutex.RUnlock()
|
||||||
fake.toProtoMutex.RLock()
|
fake.toProtoMutex.RLock()
|
||||||
defer fake.toProtoMutex.RUnlock()
|
defer fake.toProtoMutex.RUnlock()
|
||||||
fake.updateAudioTrackMutex.RLock()
|
|
||||||
defer fake.updateAudioTrackMutex.RUnlock()
|
|
||||||
fake.updateSubscriptionPermissionMutex.RLock()
|
fake.updateSubscriptionPermissionMutex.RLock()
|
||||||
defer fake.updateSubscriptionPermissionMutex.RUnlock()
|
defer fake.updateSubscriptionPermissionMutex.RUnlock()
|
||||||
fake.updateVideoTrackMutex.RLock()
|
|
||||||
defer fake.updateVideoTrackMutex.RUnlock()
|
|
||||||
copiedInvocations := map[string][][]interface{}{}
|
copiedInvocations := map[string][][]interface{}{}
|
||||||
for key, value := range fake.invocations {
|
for key, value := range fake.invocations {
|
||||||
copiedInvocations[key] = value
|
copiedInvocations[key] = value
|
||||||
|
|||||||
Reference in New Issue
Block a user