Disable dynamic playout delay for screenshare track (#2663)

Screenshare video has inaccuracy jitter due to its low frame rate and bursty traffic
This commit is contained in:
cnderrauber authored and GitHub committed 2024-04-19 15:25:48 +08:00
1 parent 483aafcfc0
commit 0b3587b10d
2 files changed
+7 -2

No files matched your search

+1
View File
@@ -129,6 +129,7 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
downTrack, err := sfu.NewDownTrack(sfu.DowntrackParams{
Codecs: codecs,
Source: t.params.MediaTrack.Source(),
Receiver: wr,
BufferFactory: sub.GetBufferFactory(),
SubID: subscriberID,
+6 -2
View File
@@ -202,6 +202,7 @@ type ReceiverReportListener func(dt *DownTrack, report *rtcp.ReceiverReport)
type DowntrackParams struct {
Codecs []webrtc.RTPCodecParameters
Source livekit.TrackSource
Receiver TrackReceiver
BufferFactory *buffer.Factory
SubID livekit.ParticipantID
@@ -1603,9 +1604,12 @@ func (d *DownTrack) handleRTCP(bytes []byte) {
*/
if d.playoutDelay != nil {
jitterMs := uint64(r.Jitter*1e3) / uint64(d.codec.ClockRate)
d.playoutDelay.OnSeqAcked(uint16(r.LastSequenceNumber))
d.playoutDelay.SetJitter(uint32(jitterMs))
// screen share track has inaccuracy jitter due to its low frame rate and bursty traffic
if d.params.Source != livekit.TrackSource_SCREEN_SHARE {
jitterMs := uint64(r.Jitter*1e3) / uint64(d.codec.ClockRate)
d.playoutDelay.SetJitter(uint32(jitterMs))
}
}
}
if len(rr.Reports) > 0 {