8.5 The stats selection algorithm
The stats selection algorithm is as follows:
- Let result be an empty
RTCStatsReport
. - If selector is
null
, gather stats for the whole connection, add them to result, return result, and abort these steps. - If selector is an
RTCRtpSender
, gather stats for and add the following objects to result:- All
RTCOutboundRtpStreamStats
objects representing RTP streams being sent by selector. - All stats objects referenced directly or indirectly by the
RTCOutboundRtpStreamStats
objects added.
- All
- If selector is an
RTCRtpReceiver
, gather stats for and add the following objects to result:- All
RTCInboundRtpStreamStats
objects representing RTP streams being received by selector. - All stats objects referenced directly or indirectly by the
RTCInboundRtpStreamStats
added.
- All
- Return result.