Give rtp stats context to forwarder. (#3202)
This commit is contained in:
+7
-10
@@ -373,12 +373,6 @@ func NewDownTrack(params DowntrackParams) (*DownTrack, error) {
|
||||
d.params.Logger = params.Logger.WithValues(
|
||||
"subscriberID", d.SubscriberID(),
|
||||
)
|
||||
d.forwarder = NewForwarder(
|
||||
d.kind,
|
||||
d.params.Logger,
|
||||
false,
|
||||
d.getExpectedRTPTimestamp,
|
||||
)
|
||||
|
||||
d.rtpStats = rtpstats.NewRTPStatsSender(rtpstats.RTPStatsParams{
|
||||
ClockRate: d.codec.ClockRate,
|
||||
@@ -386,6 +380,13 @@ func NewDownTrack(params DowntrackParams) (*DownTrack, error) {
|
||||
})
|
||||
d.deltaStatsSenderSnapshotId = d.rtpStats.NewSenderSnapshotId()
|
||||
|
||||
d.forwarder = NewForwarder(
|
||||
d.kind,
|
||||
d.params.Logger,
|
||||
false,
|
||||
d.rtpStats,
|
||||
)
|
||||
|
||||
d.connectionStats = connectionquality.NewConnectionStats(connectionquality.ConnectionStatsParams{
|
||||
SenderProvider: d,
|
||||
Logger: d.params.Logger.WithValues("direction", "down"),
|
||||
@@ -2052,10 +2053,6 @@ func (d *DownTrack) DebugInfo() map[string]interface{} {
|
||||
}
|
||||
}
|
||||
|
||||
func (d *DownTrack) getExpectedRTPTimestamp(at time.Time) (uint64, error) {
|
||||
return d.rtpStats.GetExpectedRTPTimestamp(at)
|
||||
}
|
||||
|
||||
func (d *DownTrack) GetConnectionScoreAndQuality() (float32, livekit.ConnectionQuality) {
|
||||
return d.connectionStats.GetScoreAndQuality()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user