Adjust sender report time stamp for slow publishers. (#1740)

It is possible that publisher paces the media.
So, RTCP sender report from publisher could be ahead of
what is being fowarded by a good amount (have seen up to 2 seconds
ahead). Using the forwarded time stamp for RTCP sender report
in the down stream leads to jumps back and forth in the down track
RTCP sender report.

So, look at the publisher's RTCP sender report to check for it being
ahead and use the publisher rate as a guide.
This commit is contained in:
Raja Subramanian
2023-05-25 21:55:54 +05:30
committed by GitHub
parent 11c5737e04
commit 0354626bfc
7 changed files with 253 additions and 135 deletions
+3 -3
View File
@@ -654,7 +654,7 @@ func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) {
srData := &RTCPSenderReportData{
RTPTimestamp: rtpTime,
NTPTimestamp: mediatransportutil.NtpTime(ntpTime),
ArrivalTime: time.Now(),
At: time.Now(),
}
b.RLock()
@@ -668,7 +668,7 @@ func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64) {
}
}
func (b *Buffer) GetSenderReportData() *RTCPSenderReportData {
func (b *Buffer) GetSenderReportData() (*RTCPSenderReportData, *RTCPSenderReportData) {
b.RLock()
defer b.RUnlock()
@@ -676,7 +676,7 @@ func (b *Buffer) GetSenderReportData() *RTCPSenderReportData {
return b.rtpStats.GetRtcpSenderReportData()
}
return nil
return nil, nil
}
func (b *Buffer) SetLastFractionLostReport(lost uint8) {