Commit 303d1553 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Handle sender reports for down tracks.

In principle, we should be receiving receiver reports only, but let's
be robust.
parent 8fda40b5
...@@ -866,16 +866,13 @@ func rtcpDownListener(conn *rtpDownConnection, track *rtpDownTrack, s *webrtc.RT ...@@ -866,16 +866,13 @@ func rtcpDownListener(conn *rtpDownConnection, track *rtpDownTrack, s *webrtc.RT
case *rtcp.ReceiverReport: case *rtcp.ReceiverReport:
for _, r := range p.Reports { for _, r := range p.Reports {
if r.SSRC == track.track.SSRC() { if r.SSRC == track.track.SSRC() {
now := mono.Microseconds() handleReport(track, r)
track.stats.Set( }
r.FractionLost, }
r.Jitter, case *rtcp.SenderReport:
now, for _, r := range p.Reports {
) if r.SSRC == track.track.SSRC() {
track.updateRate( handleReport(track, r)
r.FractionLost,
now,
)
} }
} }
case *rtcp.TransportLayerNack: case *rtcp.TransportLayerNack:
...@@ -891,6 +888,12 @@ func rtcpDownListener(conn *rtpDownConnection, track *rtpDownTrack, s *webrtc.RT ...@@ -891,6 +888,12 @@ func rtcpDownListener(conn *rtpDownConnection, track *rtpDownTrack, s *webrtc.RT
} }
} }
func handleReport(track *rtpDownTrack, report rtcp.ReceptionReport) {
now := mono.Microseconds()
track.stats.Set(report.FractionLost, report.Jitter, now)
track.updateRate(report.FractionLost, now)
}
func trackKinds(down *rtpDownConnection) (audio bool, video bool) { func trackKinds(down *rtpDownConnection) (audio bool, video bool) {
if down.pc == nil { if down.pc == nil {
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment