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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user