mirror of
https://github.com/livekit/livekit.git
synced 2026-05-15 03:05:26 +00:00
Merge remote-tracking branch 'origin/master' into raja_1833
This commit is contained in:
@@ -944,6 +944,25 @@ func (r *RTPStats) GetRtcpSenderReport(ssrc uint32, calculatedClockRate uint32)
|
||||
"nowRTPExt", nowRTPExt,
|
||||
"nowRTPExtUsingRate", nowRTPExtUsingRate,
|
||||
)
|
||||
} else {
|
||||
packetDriftResult, reportDriftResult := r.getDrift()
|
||||
r.logger.Debugw(
|
||||
"sending sender report",
|
||||
"ntp", nowNTP.Time().String(),
|
||||
"rtp", nowRTP,
|
||||
"departure", now.String(),
|
||||
"ntpDiffSinceLast", ntpDiffSinceLast.Seconds(),
|
||||
"rtpDiffSinceLast", int32(rtpDiffSinceLast),
|
||||
"departureDiffSinceLast", departureDiffSinceLast.Seconds(),
|
||||
"expectedTimeDiffSinceLast", expectedTimeDiffSinceLast,
|
||||
"packetDrift", packetDriftResult.String(),
|
||||
"reportDrift", reportDriftResult.String(),
|
||||
"highestTS", r.highestTS,
|
||||
"highestTime", r.highestTime.String(),
|
||||
"calculatedClockRate", calculatedClockRate,
|
||||
"nowRTPExt", nowRTPExt,
|
||||
"nowRTPExtUsingRate", nowRTPExtUsingRate,
|
||||
)
|
||||
}
|
||||
|
||||
return &rtcp.SenderReport{
|
||||
|
||||
@@ -1177,7 +1177,11 @@ func (d *DownTrack) CreateSenderReport() *rtcp.SenderReport {
|
||||
return nil
|
||||
}
|
||||
|
||||
return d.rtpStats.GetRtcpSenderReport(d.ssrc, d.receiver.GetCalculatedClockRate(d.forwarder.CurrentLayer().Spatial))
|
||||
clockLayer := d.forwarder.CurrentLayer().Spatial
|
||||
if clockLayer == buffer.InvalidLayerSpatial {
|
||||
clockLayer = d.forwarder.GetReferenceLayerSpatial()
|
||||
}
|
||||
return d.rtpStats.GetRtcpSenderReport(d.ssrc, d.receiver.GetCalculatedClockRate(clockLayer))
|
||||
}
|
||||
|
||||
func (d *DownTrack) writeBlankFrameRTP(duration float32, generation uint32) chan struct{} {
|
||||
|
||||
@@ -529,6 +529,13 @@ func (f *Forwarder) GetMaxSubscribedSpatial() int32 {
|
||||
return layer
|
||||
}
|
||||
|
||||
func (f *Forwarder) GetReferenceLayerSpatial() int32 {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
|
||||
return f.referenceLayerSpatial
|
||||
}
|
||||
|
||||
func (f *Forwarder) isDeficientLocked() bool {
|
||||
return f.lastAllocation.IsDeficient
|
||||
}
|
||||
@@ -1992,6 +1999,18 @@ done:
|
||||
if !targetLayer.IsValid() {
|
||||
distance += (maxSeenLayer.Temporal + 1)
|
||||
}
|
||||
// TODO-REMOVE-AFTER-DEBUG
|
||||
logger.Debugw(
|
||||
"distance to desired",
|
||||
"maxSeenLauer", maxSeenLayer,
|
||||
"availableLayers", availableLayers,
|
||||
"brs", brs,
|
||||
"targetLayer", targetLayer,
|
||||
"maxLayer", maxLayer,
|
||||
"adjustedMaxLayer", adjustedMaxLayer,
|
||||
"maxAvailableSpatial", maxAvailableSpatial,
|
||||
"maxAvailableTemporal", maxAvailableTemporal,
|
||||
)
|
||||
|
||||
return float64(distance) / float64(maxSeenLayer.Temporal+1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user