Tests for down stream packet push. (#4692)

* Tests for down stream packet push.

A recent issue (padding bit in RTP header) surfaced a gap which slipped
through due to lack of tests. Changes in pion/rtp were not adopted
properly.

So, adding some tests (thank you Claude for the heavy lifting) to test
the down stream packet path using the whole pion chain.

Split out some interfaces so it is easier to have it all in one place
and create fakes.

Will help adding more tests, for example include the upstream path also
in the integration test. May have to create more interfaces and make
things testable, but this is a start.

* missed file

* rtx specific test
This commit is contained in:
Raja Subramanian
2026-07-20 20:15:07 +05:30
committed by GitHub
parent c684997c4f
commit 13e4aaec2b
12 changed files with 6362 additions and 150 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ require (
github.com/nats-io/nuid v1.0.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pion/logging v0.2.4 // indirect
github.com/pion/logging v0.2.4
github.com/pion/mdns/v2 v2.1.0 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/srtp/v3 v3.0.12 // indirect
-73
View File
@@ -51,29 +51,6 @@ import (
"github.com/livekit/livekit-server/pkg/sfu/utils"
)
// TrackSender defines an interface send media to remote peer
type TrackSender interface {
UpTrackLayersChange()
UpTrackBitrateAvailabilityChange()
UpTrackMaxPublishedLayerChange(maxPublishedLayer int32)
UpTrackMaxTemporalLayerSeenChange(maxTemporalLayerSeen int32)
UpTrackBitrateReport(availableLayers []int32, bitrates Bitrates)
WriteRTP(p *buffer.ExtPacket, layer int32) int32
Close()
IsClosed() bool
// ID is the globally unique identifier for this Track.
ID() string
SubscriberID() livekit.ParticipantID
HandleRTCPSenderReportData(
payloadType webrtc.PayloadType,
layer int32,
publisherSRData *livekit.RTCPSenderReportState,
) error
Resync()
SetReceiver(TrackReceiver)
ReceiverRestart(TrackReceiver)
}
// -------------------------------------------------------------------
const (
@@ -217,56 +194,6 @@ func (d DownTrackState) MarshalLogObject(e zapcore.ObjectEncoder) error {
// -------------------------------------------------------------------
type DownTrackStreamAllocatorListener interface {
// RTCP received
OnREMB(dt *DownTrack, remb *rtcp.ReceiverEstimatedMaximumBitrate)
OnTransportCCFeedback(dt *DownTrack, cc *rtcp.TransportLayerCC)
// video layer availability changed
OnAvailableLayersChanged(dt *DownTrack)
// video layer bitrate availability changed
OnBitrateAvailabilityChanged(dt *DownTrack)
// max published spatial layer changed
OnMaxPublishedSpatialChanged(dt *DownTrack)
// max published temporal layer changed
OnMaxPublishedTemporalChanged(dt *DownTrack)
// subscription changed - mute/unmute
OnSubscriptionChanged(dt *DownTrack)
// subscribed max video layer changed
OnSubscribedLayerChanged(dt *DownTrack, layers buffer.VideoLayer)
// stream resumed
OnResume(dt *DownTrack)
// check if track should participate in BWE
IsBWEEnabled(dt *DownTrack) bool
// get the BWE type in use
BWEType() bwe.BWEType
// check if subscription mute can be applied
IsSubscribeMutable(dt *DownTrack) bool
}
// -------------------------------------------------------------------
type DownTrackListener interface {
OnBindAndConnected()
OnStatsUpdate(stat *livekit.AnalyticsStat)
OnMaxSubscribedLayerChanged(layer int32)
OnRttUpdate(rtt uint32)
OnCodecNegotiated(webrtc.RTPCodecCapability)
OnDownTrackClose(isExpectedToResume bool)
OnStreamStarted()
}
// -------------------------------------------------------------------
type bindState int
const (
File diff suppressed because it is too large Load Diff
+71
View File
@@ -0,0 +1,71 @@
// Copyright 2026 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sfu
import "github.com/livekit/livekit-server/pkg/sfu/buffer"
// Test-only seams that expose DownTrack internals to the external sfu_test package.
// This file is only compiled into the test binary (its name ends in _test.go), so it
// does not affect the production API. The external test package is required because the
// integration tests import the streamallocator package, which itself imports sfu (an
// import cycle that an in-package test cannot resolve).
func (d *DownTrack) IsWritableForTest() bool { return d.writable.Load() }
func (d *DownTrack) PayloadTypeRTXForTest() uint32 { return d.payloadTypeRTX.Load() }
func (d *DownTrack) RTPStatsActiveForTest() bool { return d.rtpStats.IsActive() }
func (d *DownTrack) LastReceiverReportTimeForTest() int64 {
return d.rtpStats.LastReceiverReportTime()
}
func (d *DownTrack) ExtIDsForTest() (absSendTime int, transportWide int) {
return d.absSendTimeExtID, d.transportWideExtID
}
func (d *DownTrack) HandleRTCPForTest(pkt []byte) { d.handleRTCP(pkt) }
func (d *DownTrack) SetRTPHeaderExtensionsForTest() { d.setRTPHeaderExtensions() }
// ForceForwardLayerForTest forces the forwarder onto a valid current/target layer so a
// (non-simulcast) video packet will be forwarded without driving full allocation.
func (d *DownTrack) ForceForwardLayerForTest(layer buffer.VideoLayer) {
d.forwarder.ForceLayerForTest(layer)
}
// RetransmitForTest drives the (unexported) retransmitPacket path with an in-package
// extPacketMeta built from exported values, so the external test can exercise the
// retransmit path.
func (d *DownTrack) RetransmitForTest(
sourceSeqNo uint64,
targetSeqNo uint16,
timestamp uint32,
extTimestamp uint64,
layer int8,
sourcePkt []byte,
) (int, error) {
epm := extPacketMeta{
packetMeta: packetMeta{
sourceSeqNo: sourceSeqNo,
targetSeqNo: targetSeqNo,
timestamp: timestamp,
layer: layer,
},
extSequenceNumber: uint64(targetSeqNo),
extTimestamp: extTimestamp,
}
return d.retransmitPacket(&epm, sourcePkt, false)
}
+8
View File
@@ -1728,6 +1728,14 @@ func (f *Forwarder) Restart() {
f.refVideoLayerMode = livekit.VideoLayer_MODE_UNUSED
}
func (f *Forwarder) ForceLayerForTest(layer buffer.VideoLayer) {
f.lock.Lock()
defer f.lock.Unlock()
f.vls.SetCurrent(layer)
f.vls.SetTarget(layer)
}
func (f *Forwarder) FilterRTX(nacks []uint16) (filtered []uint16, disallowedLayers [buffer.DefaultMaxLayerSpatial + 1]bool) {
f.lock.RLock()
defer f.lock.RUnlock()
+187
View File
@@ -0,0 +1,187 @@
// Copyright 2023 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sfu
import (
"github.com/pion/rtcp"
"github.com/pion/webrtc/v4"
"github.com/livekit/mediatransportutil/pkg/codec"
"github.com/livekit/protocol/codecs/mime"
"github.com/livekit/protocol/livekit"
"github.com/livekit/livekit-server/pkg/sfu/buffer"
"github.com/livekit/livekit-server/pkg/sfu/bwe"
)
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
// TrackReceiver defines an interface receive media from remote peer
//
//counterfeiter:generate . TrackReceiver
type TrackReceiver interface {
TrackID() livekit.TrackID
StreamID() string
// returns the initial codec of the receiver, it is determined by the track's codec
// and will not change if the codec changes during the session (publisher changes codec)
Codec() webrtc.RTPCodecParameters
Mime() mime.MimeType
VideoLayerMode() livekit.VideoLayer_Mode
HeaderExtensions() []webrtc.RTPHeaderExtensionParameter
IsClosed() bool
ReadRTP(buf []byte, layer uint8, esn uint64) (int, error)
GetLayeredBitrate() ([]int32, Bitrates)
GetAudioLevel() (float64, bool)
SendPLI(layer int32, force bool)
SetMaxExpectedSpatialLayer(layer int32)
AddDownTrack(track TrackSender) error
DeleteDownTrack(participantID livekit.ParticipantID)
GetDownTracks() []TrackSender
DebugInfo() map[string]any
TrackInfo() *livekit.TrackInfo
UpdateTrackInfo(ti *livekit.TrackInfo)
// Get primary receiver if this receiver represents a RED codec; otherwise it will return itself
GetPrimaryReceiverForRed() TrackReceiver
// Get red receiver for primary codec, used by forward red encodings for opus only codec
GetRedReceiver() TrackReceiver
GetTemporalLayerFpsForSpatial(layer int32) []float32
GetTrackStats() *livekit.RTPStats
// AddOnReady adds a function to be called when the receiver is ready, the callback
// could be called immediately if the receiver is ready when the callback is added
AddOnReady(func())
AddOnCodecStateChange(func(webrtc.RTPCodecParameters, ReceiverCodecState))
CodecState() ReceiverCodecState
// VideoSizes returns the video size parsed from rtp packet for each spatial layer.
VideoSizes() []codec.VideoSize
// closes all associated buffers and issues a resync to all attached downtracks so that
// they can resync and have proper sequncing without gaps in sequence numbers / timestamps
Restart(reason string)
}
// --------------------------------------
//counterfeiter:generate . REDTransformer
type REDTransformer interface {
TrackReceiver
SetLBThreshold(lbThreshold int)
ForwardRTP(pkt *buffer.ExtPacket, spatialLayer int32) int32
ForwardRTCPSenderReport(
payloadType webrtc.PayloadType,
layer int32,
publisherSRData *livekit.RTCPSenderReportState,
)
GetDownTracks() []TrackSender
ResyncDownTracks()
OnStreamRestart()
CanClose() bool
Close()
}
// --------------------------------------
// TrackSender defines an interface send media to remote peer
//
//counterfeiter:generate . TrackSender
type TrackSender interface {
UpTrackLayersChange()
UpTrackBitrateAvailabilityChange()
UpTrackMaxPublishedLayerChange(maxPublishedLayer int32)
UpTrackMaxTemporalLayerSeenChange(maxTemporalLayerSeen int32)
UpTrackBitrateReport(availableLayers []int32, bitrates Bitrates)
WriteRTP(p *buffer.ExtPacket, layer int32) int32
Close()
IsClosed() bool
// ID is the globally unique identifier for this Track.
ID() string
SubscriberID() livekit.ParticipantID
HandleRTCPSenderReportData(
payloadType webrtc.PayloadType,
layer int32,
publisherSRData *livekit.RTCPSenderReportState,
) error
Resync()
SetReceiver(TrackReceiver)
ReceiverRestart(TrackReceiver)
}
// -------------------------------------------------------------------
//counterfeiter:generate . DownTrackStreamAllocatorListener
type DownTrackStreamAllocatorListener interface {
// RTCP received
OnREMB(dt *DownTrack, remb *rtcp.ReceiverEstimatedMaximumBitrate)
OnTransportCCFeedback(dt *DownTrack, cc *rtcp.TransportLayerCC)
// video layer availability changed
OnAvailableLayersChanged(dt *DownTrack)
// video layer bitrate availability changed
OnBitrateAvailabilityChanged(dt *DownTrack)
// max published spatial layer changed
OnMaxPublishedSpatialChanged(dt *DownTrack)
// max published temporal layer changed
OnMaxPublishedTemporalChanged(dt *DownTrack)
// subscription changed - mute/unmute
OnSubscriptionChanged(dt *DownTrack)
// subscribed max video layer changed
OnSubscribedLayerChanged(dt *DownTrack, layers buffer.VideoLayer)
// stream resumed
OnResume(dt *DownTrack)
// check if track should participate in BWE
IsBWEEnabled(dt *DownTrack) bool
// get the BWE type in use
BWEType() bwe.BWEType
// check if subscription mute can be applied
IsSubscribeMutable(dt *DownTrack) bool
}
// -------------------------------------------------------------------
//counterfeiter:generate . DownTrackListener
type DownTrackListener interface {
OnBindAndConnected()
OnStatsUpdate(stat *livekit.AnalyticsStat)
OnMaxSubscribedLayerChanged(layer int32)
OnRttUpdate(rtt uint32)
OnCodecNegotiated(webrtc.RTPCodecCapability)
OnDownTrackClose(isExpectedToResume bool)
OnStreamStarted()
}
// -------------------------------------------------------------------
-76
View File
@@ -97,82 +97,6 @@ const (
// --------------------------------------
// TrackReceiver defines an interface receive media from remote peer
type TrackReceiver interface {
TrackID() livekit.TrackID
StreamID() string
// returns the initial codec of the receiver, it is determined by the track's codec
// and will not change if the codec changes during the session (publisher changes codec)
Codec() webrtc.RTPCodecParameters
Mime() mime.MimeType
VideoLayerMode() livekit.VideoLayer_Mode
HeaderExtensions() []webrtc.RTPHeaderExtensionParameter
IsClosed() bool
ReadRTP(buf []byte, layer uint8, esn uint64) (int, error)
GetLayeredBitrate() ([]int32, Bitrates)
GetAudioLevel() (float64, bool)
SendPLI(layer int32, force bool)
SetMaxExpectedSpatialLayer(layer int32)
AddDownTrack(track TrackSender) error
DeleteDownTrack(participantID livekit.ParticipantID)
GetDownTracks() []TrackSender
DebugInfo() map[string]any
TrackInfo() *livekit.TrackInfo
UpdateTrackInfo(ti *livekit.TrackInfo)
// Get primary receiver if this receiver represents a RED codec; otherwise it will return itself
GetPrimaryReceiverForRed() TrackReceiver
// Get red receiver for primary codec, used by forward red encodings for opus only codec
GetRedReceiver() TrackReceiver
GetTemporalLayerFpsForSpatial(layer int32) []float32
GetTrackStats() *livekit.RTPStats
// AddOnReady adds a function to be called when the receiver is ready, the callback
// could be called immediately if the receiver is ready when the callback is added
AddOnReady(func())
AddOnCodecStateChange(func(webrtc.RTPCodecParameters, ReceiverCodecState))
CodecState() ReceiverCodecState
// VideoSizes returns the video size parsed from rtp packet for each spatial layer.
VideoSizes() []codec.VideoSize
// closes all associated buffers and issues a resync to all attached downtracks so that
// they can resync and have proper sequncing without gaps in sequence numbers / timestamps
Restart(reason string)
}
// --------------------------------------
type REDTransformer interface {
TrackReceiver
SetLBThreshold(lbThreshold int)
ForwardRTP(pkt *buffer.ExtPacket, spatialLayer int32) int32
ForwardRTCPSenderReport(
payloadType webrtc.PayloadType,
layer int32,
publisherSRData *livekit.RTCPSenderReportState,
)
GetDownTracks() []TrackSender
ResyncDownTracks()
OnStreamRestart()
CanClose() bool
Close()
}
// --------------------------------------
type bufferPromise struct {
ready chan struct{}
}
@@ -0,0 +1,280 @@
// Code generated by counterfeiter. DO NOT EDIT.
package sfufakes
import (
"sync"
"github.com/livekit/livekit-server/pkg/sfu"
"github.com/livekit/protocol/livekit"
webrtc "github.com/pion/webrtc/v4"
)
type FakeDownTrackListener struct {
OnBindAndConnectedStub func()
onBindAndConnectedMutex sync.RWMutex
onBindAndConnectedArgsForCall []struct {
}
OnCodecNegotiatedStub func(webrtc.RTPCodecCapability)
onCodecNegotiatedMutex sync.RWMutex
onCodecNegotiatedArgsForCall []struct {
arg1 webrtc.RTPCodecCapability
}
OnDownTrackCloseStub func(bool)
onDownTrackCloseMutex sync.RWMutex
onDownTrackCloseArgsForCall []struct {
arg1 bool
}
OnMaxSubscribedLayerChangedStub func(int32)
onMaxSubscribedLayerChangedMutex sync.RWMutex
onMaxSubscribedLayerChangedArgsForCall []struct {
arg1 int32
}
OnRttUpdateStub func(uint32)
onRttUpdateMutex sync.RWMutex
onRttUpdateArgsForCall []struct {
arg1 uint32
}
OnStatsUpdateStub func(*livekit.AnalyticsStat)
onStatsUpdateMutex sync.RWMutex
onStatsUpdateArgsForCall []struct {
arg1 *livekit.AnalyticsStat
}
OnStreamStartedStub func()
onStreamStartedMutex sync.RWMutex
onStreamStartedArgsForCall []struct {
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeDownTrackListener) OnBindAndConnected() {
fake.onBindAndConnectedMutex.Lock()
fake.onBindAndConnectedArgsForCall = append(fake.onBindAndConnectedArgsForCall, struct {
}{})
stub := fake.OnBindAndConnectedStub
fake.recordInvocation("OnBindAndConnected", []interface{}{})
fake.onBindAndConnectedMutex.Unlock()
if stub != nil {
fake.OnBindAndConnectedStub()
}
}
func (fake *FakeDownTrackListener) OnBindAndConnectedCallCount() int {
fake.onBindAndConnectedMutex.RLock()
defer fake.onBindAndConnectedMutex.RUnlock()
return len(fake.onBindAndConnectedArgsForCall)
}
func (fake *FakeDownTrackListener) OnBindAndConnectedCalls(stub func()) {
fake.onBindAndConnectedMutex.Lock()
defer fake.onBindAndConnectedMutex.Unlock()
fake.OnBindAndConnectedStub = stub
}
func (fake *FakeDownTrackListener) OnCodecNegotiated(arg1 webrtc.RTPCodecCapability) {
fake.onCodecNegotiatedMutex.Lock()
fake.onCodecNegotiatedArgsForCall = append(fake.onCodecNegotiatedArgsForCall, struct {
arg1 webrtc.RTPCodecCapability
}{arg1})
stub := fake.OnCodecNegotiatedStub
fake.recordInvocation("OnCodecNegotiated", []interface{}{arg1})
fake.onCodecNegotiatedMutex.Unlock()
if stub != nil {
fake.OnCodecNegotiatedStub(arg1)
}
}
func (fake *FakeDownTrackListener) OnCodecNegotiatedCallCount() int {
fake.onCodecNegotiatedMutex.RLock()
defer fake.onCodecNegotiatedMutex.RUnlock()
return len(fake.onCodecNegotiatedArgsForCall)
}
func (fake *FakeDownTrackListener) OnCodecNegotiatedCalls(stub func(webrtc.RTPCodecCapability)) {
fake.onCodecNegotiatedMutex.Lock()
defer fake.onCodecNegotiatedMutex.Unlock()
fake.OnCodecNegotiatedStub = stub
}
func (fake *FakeDownTrackListener) OnCodecNegotiatedArgsForCall(i int) webrtc.RTPCodecCapability {
fake.onCodecNegotiatedMutex.RLock()
defer fake.onCodecNegotiatedMutex.RUnlock()
argsForCall := fake.onCodecNegotiatedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackListener) OnDownTrackClose(arg1 bool) {
fake.onDownTrackCloseMutex.Lock()
fake.onDownTrackCloseArgsForCall = append(fake.onDownTrackCloseArgsForCall, struct {
arg1 bool
}{arg1})
stub := fake.OnDownTrackCloseStub
fake.recordInvocation("OnDownTrackClose", []interface{}{arg1})
fake.onDownTrackCloseMutex.Unlock()
if stub != nil {
fake.OnDownTrackCloseStub(arg1)
}
}
func (fake *FakeDownTrackListener) OnDownTrackCloseCallCount() int {
fake.onDownTrackCloseMutex.RLock()
defer fake.onDownTrackCloseMutex.RUnlock()
return len(fake.onDownTrackCloseArgsForCall)
}
func (fake *FakeDownTrackListener) OnDownTrackCloseCalls(stub func(bool)) {
fake.onDownTrackCloseMutex.Lock()
defer fake.onDownTrackCloseMutex.Unlock()
fake.OnDownTrackCloseStub = stub
}
func (fake *FakeDownTrackListener) OnDownTrackCloseArgsForCall(i int) bool {
fake.onDownTrackCloseMutex.RLock()
defer fake.onDownTrackCloseMutex.RUnlock()
argsForCall := fake.onDownTrackCloseArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackListener) OnMaxSubscribedLayerChanged(arg1 int32) {
fake.onMaxSubscribedLayerChangedMutex.Lock()
fake.onMaxSubscribedLayerChangedArgsForCall = append(fake.onMaxSubscribedLayerChangedArgsForCall, struct {
arg1 int32
}{arg1})
stub := fake.OnMaxSubscribedLayerChangedStub
fake.recordInvocation("OnMaxSubscribedLayerChanged", []interface{}{arg1})
fake.onMaxSubscribedLayerChangedMutex.Unlock()
if stub != nil {
fake.OnMaxSubscribedLayerChangedStub(arg1)
}
}
func (fake *FakeDownTrackListener) OnMaxSubscribedLayerChangedCallCount() int {
fake.onMaxSubscribedLayerChangedMutex.RLock()
defer fake.onMaxSubscribedLayerChangedMutex.RUnlock()
return len(fake.onMaxSubscribedLayerChangedArgsForCall)
}
func (fake *FakeDownTrackListener) OnMaxSubscribedLayerChangedCalls(stub func(int32)) {
fake.onMaxSubscribedLayerChangedMutex.Lock()
defer fake.onMaxSubscribedLayerChangedMutex.Unlock()
fake.OnMaxSubscribedLayerChangedStub = stub
}
func (fake *FakeDownTrackListener) OnMaxSubscribedLayerChangedArgsForCall(i int) int32 {
fake.onMaxSubscribedLayerChangedMutex.RLock()
defer fake.onMaxSubscribedLayerChangedMutex.RUnlock()
argsForCall := fake.onMaxSubscribedLayerChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackListener) OnRttUpdate(arg1 uint32) {
fake.onRttUpdateMutex.Lock()
fake.onRttUpdateArgsForCall = append(fake.onRttUpdateArgsForCall, struct {
arg1 uint32
}{arg1})
stub := fake.OnRttUpdateStub
fake.recordInvocation("OnRttUpdate", []interface{}{arg1})
fake.onRttUpdateMutex.Unlock()
if stub != nil {
fake.OnRttUpdateStub(arg1)
}
}
func (fake *FakeDownTrackListener) OnRttUpdateCallCount() int {
fake.onRttUpdateMutex.RLock()
defer fake.onRttUpdateMutex.RUnlock()
return len(fake.onRttUpdateArgsForCall)
}
func (fake *FakeDownTrackListener) OnRttUpdateCalls(stub func(uint32)) {
fake.onRttUpdateMutex.Lock()
defer fake.onRttUpdateMutex.Unlock()
fake.OnRttUpdateStub = stub
}
func (fake *FakeDownTrackListener) OnRttUpdateArgsForCall(i int) uint32 {
fake.onRttUpdateMutex.RLock()
defer fake.onRttUpdateMutex.RUnlock()
argsForCall := fake.onRttUpdateArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackListener) OnStatsUpdate(arg1 *livekit.AnalyticsStat) {
fake.onStatsUpdateMutex.Lock()
fake.onStatsUpdateArgsForCall = append(fake.onStatsUpdateArgsForCall, struct {
arg1 *livekit.AnalyticsStat
}{arg1})
stub := fake.OnStatsUpdateStub
fake.recordInvocation("OnStatsUpdate", []interface{}{arg1})
fake.onStatsUpdateMutex.Unlock()
if stub != nil {
fake.OnStatsUpdateStub(arg1)
}
}
func (fake *FakeDownTrackListener) OnStatsUpdateCallCount() int {
fake.onStatsUpdateMutex.RLock()
defer fake.onStatsUpdateMutex.RUnlock()
return len(fake.onStatsUpdateArgsForCall)
}
func (fake *FakeDownTrackListener) OnStatsUpdateCalls(stub func(*livekit.AnalyticsStat)) {
fake.onStatsUpdateMutex.Lock()
defer fake.onStatsUpdateMutex.Unlock()
fake.OnStatsUpdateStub = stub
}
func (fake *FakeDownTrackListener) OnStatsUpdateArgsForCall(i int) *livekit.AnalyticsStat {
fake.onStatsUpdateMutex.RLock()
defer fake.onStatsUpdateMutex.RUnlock()
argsForCall := fake.onStatsUpdateArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackListener) OnStreamStarted() {
fake.onStreamStartedMutex.Lock()
fake.onStreamStartedArgsForCall = append(fake.onStreamStartedArgsForCall, struct {
}{})
stub := fake.OnStreamStartedStub
fake.recordInvocation("OnStreamStarted", []interface{}{})
fake.onStreamStartedMutex.Unlock()
if stub != nil {
fake.OnStreamStartedStub()
}
}
func (fake *FakeDownTrackListener) OnStreamStartedCallCount() int {
fake.onStreamStartedMutex.RLock()
defer fake.onStreamStartedMutex.RUnlock()
return len(fake.onStreamStartedArgsForCall)
}
func (fake *FakeDownTrackListener) OnStreamStartedCalls(stub func()) {
fake.onStreamStartedMutex.Lock()
defer fake.onStreamStartedMutex.Unlock()
fake.OnStreamStartedStub = stub
}
func (fake *FakeDownTrackListener) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeDownTrackListener) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ sfu.DownTrackListener = new(FakeDownTrackListener)
@@ -0,0 +1,586 @@
// Code generated by counterfeiter. DO NOT EDIT.
package sfufakes
import (
"sync"
"github.com/livekit/livekit-server/pkg/sfu"
"github.com/livekit/livekit-server/pkg/sfu/buffer"
"github.com/livekit/livekit-server/pkg/sfu/bwe"
"github.com/pion/rtcp"
)
type FakeDownTrackStreamAllocatorListener struct {
BWETypeStub func() bwe.BWEType
bWETypeMutex sync.RWMutex
bWETypeArgsForCall []struct {
}
bWETypeReturns struct {
result1 bwe.BWEType
}
bWETypeReturnsOnCall map[int]struct {
result1 bwe.BWEType
}
IsBWEEnabledStub func(*sfu.DownTrack) bool
isBWEEnabledMutex sync.RWMutex
isBWEEnabledArgsForCall []struct {
arg1 *sfu.DownTrack
}
isBWEEnabledReturns struct {
result1 bool
}
isBWEEnabledReturnsOnCall map[int]struct {
result1 bool
}
IsSubscribeMutableStub func(*sfu.DownTrack) bool
isSubscribeMutableMutex sync.RWMutex
isSubscribeMutableArgsForCall []struct {
arg1 *sfu.DownTrack
}
isSubscribeMutableReturns struct {
result1 bool
}
isSubscribeMutableReturnsOnCall map[int]struct {
result1 bool
}
OnAvailableLayersChangedStub func(*sfu.DownTrack)
onAvailableLayersChangedMutex sync.RWMutex
onAvailableLayersChangedArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnBitrateAvailabilityChangedStub func(*sfu.DownTrack)
onBitrateAvailabilityChangedMutex sync.RWMutex
onBitrateAvailabilityChangedArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnMaxPublishedSpatialChangedStub func(*sfu.DownTrack)
onMaxPublishedSpatialChangedMutex sync.RWMutex
onMaxPublishedSpatialChangedArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnMaxPublishedTemporalChangedStub func(*sfu.DownTrack)
onMaxPublishedTemporalChangedMutex sync.RWMutex
onMaxPublishedTemporalChangedArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnREMBStub func(*sfu.DownTrack, *rtcp.ReceiverEstimatedMaximumBitrate)
onREMBMutex sync.RWMutex
onREMBArgsForCall []struct {
arg1 *sfu.DownTrack
arg2 *rtcp.ReceiverEstimatedMaximumBitrate
}
OnResumeStub func(*sfu.DownTrack)
onResumeMutex sync.RWMutex
onResumeArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnSubscribedLayerChangedStub func(*sfu.DownTrack, buffer.VideoLayer)
onSubscribedLayerChangedMutex sync.RWMutex
onSubscribedLayerChangedArgsForCall []struct {
arg1 *sfu.DownTrack
arg2 buffer.VideoLayer
}
OnSubscriptionChangedStub func(*sfu.DownTrack)
onSubscriptionChangedMutex sync.RWMutex
onSubscriptionChangedArgsForCall []struct {
arg1 *sfu.DownTrack
}
OnTransportCCFeedbackStub func(*sfu.DownTrack, *rtcp.TransportLayerCC)
onTransportCCFeedbackMutex sync.RWMutex
onTransportCCFeedbackArgsForCall []struct {
arg1 *sfu.DownTrack
arg2 *rtcp.TransportLayerCC
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeDownTrackStreamAllocatorListener) BWEType() bwe.BWEType {
fake.bWETypeMutex.Lock()
ret, specificReturn := fake.bWETypeReturnsOnCall[len(fake.bWETypeArgsForCall)]
fake.bWETypeArgsForCall = append(fake.bWETypeArgsForCall, struct {
}{})
stub := fake.BWETypeStub
fakeReturns := fake.bWETypeReturns
fake.recordInvocation("BWEType", []interface{}{})
fake.bWETypeMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeDownTrackStreamAllocatorListener) BWETypeCallCount() int {
fake.bWETypeMutex.RLock()
defer fake.bWETypeMutex.RUnlock()
return len(fake.bWETypeArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) BWETypeCalls(stub func() bwe.BWEType) {
fake.bWETypeMutex.Lock()
defer fake.bWETypeMutex.Unlock()
fake.BWETypeStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) BWETypeReturns(result1 bwe.BWEType) {
fake.bWETypeMutex.Lock()
defer fake.bWETypeMutex.Unlock()
fake.BWETypeStub = nil
fake.bWETypeReturns = struct {
result1 bwe.BWEType
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) BWETypeReturnsOnCall(i int, result1 bwe.BWEType) {
fake.bWETypeMutex.Lock()
defer fake.bWETypeMutex.Unlock()
fake.BWETypeStub = nil
if fake.bWETypeReturnsOnCall == nil {
fake.bWETypeReturnsOnCall = make(map[int]struct {
result1 bwe.BWEType
})
}
fake.bWETypeReturnsOnCall[i] = struct {
result1 bwe.BWEType
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabled(arg1 *sfu.DownTrack) bool {
fake.isBWEEnabledMutex.Lock()
ret, specificReturn := fake.isBWEEnabledReturnsOnCall[len(fake.isBWEEnabledArgsForCall)]
fake.isBWEEnabledArgsForCall = append(fake.isBWEEnabledArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.IsBWEEnabledStub
fakeReturns := fake.isBWEEnabledReturns
fake.recordInvocation("IsBWEEnabled", []interface{}{arg1})
fake.isBWEEnabledMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabledCallCount() int {
fake.isBWEEnabledMutex.RLock()
defer fake.isBWEEnabledMutex.RUnlock()
return len(fake.isBWEEnabledArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabledCalls(stub func(*sfu.DownTrack) bool) {
fake.isBWEEnabledMutex.Lock()
defer fake.isBWEEnabledMutex.Unlock()
fake.IsBWEEnabledStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabledArgsForCall(i int) *sfu.DownTrack {
fake.isBWEEnabledMutex.RLock()
defer fake.isBWEEnabledMutex.RUnlock()
argsForCall := fake.isBWEEnabledArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabledReturns(result1 bool) {
fake.isBWEEnabledMutex.Lock()
defer fake.isBWEEnabledMutex.Unlock()
fake.IsBWEEnabledStub = nil
fake.isBWEEnabledReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) IsBWEEnabledReturnsOnCall(i int, result1 bool) {
fake.isBWEEnabledMutex.Lock()
defer fake.isBWEEnabledMutex.Unlock()
fake.IsBWEEnabledStub = nil
if fake.isBWEEnabledReturnsOnCall == nil {
fake.isBWEEnabledReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isBWEEnabledReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutable(arg1 *sfu.DownTrack) bool {
fake.isSubscribeMutableMutex.Lock()
ret, specificReturn := fake.isSubscribeMutableReturnsOnCall[len(fake.isSubscribeMutableArgsForCall)]
fake.isSubscribeMutableArgsForCall = append(fake.isSubscribeMutableArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.IsSubscribeMutableStub
fakeReturns := fake.isSubscribeMutableReturns
fake.recordInvocation("IsSubscribeMutable", []interface{}{arg1})
fake.isSubscribeMutableMutex.Unlock()
if stub != nil {
return stub(arg1)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutableCallCount() int {
fake.isSubscribeMutableMutex.RLock()
defer fake.isSubscribeMutableMutex.RUnlock()
return len(fake.isSubscribeMutableArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutableCalls(stub func(*sfu.DownTrack) bool) {
fake.isSubscribeMutableMutex.Lock()
defer fake.isSubscribeMutableMutex.Unlock()
fake.IsSubscribeMutableStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutableArgsForCall(i int) *sfu.DownTrack {
fake.isSubscribeMutableMutex.RLock()
defer fake.isSubscribeMutableMutex.RUnlock()
argsForCall := fake.isSubscribeMutableArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutableReturns(result1 bool) {
fake.isSubscribeMutableMutex.Lock()
defer fake.isSubscribeMutableMutex.Unlock()
fake.IsSubscribeMutableStub = nil
fake.isSubscribeMutableReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) IsSubscribeMutableReturnsOnCall(i int, result1 bool) {
fake.isSubscribeMutableMutex.Lock()
defer fake.isSubscribeMutableMutex.Unlock()
fake.IsSubscribeMutableStub = nil
if fake.isSubscribeMutableReturnsOnCall == nil {
fake.isSubscribeMutableReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isSubscribeMutableReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnAvailableLayersChanged(arg1 *sfu.DownTrack) {
fake.onAvailableLayersChangedMutex.Lock()
fake.onAvailableLayersChangedArgsForCall = append(fake.onAvailableLayersChangedArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnAvailableLayersChangedStub
fake.recordInvocation("OnAvailableLayersChanged", []interface{}{arg1})
fake.onAvailableLayersChangedMutex.Unlock()
if stub != nil {
fake.OnAvailableLayersChangedStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnAvailableLayersChangedCallCount() int {
fake.onAvailableLayersChangedMutex.RLock()
defer fake.onAvailableLayersChangedMutex.RUnlock()
return len(fake.onAvailableLayersChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnAvailableLayersChangedCalls(stub func(*sfu.DownTrack)) {
fake.onAvailableLayersChangedMutex.Lock()
defer fake.onAvailableLayersChangedMutex.Unlock()
fake.OnAvailableLayersChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnAvailableLayersChangedArgsForCall(i int) *sfu.DownTrack {
fake.onAvailableLayersChangedMutex.RLock()
defer fake.onAvailableLayersChangedMutex.RUnlock()
argsForCall := fake.onAvailableLayersChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnBitrateAvailabilityChanged(arg1 *sfu.DownTrack) {
fake.onBitrateAvailabilityChangedMutex.Lock()
fake.onBitrateAvailabilityChangedArgsForCall = append(fake.onBitrateAvailabilityChangedArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnBitrateAvailabilityChangedStub
fake.recordInvocation("OnBitrateAvailabilityChanged", []interface{}{arg1})
fake.onBitrateAvailabilityChangedMutex.Unlock()
if stub != nil {
fake.OnBitrateAvailabilityChangedStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnBitrateAvailabilityChangedCallCount() int {
fake.onBitrateAvailabilityChangedMutex.RLock()
defer fake.onBitrateAvailabilityChangedMutex.RUnlock()
return len(fake.onBitrateAvailabilityChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnBitrateAvailabilityChangedCalls(stub func(*sfu.DownTrack)) {
fake.onBitrateAvailabilityChangedMutex.Lock()
defer fake.onBitrateAvailabilityChangedMutex.Unlock()
fake.OnBitrateAvailabilityChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnBitrateAvailabilityChangedArgsForCall(i int) *sfu.DownTrack {
fake.onBitrateAvailabilityChangedMutex.RLock()
defer fake.onBitrateAvailabilityChangedMutex.RUnlock()
argsForCall := fake.onBitrateAvailabilityChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedSpatialChanged(arg1 *sfu.DownTrack) {
fake.onMaxPublishedSpatialChangedMutex.Lock()
fake.onMaxPublishedSpatialChangedArgsForCall = append(fake.onMaxPublishedSpatialChangedArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnMaxPublishedSpatialChangedStub
fake.recordInvocation("OnMaxPublishedSpatialChanged", []interface{}{arg1})
fake.onMaxPublishedSpatialChangedMutex.Unlock()
if stub != nil {
fake.OnMaxPublishedSpatialChangedStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedSpatialChangedCallCount() int {
fake.onMaxPublishedSpatialChangedMutex.RLock()
defer fake.onMaxPublishedSpatialChangedMutex.RUnlock()
return len(fake.onMaxPublishedSpatialChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedSpatialChangedCalls(stub func(*sfu.DownTrack)) {
fake.onMaxPublishedSpatialChangedMutex.Lock()
defer fake.onMaxPublishedSpatialChangedMutex.Unlock()
fake.OnMaxPublishedSpatialChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedSpatialChangedArgsForCall(i int) *sfu.DownTrack {
fake.onMaxPublishedSpatialChangedMutex.RLock()
defer fake.onMaxPublishedSpatialChangedMutex.RUnlock()
argsForCall := fake.onMaxPublishedSpatialChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedTemporalChanged(arg1 *sfu.DownTrack) {
fake.onMaxPublishedTemporalChangedMutex.Lock()
fake.onMaxPublishedTemporalChangedArgsForCall = append(fake.onMaxPublishedTemporalChangedArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnMaxPublishedTemporalChangedStub
fake.recordInvocation("OnMaxPublishedTemporalChanged", []interface{}{arg1})
fake.onMaxPublishedTemporalChangedMutex.Unlock()
if stub != nil {
fake.OnMaxPublishedTemporalChangedStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedTemporalChangedCallCount() int {
fake.onMaxPublishedTemporalChangedMutex.RLock()
defer fake.onMaxPublishedTemporalChangedMutex.RUnlock()
return len(fake.onMaxPublishedTemporalChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedTemporalChangedCalls(stub func(*sfu.DownTrack)) {
fake.onMaxPublishedTemporalChangedMutex.Lock()
defer fake.onMaxPublishedTemporalChangedMutex.Unlock()
fake.OnMaxPublishedTemporalChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnMaxPublishedTemporalChangedArgsForCall(i int) *sfu.DownTrack {
fake.onMaxPublishedTemporalChangedMutex.RLock()
defer fake.onMaxPublishedTemporalChangedMutex.RUnlock()
argsForCall := fake.onMaxPublishedTemporalChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnREMB(arg1 *sfu.DownTrack, arg2 *rtcp.ReceiverEstimatedMaximumBitrate) {
fake.onREMBMutex.Lock()
fake.onREMBArgsForCall = append(fake.onREMBArgsForCall, struct {
arg1 *sfu.DownTrack
arg2 *rtcp.ReceiverEstimatedMaximumBitrate
}{arg1, arg2})
stub := fake.OnREMBStub
fake.recordInvocation("OnREMB", []interface{}{arg1, arg2})
fake.onREMBMutex.Unlock()
if stub != nil {
fake.OnREMBStub(arg1, arg2)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnREMBCallCount() int {
fake.onREMBMutex.RLock()
defer fake.onREMBMutex.RUnlock()
return len(fake.onREMBArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnREMBCalls(stub func(*sfu.DownTrack, *rtcp.ReceiverEstimatedMaximumBitrate)) {
fake.onREMBMutex.Lock()
defer fake.onREMBMutex.Unlock()
fake.OnREMBStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnREMBArgsForCall(i int) (*sfu.DownTrack, *rtcp.ReceiverEstimatedMaximumBitrate) {
fake.onREMBMutex.RLock()
defer fake.onREMBMutex.RUnlock()
argsForCall := fake.onREMBArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeDownTrackStreamAllocatorListener) OnResume(arg1 *sfu.DownTrack) {
fake.onResumeMutex.Lock()
fake.onResumeArgsForCall = append(fake.onResumeArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnResumeStub
fake.recordInvocation("OnResume", []interface{}{arg1})
fake.onResumeMutex.Unlock()
if stub != nil {
fake.OnResumeStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnResumeCallCount() int {
fake.onResumeMutex.RLock()
defer fake.onResumeMutex.RUnlock()
return len(fake.onResumeArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnResumeCalls(stub func(*sfu.DownTrack)) {
fake.onResumeMutex.Lock()
defer fake.onResumeMutex.Unlock()
fake.OnResumeStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnResumeArgsForCall(i int) *sfu.DownTrack {
fake.onResumeMutex.RLock()
defer fake.onResumeMutex.RUnlock()
argsForCall := fake.onResumeArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscribedLayerChanged(arg1 *sfu.DownTrack, arg2 buffer.VideoLayer) {
fake.onSubscribedLayerChangedMutex.Lock()
fake.onSubscribedLayerChangedArgsForCall = append(fake.onSubscribedLayerChangedArgsForCall, struct {
arg1 *sfu.DownTrack
arg2 buffer.VideoLayer
}{arg1, arg2})
stub := fake.OnSubscribedLayerChangedStub
fake.recordInvocation("OnSubscribedLayerChanged", []interface{}{arg1, arg2})
fake.onSubscribedLayerChangedMutex.Unlock()
if stub != nil {
fake.OnSubscribedLayerChangedStub(arg1, arg2)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscribedLayerChangedCallCount() int {
fake.onSubscribedLayerChangedMutex.RLock()
defer fake.onSubscribedLayerChangedMutex.RUnlock()
return len(fake.onSubscribedLayerChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscribedLayerChangedCalls(stub func(*sfu.DownTrack, buffer.VideoLayer)) {
fake.onSubscribedLayerChangedMutex.Lock()
defer fake.onSubscribedLayerChangedMutex.Unlock()
fake.OnSubscribedLayerChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscribedLayerChangedArgsForCall(i int) (*sfu.DownTrack, buffer.VideoLayer) {
fake.onSubscribedLayerChangedMutex.RLock()
defer fake.onSubscribedLayerChangedMutex.RUnlock()
argsForCall := fake.onSubscribedLayerChangedArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscriptionChanged(arg1 *sfu.DownTrack) {
fake.onSubscriptionChangedMutex.Lock()
fake.onSubscriptionChangedArgsForCall = append(fake.onSubscriptionChangedArgsForCall, struct {
arg1 *sfu.DownTrack
}{arg1})
stub := fake.OnSubscriptionChangedStub
fake.recordInvocation("OnSubscriptionChanged", []interface{}{arg1})
fake.onSubscriptionChangedMutex.Unlock()
if stub != nil {
fake.OnSubscriptionChangedStub(arg1)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscriptionChangedCallCount() int {
fake.onSubscriptionChangedMutex.RLock()
defer fake.onSubscriptionChangedMutex.RUnlock()
return len(fake.onSubscriptionChangedArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscriptionChangedCalls(stub func(*sfu.DownTrack)) {
fake.onSubscriptionChangedMutex.Lock()
defer fake.onSubscriptionChangedMutex.Unlock()
fake.OnSubscriptionChangedStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnSubscriptionChangedArgsForCall(i int) *sfu.DownTrack {
fake.onSubscriptionChangedMutex.RLock()
defer fake.onSubscriptionChangedMutex.RUnlock()
argsForCall := fake.onSubscriptionChangedArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeDownTrackStreamAllocatorListener) OnTransportCCFeedback(arg1 *sfu.DownTrack, arg2 *rtcp.TransportLayerCC) {
fake.onTransportCCFeedbackMutex.Lock()
fake.onTransportCCFeedbackArgsForCall = append(fake.onTransportCCFeedbackArgsForCall, struct {
arg1 *sfu.DownTrack
arg2 *rtcp.TransportLayerCC
}{arg1, arg2})
stub := fake.OnTransportCCFeedbackStub
fake.recordInvocation("OnTransportCCFeedback", []interface{}{arg1, arg2})
fake.onTransportCCFeedbackMutex.Unlock()
if stub != nil {
fake.OnTransportCCFeedbackStub(arg1, arg2)
}
}
func (fake *FakeDownTrackStreamAllocatorListener) OnTransportCCFeedbackCallCount() int {
fake.onTransportCCFeedbackMutex.RLock()
defer fake.onTransportCCFeedbackMutex.RUnlock()
return len(fake.onTransportCCFeedbackArgsForCall)
}
func (fake *FakeDownTrackStreamAllocatorListener) OnTransportCCFeedbackCalls(stub func(*sfu.DownTrack, *rtcp.TransportLayerCC)) {
fake.onTransportCCFeedbackMutex.Lock()
defer fake.onTransportCCFeedbackMutex.Unlock()
fake.OnTransportCCFeedbackStub = stub
}
func (fake *FakeDownTrackStreamAllocatorListener) OnTransportCCFeedbackArgsForCall(i int) (*sfu.DownTrack, *rtcp.TransportLayerCC) {
fake.onTransportCCFeedbackMutex.RLock()
defer fake.onTransportCCFeedbackMutex.RUnlock()
argsForCall := fake.onTransportCCFeedbackArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeDownTrackStreamAllocatorListener) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeDownTrackStreamAllocatorListener) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ sfu.DownTrackStreamAllocatorListener = new(FakeDownTrackStreamAllocatorListener)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+683
View File
@@ -0,0 +1,683 @@
// Code generated by counterfeiter. DO NOT EDIT.
package sfufakes
import (
"sync"
"github.com/livekit/livekit-server/pkg/sfu"
"github.com/livekit/livekit-server/pkg/sfu/buffer"
"github.com/livekit/protocol/livekit"
webrtc "github.com/pion/webrtc/v4"
)
type FakeTrackSender struct {
CloseStub func()
closeMutex sync.RWMutex
closeArgsForCall []struct {
}
HandleRTCPSenderReportDataStub func(webrtc.PayloadType, int32, *livekit.RTCPSenderReportState) error
handleRTCPSenderReportDataMutex sync.RWMutex
handleRTCPSenderReportDataArgsForCall []struct {
arg1 webrtc.PayloadType
arg2 int32
arg3 *livekit.RTCPSenderReportState
}
handleRTCPSenderReportDataReturns struct {
result1 error
}
handleRTCPSenderReportDataReturnsOnCall map[int]struct {
result1 error
}
IDStub func() string
iDMutex sync.RWMutex
iDArgsForCall []struct {
}
iDReturns struct {
result1 string
}
iDReturnsOnCall map[int]struct {
result1 string
}
IsClosedStub func() bool
isClosedMutex sync.RWMutex
isClosedArgsForCall []struct {
}
isClosedReturns struct {
result1 bool
}
isClosedReturnsOnCall map[int]struct {
result1 bool
}
ReceiverRestartStub func(sfu.TrackReceiver)
receiverRestartMutex sync.RWMutex
receiverRestartArgsForCall []struct {
arg1 sfu.TrackReceiver
}
ResyncStub func()
resyncMutex sync.RWMutex
resyncArgsForCall []struct {
}
SetReceiverStub func(sfu.TrackReceiver)
setReceiverMutex sync.RWMutex
setReceiverArgsForCall []struct {
arg1 sfu.TrackReceiver
}
SubscriberIDStub func() livekit.ParticipantID
subscriberIDMutex sync.RWMutex
subscriberIDArgsForCall []struct {
}
subscriberIDReturns struct {
result1 livekit.ParticipantID
}
subscriberIDReturnsOnCall map[int]struct {
result1 livekit.ParticipantID
}
UpTrackBitrateAvailabilityChangeStub func()
upTrackBitrateAvailabilityChangeMutex sync.RWMutex
upTrackBitrateAvailabilityChangeArgsForCall []struct {
}
UpTrackBitrateReportStub func([]int32, sfu.Bitrates)
upTrackBitrateReportMutex sync.RWMutex
upTrackBitrateReportArgsForCall []struct {
arg1 []int32
arg2 sfu.Bitrates
}
UpTrackLayersChangeStub func()
upTrackLayersChangeMutex sync.RWMutex
upTrackLayersChangeArgsForCall []struct {
}
UpTrackMaxPublishedLayerChangeStub func(int32)
upTrackMaxPublishedLayerChangeMutex sync.RWMutex
upTrackMaxPublishedLayerChangeArgsForCall []struct {
arg1 int32
}
UpTrackMaxTemporalLayerSeenChangeStub func(int32)
upTrackMaxTemporalLayerSeenChangeMutex sync.RWMutex
upTrackMaxTemporalLayerSeenChangeArgsForCall []struct {
arg1 int32
}
WriteRTPStub func(*buffer.ExtPacket, int32) int32
writeRTPMutex sync.RWMutex
writeRTPArgsForCall []struct {
arg1 *buffer.ExtPacket
arg2 int32
}
writeRTPReturns struct {
result1 int32
}
writeRTPReturnsOnCall map[int]struct {
result1 int32
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeTrackSender) Close() {
fake.closeMutex.Lock()
fake.closeArgsForCall = append(fake.closeArgsForCall, struct {
}{})
stub := fake.CloseStub
fake.recordInvocation("Close", []interface{}{})
fake.closeMutex.Unlock()
if stub != nil {
fake.CloseStub()
}
}
func (fake *FakeTrackSender) CloseCallCount() int {
fake.closeMutex.RLock()
defer fake.closeMutex.RUnlock()
return len(fake.closeArgsForCall)
}
func (fake *FakeTrackSender) CloseCalls(stub func()) {
fake.closeMutex.Lock()
defer fake.closeMutex.Unlock()
fake.CloseStub = stub
}
func (fake *FakeTrackSender) HandleRTCPSenderReportData(arg1 webrtc.PayloadType, arg2 int32, arg3 *livekit.RTCPSenderReportState) error {
fake.handleRTCPSenderReportDataMutex.Lock()
ret, specificReturn := fake.handleRTCPSenderReportDataReturnsOnCall[len(fake.handleRTCPSenderReportDataArgsForCall)]
fake.handleRTCPSenderReportDataArgsForCall = append(fake.handleRTCPSenderReportDataArgsForCall, struct {
arg1 webrtc.PayloadType
arg2 int32
arg3 *livekit.RTCPSenderReportState
}{arg1, arg2, arg3})
stub := fake.HandleRTCPSenderReportDataStub
fakeReturns := fake.handleRTCPSenderReportDataReturns
fake.recordInvocation("HandleRTCPSenderReportData", []interface{}{arg1, arg2, arg3})
fake.handleRTCPSenderReportDataMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeTrackSender) HandleRTCPSenderReportDataCallCount() int {
fake.handleRTCPSenderReportDataMutex.RLock()
defer fake.handleRTCPSenderReportDataMutex.RUnlock()
return len(fake.handleRTCPSenderReportDataArgsForCall)
}
func (fake *FakeTrackSender) HandleRTCPSenderReportDataCalls(stub func(webrtc.PayloadType, int32, *livekit.RTCPSenderReportState) error) {
fake.handleRTCPSenderReportDataMutex.Lock()
defer fake.handleRTCPSenderReportDataMutex.Unlock()
fake.HandleRTCPSenderReportDataStub = stub
}
func (fake *FakeTrackSender) HandleRTCPSenderReportDataArgsForCall(i int) (webrtc.PayloadType, int32, *livekit.RTCPSenderReportState) {
fake.handleRTCPSenderReportDataMutex.RLock()
defer fake.handleRTCPSenderReportDataMutex.RUnlock()
argsForCall := fake.handleRTCPSenderReportDataArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeTrackSender) HandleRTCPSenderReportDataReturns(result1 error) {
fake.handleRTCPSenderReportDataMutex.Lock()
defer fake.handleRTCPSenderReportDataMutex.Unlock()
fake.HandleRTCPSenderReportDataStub = nil
fake.handleRTCPSenderReportDataReturns = struct {
result1 error
}{result1}
}
func (fake *FakeTrackSender) HandleRTCPSenderReportDataReturnsOnCall(i int, result1 error) {
fake.handleRTCPSenderReportDataMutex.Lock()
defer fake.handleRTCPSenderReportDataMutex.Unlock()
fake.HandleRTCPSenderReportDataStub = nil
if fake.handleRTCPSenderReportDataReturnsOnCall == nil {
fake.handleRTCPSenderReportDataReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.handleRTCPSenderReportDataReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeTrackSender) ID() string {
fake.iDMutex.Lock()
ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)]
fake.iDArgsForCall = append(fake.iDArgsForCall, struct {
}{})
stub := fake.IDStub
fakeReturns := fake.iDReturns
fake.recordInvocation("ID", []interface{}{})
fake.iDMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeTrackSender) IDCallCount() int {
fake.iDMutex.RLock()
defer fake.iDMutex.RUnlock()
return len(fake.iDArgsForCall)
}
func (fake *FakeTrackSender) IDCalls(stub func() string) {
fake.iDMutex.Lock()
defer fake.iDMutex.Unlock()
fake.IDStub = stub
}
func (fake *FakeTrackSender) IDReturns(result1 string) {
fake.iDMutex.Lock()
defer fake.iDMutex.Unlock()
fake.IDStub = nil
fake.iDReturns = struct {
result1 string
}{result1}
}
func (fake *FakeTrackSender) IDReturnsOnCall(i int, result1 string) {
fake.iDMutex.Lock()
defer fake.iDMutex.Unlock()
fake.IDStub = nil
if fake.iDReturnsOnCall == nil {
fake.iDReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.iDReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeTrackSender) IsClosed() bool {
fake.isClosedMutex.Lock()
ret, specificReturn := fake.isClosedReturnsOnCall[len(fake.isClosedArgsForCall)]
fake.isClosedArgsForCall = append(fake.isClosedArgsForCall, struct {
}{})
stub := fake.IsClosedStub
fakeReturns := fake.isClosedReturns
fake.recordInvocation("IsClosed", []interface{}{})
fake.isClosedMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeTrackSender) IsClosedCallCount() int {
fake.isClosedMutex.RLock()
defer fake.isClosedMutex.RUnlock()
return len(fake.isClosedArgsForCall)
}
func (fake *FakeTrackSender) IsClosedCalls(stub func() bool) {
fake.isClosedMutex.Lock()
defer fake.isClosedMutex.Unlock()
fake.IsClosedStub = stub
}
func (fake *FakeTrackSender) IsClosedReturns(result1 bool) {
fake.isClosedMutex.Lock()
defer fake.isClosedMutex.Unlock()
fake.IsClosedStub = nil
fake.isClosedReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeTrackSender) IsClosedReturnsOnCall(i int, result1 bool) {
fake.isClosedMutex.Lock()
defer fake.isClosedMutex.Unlock()
fake.IsClosedStub = nil
if fake.isClosedReturnsOnCall == nil {
fake.isClosedReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isClosedReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeTrackSender) ReceiverRestart(arg1 sfu.TrackReceiver) {
fake.receiverRestartMutex.Lock()
fake.receiverRestartArgsForCall = append(fake.receiverRestartArgsForCall, struct {
arg1 sfu.TrackReceiver
}{arg1})
stub := fake.ReceiverRestartStub
fake.recordInvocation("ReceiverRestart", []interface{}{arg1})
fake.receiverRestartMutex.Unlock()
if stub != nil {
fake.ReceiverRestartStub(arg1)
}
}
func (fake *FakeTrackSender) ReceiverRestartCallCount() int {
fake.receiverRestartMutex.RLock()
defer fake.receiverRestartMutex.RUnlock()
return len(fake.receiverRestartArgsForCall)
}
func (fake *FakeTrackSender) ReceiverRestartCalls(stub func(sfu.TrackReceiver)) {
fake.receiverRestartMutex.Lock()
defer fake.receiverRestartMutex.Unlock()
fake.ReceiverRestartStub = stub
}
func (fake *FakeTrackSender) ReceiverRestartArgsForCall(i int) sfu.TrackReceiver {
fake.receiverRestartMutex.RLock()
defer fake.receiverRestartMutex.RUnlock()
argsForCall := fake.receiverRestartArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeTrackSender) Resync() {
fake.resyncMutex.Lock()
fake.resyncArgsForCall = append(fake.resyncArgsForCall, struct {
}{})
stub := fake.ResyncStub
fake.recordInvocation("Resync", []interface{}{})
fake.resyncMutex.Unlock()
if stub != nil {
fake.ResyncStub()
}
}
func (fake *FakeTrackSender) ResyncCallCount() int {
fake.resyncMutex.RLock()
defer fake.resyncMutex.RUnlock()
return len(fake.resyncArgsForCall)
}
func (fake *FakeTrackSender) ResyncCalls(stub func()) {
fake.resyncMutex.Lock()
defer fake.resyncMutex.Unlock()
fake.ResyncStub = stub
}
func (fake *FakeTrackSender) SetReceiver(arg1 sfu.TrackReceiver) {
fake.setReceiverMutex.Lock()
fake.setReceiverArgsForCall = append(fake.setReceiverArgsForCall, struct {
arg1 sfu.TrackReceiver
}{arg1})
stub := fake.SetReceiverStub
fake.recordInvocation("SetReceiver", []interface{}{arg1})
fake.setReceiverMutex.Unlock()
if stub != nil {
fake.SetReceiverStub(arg1)
}
}
func (fake *FakeTrackSender) SetReceiverCallCount() int {
fake.setReceiverMutex.RLock()
defer fake.setReceiverMutex.RUnlock()
return len(fake.setReceiverArgsForCall)
}
func (fake *FakeTrackSender) SetReceiverCalls(stub func(sfu.TrackReceiver)) {
fake.setReceiverMutex.Lock()
defer fake.setReceiverMutex.Unlock()
fake.SetReceiverStub = stub
}
func (fake *FakeTrackSender) SetReceiverArgsForCall(i int) sfu.TrackReceiver {
fake.setReceiverMutex.RLock()
defer fake.setReceiverMutex.RUnlock()
argsForCall := fake.setReceiverArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeTrackSender) SubscriberID() livekit.ParticipantID {
fake.subscriberIDMutex.Lock()
ret, specificReturn := fake.subscriberIDReturnsOnCall[len(fake.subscriberIDArgsForCall)]
fake.subscriberIDArgsForCall = append(fake.subscriberIDArgsForCall, struct {
}{})
stub := fake.SubscriberIDStub
fakeReturns := fake.subscriberIDReturns
fake.recordInvocation("SubscriberID", []interface{}{})
fake.subscriberIDMutex.Unlock()
if stub != nil {
return stub()
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeTrackSender) SubscriberIDCallCount() int {
fake.subscriberIDMutex.RLock()
defer fake.subscriberIDMutex.RUnlock()
return len(fake.subscriberIDArgsForCall)
}
func (fake *FakeTrackSender) SubscriberIDCalls(stub func() livekit.ParticipantID) {
fake.subscriberIDMutex.Lock()
defer fake.subscriberIDMutex.Unlock()
fake.SubscriberIDStub = stub
}
func (fake *FakeTrackSender) SubscriberIDReturns(result1 livekit.ParticipantID) {
fake.subscriberIDMutex.Lock()
defer fake.subscriberIDMutex.Unlock()
fake.SubscriberIDStub = nil
fake.subscriberIDReturns = struct {
result1 livekit.ParticipantID
}{result1}
}
func (fake *FakeTrackSender) SubscriberIDReturnsOnCall(i int, result1 livekit.ParticipantID) {
fake.subscriberIDMutex.Lock()
defer fake.subscriberIDMutex.Unlock()
fake.SubscriberIDStub = nil
if fake.subscriberIDReturnsOnCall == nil {
fake.subscriberIDReturnsOnCall = make(map[int]struct {
result1 livekit.ParticipantID
})
}
fake.subscriberIDReturnsOnCall[i] = struct {
result1 livekit.ParticipantID
}{result1}
}
func (fake *FakeTrackSender) UpTrackBitrateAvailabilityChange() {
fake.upTrackBitrateAvailabilityChangeMutex.Lock()
fake.upTrackBitrateAvailabilityChangeArgsForCall = append(fake.upTrackBitrateAvailabilityChangeArgsForCall, struct {
}{})
stub := fake.UpTrackBitrateAvailabilityChangeStub
fake.recordInvocation("UpTrackBitrateAvailabilityChange", []interface{}{})
fake.upTrackBitrateAvailabilityChangeMutex.Unlock()
if stub != nil {
fake.UpTrackBitrateAvailabilityChangeStub()
}
}
func (fake *FakeTrackSender) UpTrackBitrateAvailabilityChangeCallCount() int {
fake.upTrackBitrateAvailabilityChangeMutex.RLock()
defer fake.upTrackBitrateAvailabilityChangeMutex.RUnlock()
return len(fake.upTrackBitrateAvailabilityChangeArgsForCall)
}
func (fake *FakeTrackSender) UpTrackBitrateAvailabilityChangeCalls(stub func()) {
fake.upTrackBitrateAvailabilityChangeMutex.Lock()
defer fake.upTrackBitrateAvailabilityChangeMutex.Unlock()
fake.UpTrackBitrateAvailabilityChangeStub = stub
}
func (fake *FakeTrackSender) UpTrackBitrateReport(arg1 []int32, arg2 sfu.Bitrates) {
var arg1Copy []int32
if arg1 != nil {
arg1Copy = make([]int32, len(arg1))
copy(arg1Copy, arg1)
}
fake.upTrackBitrateReportMutex.Lock()
fake.upTrackBitrateReportArgsForCall = append(fake.upTrackBitrateReportArgsForCall, struct {
arg1 []int32
arg2 sfu.Bitrates
}{arg1Copy, arg2})
stub := fake.UpTrackBitrateReportStub
fake.recordInvocation("UpTrackBitrateReport", []interface{}{arg1Copy, arg2})
fake.upTrackBitrateReportMutex.Unlock()
if stub != nil {
fake.UpTrackBitrateReportStub(arg1, arg2)
}
}
func (fake *FakeTrackSender) UpTrackBitrateReportCallCount() int {
fake.upTrackBitrateReportMutex.RLock()
defer fake.upTrackBitrateReportMutex.RUnlock()
return len(fake.upTrackBitrateReportArgsForCall)
}
func (fake *FakeTrackSender) UpTrackBitrateReportCalls(stub func([]int32, sfu.Bitrates)) {
fake.upTrackBitrateReportMutex.Lock()
defer fake.upTrackBitrateReportMutex.Unlock()
fake.UpTrackBitrateReportStub = stub
}
func (fake *FakeTrackSender) UpTrackBitrateReportArgsForCall(i int) ([]int32, sfu.Bitrates) {
fake.upTrackBitrateReportMutex.RLock()
defer fake.upTrackBitrateReportMutex.RUnlock()
argsForCall := fake.upTrackBitrateReportArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeTrackSender) UpTrackLayersChange() {
fake.upTrackLayersChangeMutex.Lock()
fake.upTrackLayersChangeArgsForCall = append(fake.upTrackLayersChangeArgsForCall, struct {
}{})
stub := fake.UpTrackLayersChangeStub
fake.recordInvocation("UpTrackLayersChange", []interface{}{})
fake.upTrackLayersChangeMutex.Unlock()
if stub != nil {
fake.UpTrackLayersChangeStub()
}
}
func (fake *FakeTrackSender) UpTrackLayersChangeCallCount() int {
fake.upTrackLayersChangeMutex.RLock()
defer fake.upTrackLayersChangeMutex.RUnlock()
return len(fake.upTrackLayersChangeArgsForCall)
}
func (fake *FakeTrackSender) UpTrackLayersChangeCalls(stub func()) {
fake.upTrackLayersChangeMutex.Lock()
defer fake.upTrackLayersChangeMutex.Unlock()
fake.UpTrackLayersChangeStub = stub
}
func (fake *FakeTrackSender) UpTrackMaxPublishedLayerChange(arg1 int32) {
fake.upTrackMaxPublishedLayerChangeMutex.Lock()
fake.upTrackMaxPublishedLayerChangeArgsForCall = append(fake.upTrackMaxPublishedLayerChangeArgsForCall, struct {
arg1 int32
}{arg1})
stub := fake.UpTrackMaxPublishedLayerChangeStub
fake.recordInvocation("UpTrackMaxPublishedLayerChange", []interface{}{arg1})
fake.upTrackMaxPublishedLayerChangeMutex.Unlock()
if stub != nil {
fake.UpTrackMaxPublishedLayerChangeStub(arg1)
}
}
func (fake *FakeTrackSender) UpTrackMaxPublishedLayerChangeCallCount() int {
fake.upTrackMaxPublishedLayerChangeMutex.RLock()
defer fake.upTrackMaxPublishedLayerChangeMutex.RUnlock()
return len(fake.upTrackMaxPublishedLayerChangeArgsForCall)
}
func (fake *FakeTrackSender) UpTrackMaxPublishedLayerChangeCalls(stub func(int32)) {
fake.upTrackMaxPublishedLayerChangeMutex.Lock()
defer fake.upTrackMaxPublishedLayerChangeMutex.Unlock()
fake.UpTrackMaxPublishedLayerChangeStub = stub
}
func (fake *FakeTrackSender) UpTrackMaxPublishedLayerChangeArgsForCall(i int) int32 {
fake.upTrackMaxPublishedLayerChangeMutex.RLock()
defer fake.upTrackMaxPublishedLayerChangeMutex.RUnlock()
argsForCall := fake.upTrackMaxPublishedLayerChangeArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeTrackSender) UpTrackMaxTemporalLayerSeenChange(arg1 int32) {
fake.upTrackMaxTemporalLayerSeenChangeMutex.Lock()
fake.upTrackMaxTemporalLayerSeenChangeArgsForCall = append(fake.upTrackMaxTemporalLayerSeenChangeArgsForCall, struct {
arg1 int32
}{arg1})
stub := fake.UpTrackMaxTemporalLayerSeenChangeStub
fake.recordInvocation("UpTrackMaxTemporalLayerSeenChange", []interface{}{arg1})
fake.upTrackMaxTemporalLayerSeenChangeMutex.Unlock()
if stub != nil {
fake.UpTrackMaxTemporalLayerSeenChangeStub(arg1)
}
}
func (fake *FakeTrackSender) UpTrackMaxTemporalLayerSeenChangeCallCount() int {
fake.upTrackMaxTemporalLayerSeenChangeMutex.RLock()
defer fake.upTrackMaxTemporalLayerSeenChangeMutex.RUnlock()
return len(fake.upTrackMaxTemporalLayerSeenChangeArgsForCall)
}
func (fake *FakeTrackSender) UpTrackMaxTemporalLayerSeenChangeCalls(stub func(int32)) {
fake.upTrackMaxTemporalLayerSeenChangeMutex.Lock()
defer fake.upTrackMaxTemporalLayerSeenChangeMutex.Unlock()
fake.UpTrackMaxTemporalLayerSeenChangeStub = stub
}
func (fake *FakeTrackSender) UpTrackMaxTemporalLayerSeenChangeArgsForCall(i int) int32 {
fake.upTrackMaxTemporalLayerSeenChangeMutex.RLock()
defer fake.upTrackMaxTemporalLayerSeenChangeMutex.RUnlock()
argsForCall := fake.upTrackMaxTemporalLayerSeenChangeArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeTrackSender) WriteRTP(arg1 *buffer.ExtPacket, arg2 int32) int32 {
fake.writeRTPMutex.Lock()
ret, specificReturn := fake.writeRTPReturnsOnCall[len(fake.writeRTPArgsForCall)]
fake.writeRTPArgsForCall = append(fake.writeRTPArgsForCall, struct {
arg1 *buffer.ExtPacket
arg2 int32
}{arg1, arg2})
stub := fake.WriteRTPStub
fakeReturns := fake.writeRTPReturns
fake.recordInvocation("WriteRTP", []interface{}{arg1, arg2})
fake.writeRTPMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeTrackSender) WriteRTPCallCount() int {
fake.writeRTPMutex.RLock()
defer fake.writeRTPMutex.RUnlock()
return len(fake.writeRTPArgsForCall)
}
func (fake *FakeTrackSender) WriteRTPCalls(stub func(*buffer.ExtPacket, int32) int32) {
fake.writeRTPMutex.Lock()
defer fake.writeRTPMutex.Unlock()
fake.WriteRTPStub = stub
}
func (fake *FakeTrackSender) WriteRTPArgsForCall(i int) (*buffer.ExtPacket, int32) {
fake.writeRTPMutex.RLock()
defer fake.writeRTPMutex.RUnlock()
argsForCall := fake.writeRTPArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeTrackSender) WriteRTPReturns(result1 int32) {
fake.writeRTPMutex.Lock()
defer fake.writeRTPMutex.Unlock()
fake.WriteRTPStub = nil
fake.writeRTPReturns = struct {
result1 int32
}{result1}
}
func (fake *FakeTrackSender) WriteRTPReturnsOnCall(i int, result1 int32) {
fake.writeRTPMutex.Lock()
defer fake.writeRTPMutex.Unlock()
fake.WriteRTPStub = nil
if fake.writeRTPReturnsOnCall == nil {
fake.writeRTPReturnsOnCall = make(map[int]struct {
result1 int32
})
}
fake.writeRTPReturnsOnCall[i] = struct {
result1 int32
}{result1}
}
func (fake *FakeTrackSender) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeTrackSender) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ sfu.TrackSender = new(FakeTrackSender)