W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > September 2018

Re: [webrtc-stats] csrc can be removed and RTCRtpContributingSourceStats can be moved to receiver stats.

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Thu, 13 Sep 2018 20:36:21 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-421144503-1536870980-sysbot+gh@w3.org>
> we can move the RTCRtpContributingSourceStats to be part of RTCAudioReceiverStats

Not easily, because it's a one-to-many relationship.

I.e. [receiver.getContributingSources](http://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcontributingsources) returns a *sequence* of [RTCRtpContributingSource](http://w3c.github.io/webrtc-pc/#idl-def-rtcrtpcontributingsource)s, whereas [RTCRtpContributingSourceStats](https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats) covers *one* csrc. A one-to-many relationship. E.g. you'd do:
```js
async function collectCsrcStats(receiver)
  const stats = await receiver.getStats();
  return [...stats.values()].filter(({type}) => type == "csrc");
}
```

As @na-g mentions, this works in Firefox (assuming you have a server that emits csrcs).

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-stats/issues/371#issuecomment-421144503 using your GitHub account
Received on Thursday, 13 September 2018 20:36:23 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:45 UTC