add convenience methods to participant (#3016)

* add convenience methods to participant

* tidy
This commit is contained in:
Paul Wells
2024-09-19 00:20:22 -07:00
committed by GitHub
parent 7df6f86693
commit 370f386dd0
5 changed files with 345 additions and 0 deletions
+9
View File
@@ -370,6 +370,11 @@ func (p *ParticipantImpl) IsRecorder() bool {
return grants.GetParticipantKind() == livekit.ParticipantInfo_EGRESS || grants.Video.Recorder
}
func (p *ParticipantImpl) IsAgent() bool {
grants := p.grants.Load()
return grants.GetParticipantKind() == livekit.ParticipantInfo_AGENT || grants.Video.Agent
}
func (p *ParticipantImpl) IsDependent() bool {
grants := p.grants.Load()
switch grants.GetParticipantKind() {
@@ -615,6 +620,10 @@ func (p *ParticipantImpl) CanSkipBroadcast() bool {
return !p.requireBroadcast
}
func (p *ParticipantImpl) VersionNumber() uint32 {
return p.version.Load()
}
func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.TimedVersion) {
if p.dirty.Load() {
p.lock.Lock()