mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 08:42:46 +00:00
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:
1 parent
483aafcfc0
commit
0b3587b10d
2 files changed
+7
-2
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user