Cache RTPStats and seed on re-use (#1080)
* Cache RTPStats and seed on re-use When a cached down track is re-used, RTPStats was not cached. This caused sender reports getting out-of-sync with the remote side. Cache RTPStats and seed it on re-use. * staticcheck
This commit is contained in:
@@ -64,6 +64,7 @@ func NewMediaTrack(params MediaTrackParams) *MediaTrack {
|
||||
t.MediaTrackReceiver = NewMediaTrackReceiver(MediaTrackReceiverParams{
|
||||
TrackInfo: params.TrackInfo,
|
||||
MediaTrack: t,
|
||||
IsRelayed: false,
|
||||
ParticipantID: params.ParticipantID,
|
||||
ParticipantIdentity: params.ParticipantIdentity,
|
||||
ParticipantVersion: params.ParticipantVersion,
|
||||
|
||||
@@ -65,6 +65,7 @@ func (r *simulcastReceiver) Priority() int {
|
||||
type MediaTrackReceiverParams struct {
|
||||
TrackInfo *livekit.TrackInfo
|
||||
MediaTrack types.MediaTrack
|
||||
IsRelayed bool
|
||||
ParticipantID livekit.ParticipantID
|
||||
ParticipantIdentity livekit.ParticipantIdentity
|
||||
ParticipantVersion uint32
|
||||
@@ -108,6 +109,7 @@ func NewMediaTrackReceiver(params MediaTrackReceiverParams) *MediaTrackReceiver
|
||||
|
||||
t.MediaTrackSubscriptions = NewMediaTrackSubscriptions(MediaTrackSubscriptionsParams{
|
||||
MediaTrack: params.MediaTrack,
|
||||
IsRelayed: params.IsRelayed,
|
||||
BufferFactory: params.BufferFactory,
|
||||
ReceiverConfig: params.ReceiverConfig,
|
||||
SubscriberConfig: params.SubscriberConfig,
|
||||
@@ -429,7 +431,7 @@ func (t *MediaTrackReceiver) AddSubscriber(sub types.LocalParticipant) error {
|
||||
t.addPendingSubscribeOp(sub.ID())
|
||||
|
||||
trackID := t.ID()
|
||||
sub.EnqueueSubscribeTrack(trackID, t.addSubscriber)
|
||||
sub.EnqueueSubscribeTrack(trackID, t.params.IsRelayed, t.addSubscriber)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -499,7 +501,7 @@ func (t *MediaTrackReceiver) RemoveSubscriber(subscriberID livekit.ParticipantID
|
||||
sub := subTrack.Subscriber()
|
||||
t.addPendingSubscribeOp(sub.ID())
|
||||
|
||||
sub.EnqueueUnsubscribeTrack(subTrack.ID(), willBeResumed, t.removeSubscriber)
|
||||
sub.EnqueueUnsubscribeTrack(subTrack.ID(), t.params.IsRelayed, willBeResumed, t.removeSubscriber)
|
||||
}
|
||||
|
||||
func (t *MediaTrackReceiver) removeSubscriber(subscriberID livekit.ParticipantID, willBeResumed bool) (err error) {
|
||||
|
||||
@@ -37,6 +37,7 @@ type MediaTrackSubscriptions struct {
|
||||
|
||||
type MediaTrackSubscriptionsParams struct {
|
||||
MediaTrack types.MediaTrack
|
||||
IsRelayed bool
|
||||
|
||||
BufferFactory *buffer.Factory
|
||||
ReceiverConfig ReceiverConfig
|
||||
@@ -111,7 +112,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
||||
t.params.BufferFactory,
|
||||
subscriberID,
|
||||
t.params.ReceiverConfig.PacketBufferSize,
|
||||
LoggerWithTrack(sub.GetLogger(), trackID),
|
||||
LoggerWithTrack(sub.GetLogger(), trackID, t.params.IsRelayed),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -133,11 +134,11 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
||||
|
||||
// Bind callback can happen from replaceTrack, so set it up early
|
||||
var reusingTransceiver atomic.Bool
|
||||
var forwarderState sfu.ForwarderState
|
||||
var dtState sfu.DownTrackState
|
||||
downTrack.OnBind(func() {
|
||||
wr.DetermineReceiver(downTrack.Codec())
|
||||
if reusingTransceiver.Load() {
|
||||
downTrack.SeedForwarderState(forwarderState)
|
||||
downTrack.SeedState(dtState)
|
||||
}
|
||||
if err = wr.AddDownTrack(downTrack); err != nil {
|
||||
sub.GetLogger().Errorw(
|
||||
@@ -173,7 +174,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
||||
// try cached RTP senders for a chance to replace track
|
||||
var existingTransceiver *webrtc.RTPTransceiver
|
||||
replacedTrack := false
|
||||
existingTransceiver, forwarderState = sub.GetCachedDownTrack(trackID)
|
||||
existingTransceiver, dtState = sub.GetCachedDownTrack(trackID)
|
||||
if existingTransceiver != nil {
|
||||
reusingTransceiver.Store(true)
|
||||
rtpSender := existingTransceiver.Sender()
|
||||
@@ -286,7 +287,7 @@ func (t *MediaTrackSubscriptions) closeSubscribedTrack(subTrack types.Subscribed
|
||||
tr := dt.GetTransceiver()
|
||||
if tr != nil {
|
||||
sub := subTrack.Subscriber()
|
||||
sub.CacheDownTrack(subTrack.ID(), tr, dt.GetForwarderState())
|
||||
sub.CacheDownTrack(subTrack.ID(), tr, dt.GetState())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -45,7 +45,7 @@ type pendingTrackInfo struct {
|
||||
|
||||
type downTrackState struct {
|
||||
transceiver *webrtc.RTPTransceiver
|
||||
forwarder sfu.ForwarderState
|
||||
downTrack sfu.DownTrackState
|
||||
}
|
||||
|
||||
type SubscribeRequestType int
|
||||
@@ -1754,7 +1754,7 @@ func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *liv
|
||||
AudioConfig: p.params.AudioConfig,
|
||||
VideoConfig: p.params.VideoConfig,
|
||||
Telemetry: p.params.Telemetry,
|
||||
Logger: LoggerWithTrack(p.params.Logger, livekit.TrackID(ti.Sid)),
|
||||
Logger: LoggerWithTrack(p.params.Logger, livekit.TrackID(ti.Sid), false),
|
||||
SubscriberConfig: p.params.Config.Subscriber,
|
||||
PLIThrottleConfig: p.params.PLIThrottleConfig,
|
||||
SimTracks: p.params.SimTracks,
|
||||
@@ -2027,12 +2027,12 @@ func (p *ParticipantImpl) setDowntracksConnected() {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, forwarderState sfu.ForwarderState) {
|
||||
func (p *ParticipantImpl) CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, downTrack sfu.DownTrackState) {
|
||||
p.lock.Lock()
|
||||
if existing := p.cachedDownTracks[trackID]; existing != nil && existing.transceiver != rtpTransceiver {
|
||||
p.params.Logger.Infow("cached transceiver changed", "trackID", trackID)
|
||||
}
|
||||
p.cachedDownTracks[trackID] = &downTrackState{transceiver: rtpTransceiver, forwarder: forwarderState}
|
||||
p.cachedDownTracks[trackID] = &downTrackState{transceiver: rtpTransceiver, downTrack: downTrack}
|
||||
p.lock.Unlock()
|
||||
}
|
||||
|
||||
@@ -2047,16 +2047,16 @@ func (p *ParticipantImpl) UncacheDownTrack(rtpTransceiver *webrtc.RTPTransceiver
|
||||
p.lock.Unlock()
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.ForwarderState) {
|
||||
func (p *ParticipantImpl) GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState) {
|
||||
p.lock.RLock()
|
||||
defer p.lock.RUnlock()
|
||||
|
||||
dts := p.cachedDownTracks[trackID]
|
||||
if dts != nil {
|
||||
return dts.transceiver, dts.forwarder
|
||||
return dts.transceiver, dts.downTrack
|
||||
}
|
||||
|
||||
return nil, sfu.ForwarderState{}
|
||||
return nil, sfu.DownTrackState{}
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
||||
@@ -2075,8 +2075,8 @@ func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
||||
p.supervisor.Stop()
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, f func(sub types.LocalParticipant) error) {
|
||||
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID)
|
||||
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub types.LocalParticipant) error) {
|
||||
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
|
||||
|
||||
p.supervisor.UpdateSubscription(trackID, true)
|
||||
|
||||
@@ -2090,8 +2090,8 @@ func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, f func(
|
||||
go p.ProcessSubscriptionRequestsQueue(trackID)
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) EnqueueUnsubscribeTrack(trackID livekit.TrackID, willBeResumed bool, f func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
p.params.Logger.Debugw("queuing unsubscribe", "trackID", trackID)
|
||||
func (p *ParticipantImpl) EnqueueUnsubscribeTrack(trackID livekit.TrackID, isRelayed bool, willBeResumed bool, f func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
p.params.Logger.Debugw("queuing unsubscribe", "trackID", trackID, "relayed", isRelayed)
|
||||
|
||||
p.supervisor.UpdateSubscription(trackID, false)
|
||||
|
||||
|
||||
@@ -308,12 +308,12 @@ type LocalParticipant interface {
|
||||
|
||||
UpdateRTT(rtt uint32)
|
||||
|
||||
CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, forwarderState sfu.ForwarderState)
|
||||
CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, downTrackState sfu.DownTrackState)
|
||||
UncacheDownTrack(rtpTransceiver *webrtc.RTPTransceiver)
|
||||
GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.ForwarderState)
|
||||
GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)
|
||||
|
||||
EnqueueSubscribeTrack(trackID livekit.TrackID, f func(sub LocalParticipant) error)
|
||||
EnqueueUnsubscribeTrack(trackID livekit.TrackID, willBeResumed bool, f func(subscriberID livekit.ParticipantID, willBeResumed bool) error)
|
||||
EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub LocalParticipant) error)
|
||||
EnqueueUnsubscribeTrack(trackID livekit.TrackID, isRelayed bool, willBeResumed bool, f func(subscriberID livekit.ParticipantID, willBeResumed bool) error)
|
||||
ProcessSubscriptionRequestsQueue(trackID livekit.TrackID)
|
||||
ClearInProgressAndProcessSubscriptionRequestsQueue(trackID livekit.TrackID)
|
||||
|
||||
|
||||
@@ -75,12 +75,12 @@ type FakeLocalParticipant struct {
|
||||
result2 *webrtc.RTPTransceiver
|
||||
result3 error
|
||||
}
|
||||
CacheDownTrackStub func(livekit.TrackID, *webrtc.RTPTransceiver, sfu.ForwarderState)
|
||||
CacheDownTrackStub func(livekit.TrackID, *webrtc.RTPTransceiver, sfu.DownTrackState)
|
||||
cacheDownTrackMutex sync.RWMutex
|
||||
cacheDownTrackArgsForCall []struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 *webrtc.RTPTransceiver
|
||||
arg3 sfu.ForwarderState
|
||||
arg3 sfu.DownTrackState
|
||||
}
|
||||
CanPublishStub func() bool
|
||||
canPublishMutex sync.RWMutex
|
||||
@@ -163,18 +163,20 @@ type FakeLocalParticipant struct {
|
||||
debugInfoReturnsOnCall map[int]struct {
|
||||
result1 map[string]interface{}
|
||||
}
|
||||
EnqueueSubscribeTrackStub func(livekit.TrackID, func(sub types.LocalParticipant) error)
|
||||
EnqueueSubscribeTrackStub func(livekit.TrackID, bool, func(sub types.LocalParticipant) error)
|
||||
enqueueSubscribeTrackMutex sync.RWMutex
|
||||
enqueueSubscribeTrackArgsForCall []struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 func(sub types.LocalParticipant) error
|
||||
arg2 bool
|
||||
arg3 func(sub types.LocalParticipant) error
|
||||
}
|
||||
EnqueueUnsubscribeTrackStub func(livekit.TrackID, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error)
|
||||
EnqueueUnsubscribeTrackStub func(livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error)
|
||||
enqueueUnsubscribeTrackMutex sync.RWMutex
|
||||
enqueueUnsubscribeTrackArgsForCall []struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 bool
|
||||
arg3 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||
arg3 bool
|
||||
arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||
}
|
||||
GetAdaptiveStreamStub func() bool
|
||||
getAdaptiveStreamMutex sync.RWMutex
|
||||
@@ -198,18 +200,18 @@ type FakeLocalParticipant struct {
|
||||
result1 float64
|
||||
result2 bool
|
||||
}
|
||||
GetCachedDownTrackStub func(livekit.TrackID) (*webrtc.RTPTransceiver, sfu.ForwarderState)
|
||||
GetCachedDownTrackStub func(livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)
|
||||
getCachedDownTrackMutex sync.RWMutex
|
||||
getCachedDownTrackArgsForCall []struct {
|
||||
arg1 livekit.TrackID
|
||||
}
|
||||
getCachedDownTrackReturns struct {
|
||||
result1 *webrtc.RTPTransceiver
|
||||
result2 sfu.ForwarderState
|
||||
result2 sfu.DownTrackState
|
||||
}
|
||||
getCachedDownTrackReturnsOnCall map[int]struct {
|
||||
result1 *webrtc.RTPTransceiver
|
||||
result2 sfu.ForwarderState
|
||||
result2 sfu.DownTrackState
|
||||
}
|
||||
GetClientConfigurationStub func() *livekit.ClientConfiguration
|
||||
getClientConfigurationMutex sync.RWMutex
|
||||
@@ -1044,12 +1046,12 @@ func (fake *FakeLocalParticipant) AddTransceiverFromTrackToSubscriberReturnsOnCa
|
||||
}{result1, result2, result3}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) CacheDownTrack(arg1 livekit.TrackID, arg2 *webrtc.RTPTransceiver, arg3 sfu.ForwarderState) {
|
||||
func (fake *FakeLocalParticipant) CacheDownTrack(arg1 livekit.TrackID, arg2 *webrtc.RTPTransceiver, arg3 sfu.DownTrackState) {
|
||||
fake.cacheDownTrackMutex.Lock()
|
||||
fake.cacheDownTrackArgsForCall = append(fake.cacheDownTrackArgsForCall, struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 *webrtc.RTPTransceiver
|
||||
arg3 sfu.ForwarderState
|
||||
arg3 sfu.DownTrackState
|
||||
}{arg1, arg2, arg3})
|
||||
stub := fake.CacheDownTrackStub
|
||||
fake.recordInvocation("CacheDownTrack", []interface{}{arg1, arg2, arg3})
|
||||
@@ -1065,13 +1067,13 @@ func (fake *FakeLocalParticipant) CacheDownTrackCallCount() int {
|
||||
return len(fake.cacheDownTrackArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) CacheDownTrackCalls(stub func(livekit.TrackID, *webrtc.RTPTransceiver, sfu.ForwarderState)) {
|
||||
func (fake *FakeLocalParticipant) CacheDownTrackCalls(stub func(livekit.TrackID, *webrtc.RTPTransceiver, sfu.DownTrackState)) {
|
||||
fake.cacheDownTrackMutex.Lock()
|
||||
defer fake.cacheDownTrackMutex.Unlock()
|
||||
fake.CacheDownTrackStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) CacheDownTrackArgsForCall(i int) (livekit.TrackID, *webrtc.RTPTransceiver, sfu.ForwarderState) {
|
||||
func (fake *FakeLocalParticipant) CacheDownTrackArgsForCall(i int) (livekit.TrackID, *webrtc.RTPTransceiver, sfu.DownTrackState) {
|
||||
fake.cacheDownTrackMutex.RLock()
|
||||
defer fake.cacheDownTrackMutex.RUnlock()
|
||||
argsForCall := fake.cacheDownTrackArgsForCall[i]
|
||||
@@ -1514,17 +1516,18 @@ func (fake *FakeLocalParticipant) DebugInfoReturnsOnCall(i int, result1 map[stri
|
||||
}{result1}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrack(arg1 livekit.TrackID, arg2 func(sub types.LocalParticipant) error) {
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrack(arg1 livekit.TrackID, arg2 bool, arg3 func(sub types.LocalParticipant) error) {
|
||||
fake.enqueueSubscribeTrackMutex.Lock()
|
||||
fake.enqueueSubscribeTrackArgsForCall = append(fake.enqueueSubscribeTrackArgsForCall, struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 func(sub types.LocalParticipant) error
|
||||
}{arg1, arg2})
|
||||
arg2 bool
|
||||
arg3 func(sub types.LocalParticipant) error
|
||||
}{arg1, arg2, arg3})
|
||||
stub := fake.EnqueueSubscribeTrackStub
|
||||
fake.recordInvocation("EnqueueSubscribeTrack", []interface{}{arg1, arg2})
|
||||
fake.recordInvocation("EnqueueSubscribeTrack", []interface{}{arg1, arg2, arg3})
|
||||
fake.enqueueSubscribeTrackMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.EnqueueSubscribeTrackStub(arg1, arg2)
|
||||
fake.EnqueueSubscribeTrackStub(arg1, arg2, arg3)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1534,31 +1537,32 @@ func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCallCount() int {
|
||||
return len(fake.enqueueSubscribeTrackArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCalls(stub func(livekit.TrackID, func(sub types.LocalParticipant) error)) {
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackCalls(stub func(livekit.TrackID, bool, func(sub types.LocalParticipant) error)) {
|
||||
fake.enqueueSubscribeTrackMutex.Lock()
|
||||
defer fake.enqueueSubscribeTrackMutex.Unlock()
|
||||
fake.EnqueueSubscribeTrackStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackArgsForCall(i int) (livekit.TrackID, func(sub types.LocalParticipant) error) {
|
||||
func (fake *FakeLocalParticipant) EnqueueSubscribeTrackArgsForCall(i int) (livekit.TrackID, bool, func(sub types.LocalParticipant) error) {
|
||||
fake.enqueueSubscribeTrackMutex.RLock()
|
||||
defer fake.enqueueSubscribeTrackMutex.RUnlock()
|
||||
argsForCall := fake.enqueueSubscribeTrackArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrack(arg1 livekit.TrackID, arg2 bool, arg3 func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrack(arg1 livekit.TrackID, arg2 bool, arg3 bool, arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
fake.enqueueUnsubscribeTrackMutex.Lock()
|
||||
fake.enqueueUnsubscribeTrackArgsForCall = append(fake.enqueueUnsubscribeTrackArgsForCall, struct {
|
||||
arg1 livekit.TrackID
|
||||
arg2 bool
|
||||
arg3 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||
}{arg1, arg2, arg3})
|
||||
arg3 bool
|
||||
arg4 func(subscriberID livekit.ParticipantID, willBeResumed bool) error
|
||||
}{arg1, arg2, arg3, arg4})
|
||||
stub := fake.EnqueueUnsubscribeTrackStub
|
||||
fake.recordInvocation("EnqueueUnsubscribeTrack", []interface{}{arg1, arg2, arg3})
|
||||
fake.recordInvocation("EnqueueUnsubscribeTrack", []interface{}{arg1, arg2, arg3, arg4})
|
||||
fake.enqueueUnsubscribeTrackMutex.Unlock()
|
||||
if stub != nil {
|
||||
fake.EnqueueUnsubscribeTrackStub(arg1, arg2, arg3)
|
||||
fake.EnqueueUnsubscribeTrackStub(arg1, arg2, arg3, arg4)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1568,17 +1572,17 @@ func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCallCount() int {
|
||||
return len(fake.enqueueUnsubscribeTrackArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCalls(stub func(livekit.TrackID, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error)) {
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackCalls(stub func(livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error)) {
|
||||
fake.enqueueUnsubscribeTrackMutex.Lock()
|
||||
defer fake.enqueueUnsubscribeTrackMutex.Unlock()
|
||||
fake.EnqueueUnsubscribeTrackStub = stub
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackArgsForCall(i int) (livekit.TrackID, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
func (fake *FakeLocalParticipant) EnqueueUnsubscribeTrackArgsForCall(i int) (livekit.TrackID, bool, bool, func(subscriberID livekit.ParticipantID, willBeResumed bool) error) {
|
||||
fake.enqueueUnsubscribeTrackMutex.RLock()
|
||||
defer fake.enqueueUnsubscribeTrackMutex.RUnlock()
|
||||
argsForCall := fake.enqueueUnsubscribeTrackArgsForCall[i]
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
|
||||
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) GetAdaptiveStream() bool {
|
||||
@@ -1690,7 +1694,7 @@ func (fake *FakeLocalParticipant) GetAudioLevelReturnsOnCall(i int, result1 floa
|
||||
}{result1, result2}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrack(arg1 livekit.TrackID) (*webrtc.RTPTransceiver, sfu.ForwarderState) {
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrack(arg1 livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState) {
|
||||
fake.getCachedDownTrackMutex.Lock()
|
||||
ret, specificReturn := fake.getCachedDownTrackReturnsOnCall[len(fake.getCachedDownTrackArgsForCall)]
|
||||
fake.getCachedDownTrackArgsForCall = append(fake.getCachedDownTrackArgsForCall, struct {
|
||||
@@ -1715,7 +1719,7 @@ func (fake *FakeLocalParticipant) GetCachedDownTrackCallCount() int {
|
||||
return len(fake.getCachedDownTrackArgsForCall)
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackCalls(stub func(livekit.TrackID) (*webrtc.RTPTransceiver, sfu.ForwarderState)) {
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackCalls(stub func(livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)) {
|
||||
fake.getCachedDownTrackMutex.Lock()
|
||||
defer fake.getCachedDownTrackMutex.Unlock()
|
||||
fake.GetCachedDownTrackStub = stub
|
||||
@@ -1728,29 +1732,29 @@ func (fake *FakeLocalParticipant) GetCachedDownTrackArgsForCall(i int) livekit.T
|
||||
return argsForCall.arg1
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackReturns(result1 *webrtc.RTPTransceiver, result2 sfu.ForwarderState) {
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackReturns(result1 *webrtc.RTPTransceiver, result2 sfu.DownTrackState) {
|
||||
fake.getCachedDownTrackMutex.Lock()
|
||||
defer fake.getCachedDownTrackMutex.Unlock()
|
||||
fake.GetCachedDownTrackStub = nil
|
||||
fake.getCachedDownTrackReturns = struct {
|
||||
result1 *webrtc.RTPTransceiver
|
||||
result2 sfu.ForwarderState
|
||||
result2 sfu.DownTrackState
|
||||
}{result1, result2}
|
||||
}
|
||||
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackReturnsOnCall(i int, result1 *webrtc.RTPTransceiver, result2 sfu.ForwarderState) {
|
||||
func (fake *FakeLocalParticipant) GetCachedDownTrackReturnsOnCall(i int, result1 *webrtc.RTPTransceiver, result2 sfu.DownTrackState) {
|
||||
fake.getCachedDownTrackMutex.Lock()
|
||||
defer fake.getCachedDownTrackMutex.Unlock()
|
||||
fake.GetCachedDownTrackStub = nil
|
||||
if fake.getCachedDownTrackReturnsOnCall == nil {
|
||||
fake.getCachedDownTrackReturnsOnCall = make(map[int]struct {
|
||||
result1 *webrtc.RTPTransceiver
|
||||
result2 sfu.ForwarderState
|
||||
result2 sfu.DownTrackState
|
||||
})
|
||||
}
|
||||
fake.getCachedDownTrackReturnsOnCall[i] = struct {
|
||||
result1 *webrtc.RTPTransceiver
|
||||
result2 sfu.ForwarderState
|
||||
result2 sfu.DownTrackState
|
||||
}{result1, result2}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -152,10 +152,11 @@ func LoggerWithRoom(l logger.Logger, name livekit.RoomName, roomID livekit.RoomI
|
||||
return logger.Logger(lr)
|
||||
}
|
||||
|
||||
func LoggerWithTrack(l logger.Logger, trackID livekit.TrackID) logger.Logger {
|
||||
func LoggerWithTrack(l logger.Logger, trackID livekit.TrackID, isRelayed bool) logger.Logger {
|
||||
lr := logr.Logger(l)
|
||||
if trackID != "" {
|
||||
lr = lr.WithValues("trackID", trackID)
|
||||
lr = lr.WithValues("relayed", isRelayed)
|
||||
}
|
||||
return logger.Logger(lr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user