backwards compatability for IsRecorder (#2647)
* backwards compatability for IsRecorder * regenerate fakes
This commit is contained in:
@@ -332,6 +332,13 @@ func (p *ParticipantImpl) Kind() livekit.ParticipantInfo_Kind {
|
|||||||
return p.grants.GetParticipantKind()
|
return p.grants.GetParticipantKind()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *ParticipantImpl) IsRecorder() bool {
|
||||||
|
p.lock.RLock()
|
||||||
|
defer p.lock.RUnlock()
|
||||||
|
|
||||||
|
return p.grants.GetParticipantKind() == livekit.ParticipantInfo_EGRESS || p.grants.Video.Recorder
|
||||||
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) IsDependent() bool {
|
func (p *ParticipantImpl) IsDependent() bool {
|
||||||
p.lock.RLock()
|
p.lock.RLock()
|
||||||
defer p.lock.RUnlock()
|
defer p.lock.RUnlock()
|
||||||
|
|||||||
+3
-3
@@ -417,7 +417,7 @@ func (r *Room) Join(participant types.LocalParticipant, requestSource routing.Me
|
|||||||
"numParticipants", len(r.participants),
|
"numParticipants", len(r.participants),
|
||||||
)
|
)
|
||||||
|
|
||||||
if participant.Kind() == livekit.ParticipantInfo_EGRESS && !r.protoRoom.ActiveRecording {
|
if participant.IsRecorder() && !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.Kind() == livekit.ParticipantInfo_EGRESS {
|
if p.IsRecorder() {
|
||||||
activeRecording := false
|
activeRecording := false
|
||||||
for _, op := range r.participants {
|
for _, op := range r.participants {
|
||||||
if op.Kind() == livekit.ParticipantInfo_EGRESS {
|
if op.IsRecorder() {
|
||||||
activeRecording = true
|
activeRecording = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ type Participant interface {
|
|||||||
State() livekit.ParticipantInfo_State
|
State() livekit.ParticipantInfo_State
|
||||||
CloseReason() ParticipantCloseReason
|
CloseReason() ParticipantCloseReason
|
||||||
Kind() livekit.ParticipantInfo_Kind
|
Kind() livekit.ParticipantInfo_Kind
|
||||||
|
IsRecorder() bool
|
||||||
IsDependent() bool
|
IsDependent() bool
|
||||||
|
|
||||||
CanSkipBroadcast() bool
|
CanSkipBroadcast() bool
|
||||||
|
|||||||
@@ -504,6 +504,16 @@ 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 {
|
||||||
@@ -3551,6 +3561,59 @@ 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)]
|
||||||
@@ -6415,6 +6478,8 @@ 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()
|
||||||
|
|||||||
@@ -148,6 +148,16 @@ type FakeParticipant struct {
|
|||||||
isPublisherReturnsOnCall map[int]struct {
|
isPublisherReturnsOnCall 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
|
||||||
|
}
|
||||||
KindStub func() livekit.ParticipantInfo_Kind
|
KindStub func() livekit.ParticipantInfo_Kind
|
||||||
kindMutex sync.RWMutex
|
kindMutex sync.RWMutex
|
||||||
kindArgsForCall []struct {
|
kindArgsForCall []struct {
|
||||||
@@ -954,6 +964,59 @@ func (fake *FakeParticipant) IsPublisherReturnsOnCall(i int, result1 bool) {
|
|||||||
}{result1}
|
}{result1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) 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 *FakeParticipant) IsRecorderCallCount() int {
|
||||||
|
fake.isRecorderMutex.RLock()
|
||||||
|
defer fake.isRecorderMutex.RUnlock()
|
||||||
|
return len(fake.isRecorderArgsForCall)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsRecorderCalls(stub func() bool) {
|
||||||
|
fake.isRecorderMutex.Lock()
|
||||||
|
defer fake.isRecorderMutex.Unlock()
|
||||||
|
fake.IsRecorderStub = stub
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) IsRecorderReturns(result1 bool) {
|
||||||
|
fake.isRecorderMutex.Lock()
|
||||||
|
defer fake.isRecorderMutex.Unlock()
|
||||||
|
fake.IsRecorderStub = nil
|
||||||
|
fake.isRecorderReturns = struct {
|
||||||
|
result1 bool
|
||||||
|
}{result1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fake *FakeParticipant) 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 *FakeParticipant) Kind() livekit.ParticipantInfo_Kind {
|
func (fake *FakeParticipant) Kind() livekit.ParticipantInfo_Kind {
|
||||||
fake.kindMutex.Lock()
|
fake.kindMutex.Lock()
|
||||||
ret, specificReturn := fake.kindReturnsOnCall[len(fake.kindArgsForCall)]
|
ret, specificReturn := fake.kindReturnsOnCall[len(fake.kindArgsForCall)]
|
||||||
@@ -1420,6 +1483,8 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
|
|||||||
defer fake.isDependentMutex.RUnlock()
|
defer fake.isDependentMutex.RUnlock()
|
||||||
fake.isPublisherMutex.RLock()
|
fake.isPublisherMutex.RLock()
|
||||||
defer fake.isPublisherMutex.RUnlock()
|
defer fake.isPublisherMutex.RUnlock()
|
||||||
|
fake.isRecorderMutex.RLock()
|
||||||
|
defer fake.isRecorderMutex.RUnlock()
|
||||||
fake.kindMutex.RLock()
|
fake.kindMutex.RLock()
|
||||||
defer fake.kindMutex.RUnlock()
|
defer fake.kindMutex.RUnlock()
|
||||||
fake.removePublishedTrackMutex.RLock()
|
fake.removePublishedTrackMutex.RLock()
|
||||||
|
|||||||
Reference in New Issue
Block a user