Clean up UpdateVideoLayers (#2685)

This commit is contained in:
Raja Subramanian
2024-04-26 12:21:40 +05:30
committed by GitHub
parent 90b47424b5
commit 79f6506553
11 changed files with 6 additions and 369 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/mediatransportutil v0.0.0-20240416023643-881d3dc5423e
github.com/livekit/protocol v1.12.1-0.20240426044238-2d50a792225e
github.com/livekit/psrpc v0.5.3-0.20240403150641-811331b106d9
github.com/livekit/protocol v1.12.1-0.20240426063020-fd19ad24b86b
github.com/livekit/psrpc v0.5.3-0.20240426045048-8ba067a45715
github.com/mackerelio/go-osstat v0.2.4
github.com/magefile/mage v1.15.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1
+4 -4
View File
@@ -120,10 +120,10 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
github.com/livekit/mediatransportutil v0.0.0-20240416023643-881d3dc5423e h1:ss4VwrouYiDpuNJ9BUTH+WsW+GDdJS70iZp8ii3/0Lc=
github.com/livekit/mediatransportutil v0.0.0-20240416023643-881d3dc5423e/go.mod h1:jwKUCmObuiEDH0iiuJHaGMXwRs3RjrB4G6qqgkr/5oE=
github.com/livekit/protocol v1.12.1-0.20240426044238-2d50a792225e h1:hepBKU/dTHNLLxq+Sc9Z8DdNLi3rjcQ6VlL3CEf9NmE=
github.com/livekit/protocol v1.12.1-0.20240426044238-2d50a792225e/go.mod h1:pnn0Dv+/0K0OFqKHX6J6SreYO1dZxl6tDuAZ1ns8L/w=
github.com/livekit/psrpc v0.5.3-0.20240403150641-811331b106d9 h1:4CngtPIJ58WcQ1sUDGdxJDkTndQpN6M/T8jXvRAd7Oc=
github.com/livekit/psrpc v0.5.3-0.20240403150641-811331b106d9/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
github.com/livekit/protocol v1.12.1-0.20240426063020-fd19ad24b86b h1:hPgkp/LJzhx+U2CHOc68yxGIyfFspagsyupAaqx1Ulw=
github.com/livekit/protocol v1.12.1-0.20240426063020-fd19ad24b86b/go.mod h1:pnn0Dv+/0K0OFqKHX6J6SreYO1dZxl6tDuAZ1ns8L/w=
github.com/livekit/psrpc v0.5.3-0.20240426045048-8ba067a45715 h1:vhDMOe8fxEc/amYTFo799LySPM12Fk3vc+Nc6o4gYZQ=
github.com/livekit/psrpc v0.5.3-0.20240426045048-8ba067a45715/go.mod h1:CQUBSPfYYAaevg1TNCc6/aYsa8DJH4jSRFdCeSZk5u0=
github.com/mackerelio/go-osstat v0.2.4 h1:qxGbdPkFo65PXOb/F/nhDKpF2nGmGaCFDLXoZjJTtUs=
github.com/mackerelio/go-osstat v0.2.4/go.mod h1:Zy+qzGdZs3A9cuIqmgbJvwbmLQH9dJvtio5ZjJTbdlQ=
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=
-29
View File
@@ -702,35 +702,6 @@ func (t *MediaTrackReceiver) UpdateVideoTrack(update *livekit.UpdateLocalVideoTr
t.updateTrackInfoOfReceivers()
}
func (t *MediaTrackReceiver) UpdateVideoLayers(layers []*livekit.VideoLayer) {
t.lock.Lock()
// set video layer ssrc info
for i, ci := range t.trackInfo.Codecs {
originLayers := ci.Layers
ci.Layers = []*livekit.VideoLayer{}
for layerIdx, layer := range layers {
ci.Layers = append(ci.Layers, proto.Clone(layer).(*livekit.VideoLayer))
for _, l := range originLayers {
if l.Quality == ci.Layers[layerIdx].Quality {
if l.Ssrc != 0 {
ci.Layers[layerIdx].Ssrc = l.Ssrc
}
break
}
}
}
// for client don't use simulcast codecs (old client version or single codec)
if i == 0 {
t.trackInfo.Layers = ci.Layers
}
}
t.lock.Unlock()
t.updateTrackInfoOfReceivers()
t.MediaTrackSubscriptions.UpdateVideoLayers()
}
func (t *MediaTrackReceiver) TrackInfo() *livekit.TrackInfo {
t.lock.RLock()
defer t.lock.RUnlock()
-4
View File
@@ -710,10 +710,6 @@ func (r *Room) UpdateSubscriptionPermission(participant types.LocalParticipant,
return nil
}
func (r *Room) UpdateVideoLayers(participant types.Participant, updateVideoLayers *livekit.UpdateVideoLayers) error {
return participant.UpdateVideoLayers(updateVideoLayers)
}
func (r *Room) ResolveMediaTrackForSubscriber(subIdentity livekit.ParticipantIdentity, trackID livekit.TrackID) types.MediaResolverResult {
res := types.MediaResolverResult{}
-3
View File
@@ -279,7 +279,6 @@ type Participant interface {
timedVersion utils.TimedVersion,
resolverBySid func(participantID livekit.ParticipantID) LocalParticipant,
) error
UpdateVideoLayers(updateVideoLayers *livekit.UpdateVideoLayers) error
UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error
UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error
@@ -436,7 +435,6 @@ type Room interface {
UpdateSubscriptionPermission(participant LocalParticipant, permissions *livekit.SubscriptionPermission) error
SyncState(participant LocalParticipant, state *livekit.SyncState) error
SimulateScenario(participant LocalParticipant, scenario *livekit.SimulateScenario) error
UpdateVideoLayers(participant Participant, updateVideoLayers *livekit.UpdateVideoLayers) error
ResolveMediaTrackForSubscriber(subIdentity livekit.ParticipantIdentity, trackID livekit.TrackID) MediaResolverResult
GetLocalParticipants() []LocalParticipant
UpdateParticipantMetadata(participant LocalParticipant, name string, metadata string)
@@ -464,7 +462,6 @@ type MediaTrack interface {
IsMuted() bool
SetMuted(muted bool)
UpdateVideoLayers(layers []*livekit.VideoLayer)
IsSimulcast() bool
GetAudioLevel() (level float64, active bool)
@@ -342,11 +342,6 @@ type FakeLocalMediaTrack struct {
updateTrackInfoArgsForCall []struct {
arg1 *livekit.TrackInfo
}
UpdateVideoLayersStub func([]*livekit.VideoLayer)
updateVideoLayersMutex sync.RWMutex
updateVideoLayersArgsForCall []struct {
arg1 []*livekit.VideoLayer
}
UpdateVideoTrackStub func(*livekit.UpdateLocalVideoTrack)
updateVideoTrackMutex sync.RWMutex
updateVideoTrackArgsForCall []struct {
@@ -2151,43 +2146,6 @@ func (fake *FakeLocalMediaTrack) UpdateTrackInfoArgsForCall(i int) *livekit.Trac
return argsForCall.arg1
}
func (fake *FakeLocalMediaTrack) UpdateVideoLayers(arg1 []*livekit.VideoLayer) {
var arg1Copy []*livekit.VideoLayer
if arg1 != nil {
arg1Copy = make([]*livekit.VideoLayer, len(arg1))
copy(arg1Copy, arg1)
}
fake.updateVideoLayersMutex.Lock()
fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct {
arg1 []*livekit.VideoLayer
}{arg1Copy})
stub := fake.UpdateVideoLayersStub
fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1Copy})
fake.updateVideoLayersMutex.Unlock()
if stub != nil {
fake.UpdateVideoLayersStub(arg1)
}
}
func (fake *FakeLocalMediaTrack) UpdateVideoLayersCallCount() int {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
return len(fake.updateVideoLayersArgsForCall)
}
func (fake *FakeLocalMediaTrack) UpdateVideoLayersCalls(stub func([]*livekit.VideoLayer)) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = stub
}
func (fake *FakeLocalMediaTrack) UpdateVideoLayersArgsForCall(i int) []*livekit.VideoLayer {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
argsForCall := fake.updateVideoLayersArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeLocalMediaTrack) UpdateVideoTrack(arg1 *livekit.UpdateLocalVideoTrack) {
fake.updateVideoTrackMutex.Lock()
fake.updateVideoTrackArgsForCall = append(fake.updateVideoTrackArgsForCall, struct {
@@ -2297,8 +2255,6 @@ func (fake *FakeLocalMediaTrack) Invocations() map[string][][]interface{} {
defer fake.updateAudioTrackMutex.RUnlock()
fake.updateTrackInfoMutex.RLock()
defer fake.updateTrackInfoMutex.RUnlock()
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
@@ -986,17 +986,6 @@ type FakeLocalParticipant struct {
updateSubscriptionPermissionReturnsOnCall map[int]struct {
result1 error
}
UpdateVideoLayersStub func(*livekit.UpdateVideoLayers) error
updateVideoLayersMutex sync.RWMutex
updateVideoLayersArgsForCall []struct {
arg1 *livekit.UpdateVideoLayers
}
updateVideoLayersReturns struct {
result1 error
}
updateVideoLayersReturnsOnCall map[int]struct {
result1 error
}
UpdateVideoTrackStub func(*livekit.UpdateLocalVideoTrack) error
updateVideoTrackMutex sync.RWMutex
updateVideoTrackArgsForCall []struct {
@@ -6300,67 +6289,6 @@ func (fake *FakeLocalParticipant) UpdateSubscriptionPermissionReturnsOnCall(i in
}{result1}
}
func (fake *FakeLocalParticipant) UpdateVideoLayers(arg1 *livekit.UpdateVideoLayers) error {
fake.updateVideoLayersMutex.Lock()
ret, specificReturn := fake.updateVideoLayersReturnsOnCall[len(fake.updateVideoLayersArgsForCall)]
fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct {
arg1 *livekit.UpdateVideoLayers
}{arg1})
stub := fake.UpdateVideoLayersStub
fakeReturns := fake.updateVideoLayersReturns
fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1})
fake.updateVideoLayersMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeLocalParticipant) UpdateVideoLayersCallCount() int {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
return len(fake.updateVideoLayersArgsForCall)
}
func (fake *FakeLocalParticipant) UpdateVideoLayersCalls(stub func(*livekit.UpdateVideoLayers) error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = stub
}
func (fake *FakeLocalParticipant) UpdateVideoLayersArgsForCall(i int) *livekit.UpdateVideoLayers {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
argsForCall := fake.updateVideoLayersArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeLocalParticipant) UpdateVideoLayersReturns(result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
fake.updateVideoLayersReturns = struct {
result1 error
}{result1}
}
func (fake *FakeLocalParticipant) UpdateVideoLayersReturnsOnCall(i int, result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
if fake.updateVideoLayersReturnsOnCall == nil {
fake.updateVideoLayersReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.updateVideoLayersReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeLocalParticipant) UpdateVideoTrack(arg1 *livekit.UpdateLocalVideoTrack) error {
fake.updateVideoTrackMutex.Lock()
ret, specificReturn := fake.updateVideoTrackReturnsOnCall[len(fake.updateVideoTrackArgsForCall)]
@@ -6807,8 +6735,6 @@ func (fake *FakeLocalParticipant) Invocations() map[string][][]interface{} {
defer fake.updateSubscribedTrackSettingsMutex.RUnlock()
fake.updateSubscriptionPermissionMutex.RLock()
defer fake.updateSubscriptionPermissionMutex.RUnlock()
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
fake.verifySubscribeParticipantInfoMutex.RLock()
@@ -278,11 +278,6 @@ type FakeMediaTrack struct {
updateTrackInfoArgsForCall []struct {
arg1 *livekit.TrackInfo
}
UpdateVideoLayersStub func([]*livekit.VideoLayer)
updateVideoLayersMutex sync.RWMutex
updateVideoLayersArgsForCall []struct {
arg1 []*livekit.VideoLayer
}
UpdateVideoTrackStub func(*livekit.UpdateLocalVideoTrack)
updateVideoTrackMutex sync.RWMutex
updateVideoTrackArgsForCall []struct {
@@ -1737,43 +1732,6 @@ func (fake *FakeMediaTrack) UpdateTrackInfoArgsForCall(i int) *livekit.TrackInfo
return argsForCall.arg1
}
func (fake *FakeMediaTrack) UpdateVideoLayers(arg1 []*livekit.VideoLayer) {
var arg1Copy []*livekit.VideoLayer
if arg1 != nil {
arg1Copy = make([]*livekit.VideoLayer, len(arg1))
copy(arg1Copy, arg1)
}
fake.updateVideoLayersMutex.Lock()
fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct {
arg1 []*livekit.VideoLayer
}{arg1Copy})
stub := fake.UpdateVideoLayersStub
fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1Copy})
fake.updateVideoLayersMutex.Unlock()
if stub != nil {
fake.UpdateVideoLayersStub(arg1)
}
}
func (fake *FakeMediaTrack) UpdateVideoLayersCallCount() int {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
return len(fake.updateVideoLayersArgsForCall)
}
func (fake *FakeMediaTrack) UpdateVideoLayersCalls(stub func([]*livekit.VideoLayer)) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = stub
}
func (fake *FakeMediaTrack) UpdateVideoLayersArgsForCall(i int) []*livekit.VideoLayer {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
argsForCall := fake.updateVideoLayersArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeMediaTrack) UpdateVideoTrack(arg1 *livekit.UpdateLocalVideoTrack) {
fake.updateVideoTrackMutex.Lock()
fake.updateVideoTrackArgsForCall = append(fake.updateVideoTrackArgsForCall, struct {
@@ -1867,8 +1825,6 @@ func (fake *FakeMediaTrack) Invocations() map[string][][]interface{} {
defer fake.updateAudioTrackMutex.RUnlock()
fake.updateTrackInfoMutex.RLock()
defer fake.updateTrackInfoMutex.RUnlock()
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
@@ -241,17 +241,6 @@ type FakeParticipant struct {
updateSubscriptionPermissionReturnsOnCall map[int]struct {
result1 error
}
UpdateVideoLayersStub func(*livekit.UpdateVideoLayers) error
updateVideoLayersMutex sync.RWMutex
updateVideoLayersArgsForCall []struct {
arg1 *livekit.UpdateVideoLayers
}
updateVideoLayersReturns struct {
result1 error
}
updateVideoLayersReturnsOnCall map[int]struct {
result1 error
}
UpdateVideoTrackStub func(*livekit.UpdateLocalVideoTrack) error
updateVideoTrackMutex sync.RWMutex
updateVideoTrackArgsForCall []struct {
@@ -1476,67 +1465,6 @@ func (fake *FakeParticipant) UpdateSubscriptionPermissionReturnsOnCall(i int, re
}{result1}
}
func (fake *FakeParticipant) UpdateVideoLayers(arg1 *livekit.UpdateVideoLayers) error {
fake.updateVideoLayersMutex.Lock()
ret, specificReturn := fake.updateVideoLayersReturnsOnCall[len(fake.updateVideoLayersArgsForCall)]
fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct {
arg1 *livekit.UpdateVideoLayers
}{arg1})
stub := fake.UpdateVideoLayersStub
fakeReturns := fake.updateVideoLayersReturns
fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1})
fake.updateVideoLayersMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeParticipant) UpdateVideoLayersCallCount() int {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
return len(fake.updateVideoLayersArgsForCall)
}
func (fake *FakeParticipant) UpdateVideoLayersCalls(stub func(*livekit.UpdateVideoLayers) error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = stub
}
func (fake *FakeParticipant) UpdateVideoLayersArgsForCall(i int) *livekit.UpdateVideoLayers {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
argsForCall := fake.updateVideoLayersArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeParticipant) UpdateVideoLayersReturns(result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
fake.updateVideoLayersReturns = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) UpdateVideoLayersReturnsOnCall(i int, result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
if fake.updateVideoLayersReturnsOnCall == nil {
fake.updateVideoLayersReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.updateVideoLayersReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeParticipant) UpdateVideoTrack(arg1 *livekit.UpdateLocalVideoTrack) error {
fake.updateVideoTrackMutex.Lock()
ret, specificReturn := fake.updateVideoTrackReturnsOnCall[len(fake.updateVideoTrackArgsForCall)]
@@ -1647,8 +1575,6 @@ func (fake *FakeParticipant) Invocations() map[string][][]interface{} {
defer fake.updateAudioTrackMutex.RUnlock()
fake.updateSubscriptionPermissionMutex.RLock()
defer fake.updateSubscriptionPermissionMutex.RUnlock()
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
fake.updateVideoTrackMutex.RLock()
defer fake.updateVideoTrackMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
-76
View File
@@ -109,18 +109,6 @@ type FakeRoom struct {
arg3 []*livekit.ParticipantTracks
arg4 bool
}
UpdateVideoLayersStub func(types.Participant, *livekit.UpdateVideoLayers) error
updateVideoLayersMutex sync.RWMutex
updateVideoLayersArgsForCall []struct {
arg1 types.Participant
arg2 *livekit.UpdateVideoLayers
}
updateVideoLayersReturns struct {
result1 error
}
updateVideoLayersReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
@@ -645,68 +633,6 @@ func (fake *FakeRoom) UpdateSubscriptionsArgsForCall(i int) (types.LocalParticip
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
}
func (fake *FakeRoom) UpdateVideoLayers(arg1 types.Participant, arg2 *livekit.UpdateVideoLayers) error {
fake.updateVideoLayersMutex.Lock()
ret, specificReturn := fake.updateVideoLayersReturnsOnCall[len(fake.updateVideoLayersArgsForCall)]
fake.updateVideoLayersArgsForCall = append(fake.updateVideoLayersArgsForCall, struct {
arg1 types.Participant
arg2 *livekit.UpdateVideoLayers
}{arg1, arg2})
stub := fake.UpdateVideoLayersStub
fakeReturns := fake.updateVideoLayersReturns
fake.recordInvocation("UpdateVideoLayers", []interface{}{arg1, arg2})
fake.updateVideoLayersMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeRoom) UpdateVideoLayersCallCount() int {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
return len(fake.updateVideoLayersArgsForCall)
}
func (fake *FakeRoom) UpdateVideoLayersCalls(stub func(types.Participant, *livekit.UpdateVideoLayers) error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = stub
}
func (fake *FakeRoom) UpdateVideoLayersArgsForCall(i int) (types.Participant, *livekit.UpdateVideoLayers) {
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
argsForCall := fake.updateVideoLayersArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeRoom) UpdateVideoLayersReturns(result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
fake.updateVideoLayersReturns = struct {
result1 error
}{result1}
}
func (fake *FakeRoom) UpdateVideoLayersReturnsOnCall(i int, result1 error) {
fake.updateVideoLayersMutex.Lock()
defer fake.updateVideoLayersMutex.Unlock()
fake.UpdateVideoLayersStub = nil
if fake.updateVideoLayersReturnsOnCall == nil {
fake.updateVideoLayersReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.updateVideoLayersReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeRoom) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
@@ -730,8 +656,6 @@ func (fake *FakeRoom) Invocations() map[string][][]interface{} {
defer fake.updateSubscriptionPermissionMutex.RUnlock()
fake.updateSubscriptionsMutex.RLock()
defer fake.updateSubscriptionsMutex.RUnlock()
fake.updateVideoLayersMutex.RLock()
defer fake.updateVideoLayersMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
-15
View File
@@ -239,21 +239,6 @@ func (u *UpTrackManager) HasPermission(trackID livekit.TrackID, subIdentity live
return u.hasPermissionLocked(trackID, subIdentity)
}
func (u *UpTrackManager) UpdateVideoLayers(updateVideoLayers *livekit.UpdateVideoLayers) error {
track := u.GetPublishedTrack(livekit.TrackID(updateVideoLayers.TrackSid))
if track == nil {
u.params.Logger.Warnw("could not find track", nil, "trackID", livekit.TrackID(updateVideoLayers.TrackSid))
return errors.New("could not find published track")
}
track.UpdateVideoLayers(updateVideoLayers.Layers)
if u.onTrackUpdated != nil {
u.onTrackUpdated(track)
}
return nil
}
func (u *UpTrackManager) UpdateAudioTrack(update *livekit.UpdateLocalAudioTrack) error {
track := u.GetPublishedTrack(livekit.TrackID(update.TrackSid))
if track == nil {