participant kinds (#2626)

This commit is contained in:
David Colburn
2024-04-05 12:59:06 -07:00
committed by GitHub
parent e93611eafa
commit fff937a89c
6 changed files with 235 additions and 231 deletions
+19 -14
View File
@@ -325,6 +325,25 @@ func (p *ParticipantImpl) State() livekit.ParticipantInfo_State {
return p.state.Load().(livekit.ParticipantInfo_State) return p.state.Load().(livekit.ParticipantInfo_State)
} }
func (p *ParticipantImpl) Kind() livekit.ParticipantInfo_Kind {
p.lock.RLock()
defer p.lock.RUnlock()
return p.grants.GetParticipantKind()
}
func (p *ParticipantImpl) IsDependent() bool {
p.lock.RLock()
defer p.lock.RUnlock()
switch p.grants.GetParticipantKind() {
case livekit.ParticipantInfo_AGENT, livekit.ParticipantInfo_EGRESS:
return true
default:
return false
}
}
func (p *ParticipantImpl) ProtocolVersion() types.ProtocolVersion { func (p *ParticipantImpl) ProtocolVersion() types.ProtocolVersion {
return p.params.ProtocolVersion return p.params.ProtocolVersion
} }
@@ -1090,20 +1109,6 @@ func (p *ParticipantImpl) Hidden() bool {
return p.hidden.Load() return p.hidden.Load()
} }
func (p *ParticipantImpl) IsRecorder() bool {
p.lock.RLock()
defer p.lock.RUnlock()
return p.grants.Video.Recorder
}
func (p *ParticipantImpl) IsAgent() bool {
p.lock.RLock()
defer p.lock.RUnlock()
return p.grants.Video.Agent
}
func (p *ParticipantImpl) VerifySubscribeParticipantInfo(pID livekit.ParticipantID, version uint32) { func (p *ParticipantImpl) VerifySubscribeParticipantInfo(pID livekit.ParticipantID, version uint32) {
if !p.IsReady() { if !p.IsReady() {
// we have not sent a JoinResponse yet. metadata would be covered in JoinResponse // we have not sent a JoinResponse yet. metadata would be covered in JoinResponse
+8 -8
View File
@@ -318,10 +318,10 @@ func (r *Room) Join(participant types.LocalParticipant, requestSource routing.Me
if r.participants[participant.Identity()] != nil { if r.participants[participant.Identity()] != nil {
return ErrAlreadyJoined return ErrAlreadyJoined
} }
if r.protoRoom.MaxParticipants > 0 && !participant.IsRecorder() { if r.protoRoom.MaxParticipants > 0 && !participant.IsDependent() {
numParticipants := uint32(0) numParticipants := uint32(0)
for _, p := range r.participants { for _, p := range r.participants {
if !p.IsRecorder() { if !p.IsDependent() {
numParticipants++ numParticipants++
} }
} }
@@ -417,7 +417,7 @@ func (r *Room) Join(participant types.LocalParticipant, requestSource routing.Me
"numParticipants", len(r.participants), "numParticipants", len(r.participants),
) )
if participant.IsRecorder() && !r.protoRoom.ActiveRecording { if participant.Kind() == livekit.ParticipantInfo_EGRESS && !r.protoRoom.ActiveRecording {
r.protoRoom.ActiveRecording = true r.protoRoom.ActiveRecording = true
r.protoProxy.MarkDirty(true) r.protoProxy.MarkDirty(true)
} else { } else {
@@ -559,10 +559,10 @@ func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livek
} }
immediateChange := false immediateChange := false
if p.IsRecorder() { if p.Kind() == livekit.ParticipantInfo_EGRESS {
activeRecording := false activeRecording := false
for _, op := range r.participants { for _, op := range r.participants {
if op.IsRecorder() { if op.Kind() == livekit.ParticipantInfo_EGRESS {
activeRecording = true activeRecording = true
break break
} }
@@ -750,7 +750,7 @@ func (r *Room) CloseIfEmpty() {
} }
for _, p := range r.participants { for _, p := range r.participants {
if !p.IsRecorder() { if !p.IsDependent() {
r.lock.Unlock() r.lock.Unlock()
return return
} }
@@ -1226,7 +1226,7 @@ func (r *Room) updateProto() *livekit.Room {
room.NumPublishers = 0 room.NumPublishers = 0
room.NumParticipants = 0 room.NumParticipants = 0
for _, p := range r.GetParticipants() { for _, p := range r.GetParticipants() {
if !p.IsRecorder() { if !p.IsDependent() {
room.NumParticipants++ room.NumParticipants++
} }
if p.IsPublisher() { if p.IsPublisher() {
@@ -1410,7 +1410,7 @@ func (r *Room) simulationCleanupWorker() {
} }
func (r *Room) launchPublisherAgent(p types.Participant) { func (r *Room) launchPublisherAgent(p types.Participant) {
if p == nil || p.IsRecorder() || p.IsAgent() || r.agentClient == nil { if p == nil || p.IsDependent() || r.agentClient == nil {
return return
} }
+2 -3
View File
@@ -245,6 +245,8 @@ type Participant interface {
Identity() livekit.ParticipantIdentity Identity() livekit.ParticipantIdentity
State() livekit.ParticipantInfo_State State() livekit.ParticipantInfo_State
CloseReason() ParticipantCloseReason CloseReason() ParticipantCloseReason
Kind() livekit.ParticipantInfo_Kind
IsDependent() bool
CanSkipBroadcast() bool CanSkipBroadcast() bool
ToProto() *livekit.ParticipantInfo ToProto() *livekit.ParticipantInfo
@@ -265,8 +267,6 @@ type Participant interface {
// permissions // permissions
Hidden() bool Hidden() bool
IsRecorder() bool
IsAgent() bool
Close(sendLeave bool, reason ParticipantCloseReason, isExpectedToResume bool) error Close(sendLeave bool, reason ParticipantCloseReason, isExpectedToResume bool) error
@@ -586,4 +586,3 @@ type OperationMonitor interface {
Check() error Check() error
IsIdle() bool IsIdle() bool
} }
+130 -130
View File
@@ -444,16 +444,6 @@ type FakeLocalParticipant struct {
identityReturnsOnCall map[int]struct { identityReturnsOnCall map[int]struct {
result1 livekit.ParticipantIdentity result1 livekit.ParticipantIdentity
} }
IsAgentStub func() bool
isAgentMutex sync.RWMutex
isAgentArgsForCall []struct {
}
isAgentReturns struct {
result1 bool
}
isAgentReturnsOnCall map[int]struct {
result1 bool
}
IsClosedStub func() bool IsClosedStub func() bool
isClosedMutex sync.RWMutex isClosedMutex sync.RWMutex
isClosedArgsForCall []struct { isClosedArgsForCall []struct {
@@ -464,6 +454,16 @@ type FakeLocalParticipant struct {
isClosedReturnsOnCall map[int]struct { isClosedReturnsOnCall map[int]struct {
result1 bool result1 bool
} }
IsDependentStub func() bool
isDependentMutex sync.RWMutex
isDependentArgsForCall []struct {
}
isDependentReturns struct {
result1 bool
}
isDependentReturnsOnCall map[int]struct {
result1 bool
}
IsDisconnectedStub func() bool IsDisconnectedStub func() bool
isDisconnectedMutex sync.RWMutex isDisconnectedMutex sync.RWMutex
isDisconnectedArgsForCall []struct { isDisconnectedArgsForCall []struct {
@@ -504,16 +504,6 @@ type FakeLocalParticipant struct {
isReadyReturnsOnCall map[int]struct { isReadyReturnsOnCall map[int]struct {
result1 bool result1 bool
} }
IsRecorderStub func() bool
isRecorderMutex sync.RWMutex
isRecorderArgsForCall []struct {
}
isRecorderReturns struct {
result1 bool
}
isRecorderReturnsOnCall map[int]struct {
result1 bool
}
IsSubscribedToStub func(livekit.ParticipantID) bool IsSubscribedToStub func(livekit.ParticipantID) bool
isSubscribedToMutex sync.RWMutex isSubscribedToMutex sync.RWMutex
isSubscribedToArgsForCall []struct { isSubscribedToArgsForCall []struct {
@@ -530,6 +520,16 @@ type FakeLocalParticipant struct {
issueFullReconnectArgsForCall []struct { issueFullReconnectArgsForCall []struct {
arg1 types.ParticipantCloseReason arg1 types.ParticipantCloseReason
} }
KindStub func() livekit.ParticipantInfo_Kind
kindMutex sync.RWMutex
kindArgsForCall []struct {
}
kindReturns struct {
result1 livekit.ParticipantInfo_Kind
}
kindReturnsOnCall map[int]struct {
result1 livekit.ParticipantInfo_Kind
}
MaybeStartMigrationStub func(bool, func()) bool MaybeStartMigrationStub func(bool, func()) bool
maybeStartMigrationMutex sync.RWMutex maybeStartMigrationMutex sync.RWMutex
maybeStartMigrationArgsForCall []struct { maybeStartMigrationArgsForCall []struct {
@@ -3233,59 +3233,6 @@ func (fake *FakeLocalParticipant) IdentityReturnsOnCall(i int, result1 livekit.P
}{result1} }{result1}
} }
func (fake *FakeLocalParticipant) IsAgent() bool {
fake.isAgentMutex.Lock()
ret, specificReturn := fake.isAgentReturnsOnCall[len(fake.isAgentArgsForCall)]
fake.isAgentArgsForCall = append(fake.isAgentArgsForCall, struct {
}{})
stub := fake.IsAgentStub
fakeReturns := fake.isAgentReturns
fake.recordInvocation("IsAgent", []interface{}{})
fake.isAgentMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeLocalParticipant) IsAgentCallCount() int {
fake.isAgentMutex.RLock()
defer fake.isAgentMutex.RUnlock()
return len(fake.isAgentArgsForCall)
}
func (fake *FakeLocalParticipant) IsAgentCalls(stub func() bool) {
fake.isAgentMutex.Lock()
defer fake.isAgentMutex.Unlock()
fake.IsAgentStub = stub
}
func (fake *FakeLocalParticipant) IsAgentReturns(result1 bool) {
fake.isAgentMutex.Lock()
defer fake.isAgentMutex.Unlock()
fake.IsAgentStub = nil
fake.isAgentReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsAgentReturnsOnCall(i int, result1 bool) {
fake.isAgentMutex.Lock()
defer fake.isAgentMutex.Unlock()
fake.IsAgentStub = nil
if fake.isAgentReturnsOnCall == nil {
fake.isAgentReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isAgentReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsClosed() bool { func (fake *FakeLocalParticipant) IsClosed() bool {
fake.isClosedMutex.Lock() fake.isClosedMutex.Lock()
ret, specificReturn := fake.isClosedReturnsOnCall[len(fake.isClosedArgsForCall)] ret, specificReturn := fake.isClosedReturnsOnCall[len(fake.isClosedArgsForCall)]
@@ -3339,6 +3286,59 @@ func (fake *FakeLocalParticipant) IsClosedReturnsOnCall(i int, result1 bool) {
}{result1} }{result1}
} }
func (fake *FakeLocalParticipant) IsDependent() bool {
fake.isDependentMutex.Lock()
ret, specificReturn := fake.isDependentReturnsOnCall[len(fake.isDependentArgsForCall)]
fake.isDependentArgsForCall = append(fake.isDependentArgsForCall, struct {
}{})
stub := fake.IsDependentStub
fakeReturns := fake.isDependentReturns
fake.recordInvocation("IsDependent", []interface{}{})
fake.isDependentMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeLocalParticipant) IsDependentCallCount() int {
fake.isDependentMutex.RLock()
defer fake.isDependentMutex.RUnlock()
return len(fake.isDependentArgsForCall)
}
func (fake *FakeLocalParticipant) IsDependentCalls(stub func() bool) {
fake.isDependentMutex.Lock()
defer fake.isDependentMutex.Unlock()
fake.IsDependentStub = stub
}
func (fake *FakeLocalParticipant) IsDependentReturns(result1 bool) {
fake.isDependentMutex.Lock()
defer fake.isDependentMutex.Unlock()
fake.IsDependentStub = nil
fake.isDependentReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsDependentReturnsOnCall(i int, result1 bool) {
fake.isDependentMutex.Lock()
defer fake.isDependentMutex.Unlock()
fake.IsDependentStub = nil
if fake.isDependentReturnsOnCall == nil {
fake.isDependentReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isDependentReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsDisconnected() bool { func (fake *FakeLocalParticipant) IsDisconnected() bool {
fake.isDisconnectedMutex.Lock() fake.isDisconnectedMutex.Lock()
ret, specificReturn := fake.isDisconnectedReturnsOnCall[len(fake.isDisconnectedArgsForCall)] ret, specificReturn := fake.isDisconnectedReturnsOnCall[len(fake.isDisconnectedArgsForCall)]
@@ -3551,59 +3551,6 @@ func (fake *FakeLocalParticipant) IsReadyReturnsOnCall(i int, result1 bool) {
}{result1} }{result1}
} }
func (fake *FakeLocalParticipant) IsRecorder() bool {
fake.isRecorderMutex.Lock()
ret, specificReturn := fake.isRecorderReturnsOnCall[len(fake.isRecorderArgsForCall)]
fake.isRecorderArgsForCall = append(fake.isRecorderArgsForCall, struct {
}{})
stub := fake.IsRecorderStub
fakeReturns := fake.isRecorderReturns
fake.recordInvocation("IsRecorder", []interface{}{})
fake.isRecorderMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeLocalParticipant) IsRecorderCallCount() int {
fake.isRecorderMutex.RLock()
defer fake.isRecorderMutex.RUnlock()
return len(fake.isRecorderArgsForCall)
}
func (fake *FakeLocalParticipant) IsRecorderCalls(stub func() bool) {
fake.isRecorderMutex.Lock()
defer fake.isRecorderMutex.Unlock()
fake.IsRecorderStub = stub
}
func (fake *FakeLocalParticipant) IsRecorderReturns(result1 bool) {
fake.isRecorderMutex.Lock()
defer fake.isRecorderMutex.Unlock()
fake.IsRecorderStub = nil
fake.isRecorderReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsRecorderReturnsOnCall(i int, result1 bool) {
fake.isRecorderMutex.Lock()
defer fake.isRecorderMutex.Unlock()
fake.IsRecorderStub = nil
if fake.isRecorderReturnsOnCall == nil {
fake.isRecorderReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isRecorderReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeLocalParticipant) IsSubscribedTo(arg1 livekit.ParticipantID) bool { func (fake *FakeLocalParticipant) IsSubscribedTo(arg1 livekit.ParticipantID) bool {
fake.isSubscribedToMutex.Lock() fake.isSubscribedToMutex.Lock()
ret, specificReturn := fake.isSubscribedToReturnsOnCall[len(fake.isSubscribedToArgsForCall)] ret, specificReturn := fake.isSubscribedToReturnsOnCall[len(fake.isSubscribedToArgsForCall)]
@@ -3697,6 +3644,59 @@ func (fake *FakeLocalParticipant) IssueFullReconnectArgsForCall(i int) types.Par
return argsForCall.arg1 return argsForCall.arg1
} }
func (fake *FakeLocalParticipant) Kind() livekit.ParticipantInfo_Kind {
fake.kindMutex.Lock()
ret, specificReturn := fake.kindReturnsOnCall[len(fake.kindArgsForCall)]
fake.kindArgsForCall = append(fake.kindArgsForCall, struct {
}{})
stub := fake.KindStub
fakeReturns := fake.kindReturns
fake.recordInvocation("Kind", []interface{}{})
fake.kindMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeLocalParticipant) KindCallCount() int {
fake.kindMutex.RLock()
defer fake.kindMutex.RUnlock()
return len(fake.kindArgsForCall)
}
func (fake *FakeLocalParticipant) KindCalls(stub func() livekit.ParticipantInfo_Kind) {
fake.kindMutex.Lock()
defer fake.kindMutex.Unlock()
fake.KindStub = stub
}
func (fake *FakeLocalParticipant) KindReturns(result1 livekit.ParticipantInfo_Kind) {
fake.kindMutex.Lock()
defer fake.kindMutex.Unlock()
fake.KindStub = nil
fake.kindReturns = struct {
result1 livekit.ParticipantInfo_Kind
}{result1}
}
func (fake *FakeLocalParticipant) KindReturnsOnCall(i int, result1 livekit.ParticipantInfo_Kind) {
fake.kindMutex.Lock()
defer fake.kindMutex.Unlock()
fake.KindStub = nil
if fake.kindReturnsOnCall == nil {
fake.kindReturnsOnCall = make(map[int]struct {
result1 livekit.ParticipantInfo_Kind
})
}
fake.kindReturnsOnCall[i] = struct {
result1 livekit.ParticipantInfo_Kind
}{result1}
}
func (fake *FakeLocalParticipant) MaybeStartMigration(arg1 bool, arg2 func()) bool { func (fake *FakeLocalParticipant) MaybeStartMigration(arg1 bool, arg2 func()) bool {
fake.maybeStartMigrationMutex.Lock() fake.maybeStartMigrationMutex.Lock()
ret, specificReturn := fake.maybeStartMigrationReturnsOnCall[len(fake.maybeStartMigrationArgsForCall)] ret, specificReturn := fake.maybeStartMigrationReturnsOnCall[len(fake.maybeStartMigrationArgsForCall)]
@@ -6403,10 +6403,10 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
defer fake.iDMutex.RUnlock() defer fake.iDMutex.RUnlock()
fake.identityMutex.RLock() fake.identityMutex.RLock()
defer fake.identityMutex.RUnlock() defer fake.identityMutex.RUnlock()
fake.isAgentMutex.RLock()
defer fake.isAgentMutex.RUnlock()
fake.isClosedMutex.RLock() fake.isClosedMutex.RLock()
defer fake.isClosedMutex.RUnlock() defer fake.isClosedMutex.RUnlock()
fake.isDependentMutex.RLock()
defer fake.isDependentMutex.RUnlock()
fake.isDisconnectedMutex.RLock() fake.isDisconnectedMutex.RLock()
defer fake.isDisconnectedMutex.RUnlock() defer fake.isDisconnectedMutex.RUnlock()
fake.isIdleMutex.RLock() fake.isIdleMutex.RLock()
@@ -6415,12 +6415,12 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
defer fake.isPublisherMutex.RUnlock() defer fake.isPublisherMutex.RUnlock()
fake.isReadyMutex.RLock() fake.isReadyMutex.RLock()
defer fake.isReadyMutex.RUnlock() defer fake.isReadyMutex.RUnlock()
fake.isRecorderMutex.RLock()
defer fake.isRecorderMutex.RUnlock()
fake.isSubscribedToMutex.RLock() fake.isSubscribedToMutex.RLock()
defer fake.isSubscribedToMutex.RUnlock() defer fake.isSubscribedToMutex.RUnlock()
fake.issueFullReconnectMutex.RLock() fake.issueFullReconnectMutex.RLock()
defer fake.issueFullReconnectMutex.RUnlock() defer fake.issueFullReconnectMutex.RUnlock()
fake.kindMutex.RLock()
defer fake.kindMutex.RUnlock()
fake.maybeStartMigrationMutex.RLock() fake.maybeStartMigrationMutex.RLock()
defer fake.maybeStartMigrationMutex.RUnlock() defer fake.maybeStartMigrationMutex.RUnlock()
fake.migrateStateMutex.RLock() fake.migrateStateMutex.RLock()
+75 -75
View File
@@ -128,14 +128,14 @@ type FakeParticipant struct {
identityReturnsOnCall map[int]struct { identityReturnsOnCall map[int]struct {
result1 livekit.ParticipantIdentity result1 livekit.ParticipantIdentity
} }
IsAgentStub func() bool IsDependentStub func() bool
isAgentMutex sync.RWMutex isDependentMutex sync.RWMutex
isAgentArgsForCall []struct { isDependentArgsForCall []struct {
} }
isAgentReturns struct { isDependentReturns struct {
result1 bool result1 bool
} }
isAgentReturnsOnCall map[int]struct { isDependentReturnsOnCall map[int]struct {
result1 bool result1 bool
} }
IsPublisherStub func() bool IsPublisherStub func() bool
@@ -148,15 +148,15 @@ type FakeParticipant struct {
isPublisherReturnsOnCall map[int]struct { isPublisherReturnsOnCall map[int]struct {
result1 bool result1 bool
} }
IsRecorderStub func() bool KindStub func() livekit.ParticipantInfo_Kind
isRecorderMutex sync.RWMutex kindMutex sync.RWMutex
isRecorderArgsForCall []struct { kindArgsForCall []struct {
} }
isRecorderReturns struct { kindReturns struct {
result1 bool result1 livekit.ParticipantInfo_Kind
} }
isRecorderReturnsOnCall map[int]struct { kindReturnsOnCall map[int]struct {
result1 bool result1 livekit.ParticipantInfo_Kind
} }
RemovePublishedTrackStub func(types.MediaTrack, bool, bool) RemovePublishedTrackStub func(types.MediaTrack, bool, bool)
removePublishedTrackMutex sync.RWMutex removePublishedTrackMutex sync.RWMutex
@@ -848,15 +848,15 @@ func (fake *FakeParticipant) IdentityReturnsOnCall(i int, result1 livekit.Partic
}{result1} }{result1}
} }
func (fake *FakeParticipant) IsAgent() bool { func (fake *FakeParticipant) IsDependent() bool {
fake.isAgentMutex.Lock() fake.isDependentMutex.Lock()
ret, specificReturn := fake.isAgentReturnsOnCall[len(fake.isAgentArgsForCall)] ret, specificReturn := fake.isDependentReturnsOnCall[len(fake.isDependentArgsForCall)]
fake.isAgentArgsForCall = append(fake.isAgentArgsForCall, struct { fake.isDependentArgsForCall = append(fake.isDependentArgsForCall, struct {
}{}) }{})
stub := fake.IsAgentStub stub := fake.IsDependentStub
fakeReturns := fake.isAgentReturns fakeReturns := fake.isDependentReturns
fake.recordInvocation("IsAgent", []interface{}{}) fake.recordInvocation("IsDependent", []interface{}{})
fake.isAgentMutex.Unlock() fake.isDependentMutex.Unlock()
if stub != nil { if stub != nil {
return stub() return stub()
} }
@@ -866,37 +866,37 @@ func (fake *FakeParticipant) IsAgent() bool {
return fakeReturns.result1 return fakeReturns.result1
} }
func (fake *FakeParticipant) IsAgentCallCount() int { func (fake *FakeParticipant) IsDependentCallCount() int {
fake.isAgentMutex.RLock() fake.isDependentMutex.RLock()
defer fake.isAgentMutex.RUnlock() defer fake.isDependentMutex.RUnlock()
return len(fake.isAgentArgsForCall) return len(fake.isDependentArgsForCall)
} }
func (fake *FakeParticipant) IsAgentCalls(stub func() bool) { func (fake *FakeParticipant) IsDependentCalls(stub func() bool) {
fake.isAgentMutex.Lock() fake.isDependentMutex.Lock()
defer fake.isAgentMutex.Unlock() defer fake.isDependentMutex.Unlock()
fake.IsAgentStub = stub fake.IsDependentStub = stub
} }
func (fake *FakeParticipant) IsAgentReturns(result1 bool) { func (fake *FakeParticipant) IsDependentReturns(result1 bool) {
fake.isAgentMutex.Lock() fake.isDependentMutex.Lock()
defer fake.isAgentMutex.Unlock() defer fake.isDependentMutex.Unlock()
fake.IsAgentStub = nil fake.IsDependentStub = nil
fake.isAgentReturns = struct { fake.isDependentReturns = struct {
result1 bool result1 bool
}{result1} }{result1}
} }
func (fake *FakeParticipant) IsAgentReturnsOnCall(i int, result1 bool) { func (fake *FakeParticipant) IsDependentReturnsOnCall(i int, result1 bool) {
fake.isAgentMutex.Lock() fake.isDependentMutex.Lock()
defer fake.isAgentMutex.Unlock() defer fake.isDependentMutex.Unlock()
fake.IsAgentStub = nil fake.IsDependentStub = nil
if fake.isAgentReturnsOnCall == nil { if fake.isDependentReturnsOnCall == nil {
fake.isAgentReturnsOnCall = make(map[int]struct { fake.isDependentReturnsOnCall = make(map[int]struct {
result1 bool result1 bool
}) })
} }
fake.isAgentReturnsOnCall[i] = struct { fake.isDependentReturnsOnCall[i] = struct {
result1 bool result1 bool
}{result1} }{result1}
} }
@@ -954,15 +954,15 @@ func (fake *FakeParticipant) IsPublisherReturnsOnCall(i int, result1 bool) {
}{result1} }{result1}
} }
func (fake *FakeParticipant) IsRecorder() bool { func (fake *FakeParticipant) Kind() livekit.ParticipantInfo_Kind {
fake.isRecorderMutex.Lock() fake.kindMutex.Lock()
ret, specificReturn := fake.isRecorderReturnsOnCall[len(fake.isRecorderArgsForCall)] ret, specificReturn := fake.kindReturnsOnCall[len(fake.kindArgsForCall)]
fake.isRecorderArgsForCall = append(fake.isRecorderArgsForCall, struct { fake.kindArgsForCall = append(fake.kindArgsForCall, struct {
}{}) }{})
stub := fake.IsRecorderStub stub := fake.KindStub
fakeReturns := fake.isRecorderReturns fakeReturns := fake.kindReturns
fake.recordInvocation("IsRecorder", []interface{}{}) fake.recordInvocation("Kind", []interface{}{})
fake.isRecorderMutex.Unlock() fake.kindMutex.Unlock()
if stub != nil { if stub != nil {
return stub() return stub()
} }
@@ -972,38 +972,38 @@ func (fake *FakeParticipant) IsRecorder() bool {
return fakeReturns.result1 return fakeReturns.result1
} }
func (fake *FakeParticipant) IsRecorderCallCount() int { func (fake *FakeParticipant) KindCallCount() int {
fake.isRecorderMutex.RLock() fake.kindMutex.RLock()
defer fake.isRecorderMutex.RUnlock() defer fake.kindMutex.RUnlock()
return len(fake.isRecorderArgsForCall) return len(fake.kindArgsForCall)
} }
func (fake *FakeParticipant) IsRecorderCalls(stub func() bool) { func (fake *FakeParticipant) KindCalls(stub func() livekit.ParticipantInfo_Kind) {
fake.isRecorderMutex.Lock() fake.kindMutex.Lock()
defer fake.isRecorderMutex.Unlock() defer fake.kindMutex.Unlock()
fake.IsRecorderStub = stub fake.KindStub = stub
} }
func (fake *FakeParticipant) IsRecorderReturns(result1 bool) { func (fake *FakeParticipant) KindReturns(result1 livekit.ParticipantInfo_Kind) {
fake.isRecorderMutex.Lock() fake.kindMutex.Lock()
defer fake.isRecorderMutex.Unlock() defer fake.kindMutex.Unlock()
fake.IsRecorderStub = nil fake.KindStub = nil
fake.isRecorderReturns = struct { fake.kindReturns = struct {
result1 bool result1 livekit.ParticipantInfo_Kind
}{result1} }{result1}
} }
func (fake *FakeParticipant) IsRecorderReturnsOnCall(i int, result1 bool) { func (fake *FakeParticipant) KindReturnsOnCall(i int, result1 livekit.ParticipantInfo_Kind) {
fake.isRecorderMutex.Lock() fake.kindMutex.Lock()
defer fake.isRecorderMutex.Unlock() defer fake.kindMutex.Unlock()
fake.IsRecorderStub = nil fake.KindStub = nil
if fake.isRecorderReturnsOnCall == nil { if fake.kindReturnsOnCall == nil {
fake.isRecorderReturnsOnCall = make(map[int]struct { fake.kindReturnsOnCall = make(map[int]struct {
result1 bool result1 livekit.ParticipantInfo_Kind
}) })
} }
fake.isRecorderReturnsOnCall[i] = struct { fake.kindReturnsOnCall[i] = struct {
result1 bool result1 livekit.ParticipantInfo_Kind
}{result1} }{result1}
} }
@@ -1416,12 +1416,12 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.iDMutex.RUnlock() defer fake.iDMutex.RUnlock()
fake.identityMutex.RLock() fake.identityMutex.RLock()
defer fake.identityMutex.RUnlock() defer fake.identityMutex.RUnlock()
fake.isAgentMutex.RLock() fake.isDependentMutex.RLock()
defer fake.isAgentMutex.RUnlock() defer fake.isDependentMutex.RUnlock()
fake.isPublisherMutex.RLock() fake.isPublisherMutex.RLock()
defer fake.isPublisherMutex.RUnlock() defer fake.isPublisherMutex.RUnlock()
fake.isRecorderMutex.RLock() fake.kindMutex.RLock()
defer fake.isRecorderMutex.RUnlock() defer fake.kindMutex.RUnlock()
fake.removePublishedTrackMutex.RLock() fake.removePublishedTrackMutex.RLock()
defer fake.removePublishedTrackMutex.RUnlock() defer fake.removePublishedTrackMutex.RUnlock()
fake.setMetadataMutex.RLock() fake.setMetadataMutex.RLock()
+1 -1
View File
@@ -1,6 +1,6 @@
// Code generated by Wire. DO NOT EDIT. // Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire //go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject //go:build !wireinject
// +build !wireinject // +build !wireinject