Push/pull for connection stats/quality scoring. (#1505)

* Push/pull for connection stats/quality scoring.

Was not happy with pure pull method missing a window because
of RTCP RR timing is slightly off for audio and using a much
larger window of data in the next update.

That also resulted in RTP stats getting some bits of code.
As that is per-packet processing, was not a good idea.

Switching to push-pull method.
For up track, it is pull, i. e. connection stats worker will pull stats.

For down track, there is a new notification about receiver report
reception. Using this to check for time to run stats. And adding a bit
of tolerance for processing window (currently set so that as long as it
is > 95% of usual processing interval). This allows two things
- for video, RTCP RR are more frequent, but we will still not process
  till enough time has passed
- for audio, RTCP RR could be once in 5 seconds or so. Can process when
  it is available rather than miss a window and use a much larger window
  later.

* uber atomic
This commit is contained in:
Raja Subramanian
2023-03-09 11:51:20 +05:30
committed by GitHub
parent 54bf7e0dac
commit 14b0b48b15
3 changed files with 89 additions and 56 deletions
+2
View File
@@ -1307,6 +1307,8 @@ func (d *DownTrack) handleRTCP(bytes []byte) {
l(d, rr)
}
d.listenerLock.RUnlock()
d.connectionStats.ReceiverReportReceived(time.Now())
}
case *rtcp.TransportLayerNack: