mirror of
https://github.com/livekit/livekit.git
synced 2026-08-27 22:34:25 +00:00
Cache RTCP sender report in forwarder state. (#2994)
* Cache RTCP sender report in forwarder state. To be used in migration. TODO: need to check more places to operate pure in unix nano rather than converting. * match name
This commit is contained in:
@@ -35,7 +35,6 @@ import (
|
||||
dd "github.com/livekit/livekit-server/pkg/sfu/rtpextension/dependencydescriptor"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/utils"
|
||||
sutils "github.com/livekit/livekit-server/pkg/utils"
|
||||
"github.com/livekit/mediatransportutil"
|
||||
"github.com/livekit/mediatransportutil/pkg/bucket"
|
||||
"github.com/livekit/mediatransportutil/pkg/nack"
|
||||
"github.com/livekit/mediatransportutil/pkg/twcc"
|
||||
@@ -935,12 +934,12 @@ func (b *Buffer) buildReceptionReport() *rtcp.ReceptionReport {
|
||||
|
||||
func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64, packets uint32, octets uint32) {
|
||||
b.RLock()
|
||||
srData := &RTCPSenderReportData{
|
||||
RTPTimestamp: rtpTime,
|
||||
NTPTimestamp: mediatransportutil.NtpTime(ntpTime),
|
||||
At: b.getMonotonicNow(),
|
||||
srData := &livekit.RTCPSenderReportState{
|
||||
RtpTimestamp: rtpTime,
|
||||
NtpTimestamp: ntpTime,
|
||||
At: b.getMonotonicNowUnixNano(),
|
||||
Packets: packets,
|
||||
Octets: octets,
|
||||
Octets: uint64(octets),
|
||||
}
|
||||
|
||||
didSet := false
|
||||
@@ -956,7 +955,7 @@ func (b *Buffer) SetSenderReportData(rtpTime uint32, ntpTime uint64, packets uin
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Buffer) GetSenderReportData() *RTCPSenderReportData {
|
||||
func (b *Buffer) GetSenderReportData() *livekit.RTCPSenderReportState {
|
||||
b.RLock()
|
||||
defer b.RUnlock()
|
||||
|
||||
@@ -1126,10 +1125,6 @@ func (b *Buffer) getMonotonicNowUnixNano() int64 {
|
||||
return b.baseTime.Add(time.Since(b.baseTime)).UnixNano()
|
||||
}
|
||||
|
||||
func (b *Buffer) getMonotonicNow() time.Time {
|
||||
return b.baseTime.Add(time.Since(b.baseTime))
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
// SVC-TODO: Have to use more conditions to differentiate between
|
||||
|
||||
Reference in New Issue
Block a user