Question about implementing WebRTC Stats

Lin, Sherrill lshuying at amazon.com
Tue Oct 27 19:31:25 UTC 2020


Hi Matthew,

Thanks a lot for your reply!

We’d like to elaborate on it a bit more. According to webrtc spec (https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats), the mandatory fields for "RTCIceCandidatePairStats" include: transportId, localCandidateId, remoteCandidateId, state, nominated, bytesSent, bytesReceived, totalRoundTripTime, currentRoundTripTime
However, we find some of the fields not easy to implement:

  1.  state, nominated, totalRoundTripTime, currentRoundTripTime

These information are all related to STUN connectivity checks, which currently are not exposed in the Libnice public APIs. It would be very difficult to collect these data without modifying Libnice APIs.

  1.  bytesSent, bytesReceived

These represent the total number of payload bytes sent/received on the candidate pair. We think of some potential approaches:

     *   Add buffer probes in dtlssrtpenc and dtlssrtpdemux to calculate the bytes sent/received
     *   Collect from srtpenc(https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/srtp/gstsrtpenc.c#L1205), dtlsenc(https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlsenc.c#L519), and dtlssrtpdemux(https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlssrtpdemux.c#L105). And we could expose an property in dtlssrtpenc and dtlssrtpdemux for the collected data.
     *   Calculate from the bytes sent/received data in RTP stream stats (https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c#L91). We would also need to gather the data for data-channel because that's not covered in RTP stream stats.
Please let us know if there's a better way to do it.

We'd like to get more guidance on how to implement these fields. If there's no good approach to do it yet, can we leave them out for now?

Thanks,
Sherrill

From: Matthew Waters <ystreet00 at gmail.com>
Date: Friday, October 23, 2020 at 2:44 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>, "Lin, Sherrill" <lshuying at amazon.com>
Cc: comms-media-process <comms-media-process at amazon.com>
Subject: RE: [EXTERNAL] Question about implementing WebRTC Stats

Hi,

It would certainly be beneficial to Implement the mandatory stats required but it wouldn't quite be a hard rejection if they aren't implemented.  It would require a reasonable explanation as to why they aren't implemented for new structures though.

Cheers
-Matt
On 23/10/20 8:00 am, Lin, Sherrill wrote:
Hi there,

Our team in Alexa Communications wants to add selected ice candidates information to WebRTC stats. We find that in gstwebrtcstats.c (https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c), RTCIceCandidateStats, RTCIceCandidatePairStats and RTCTransportStats are not constructed yet. We think these three stats are the structures needed for hosting selected ice candidate data, and we are interested in implementing them following the w3.org spec (https://www.w3.org/TR/webrtc-stats/).

However, we notice there’s a list of mandatory fields for implementing each stats structure: https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats. Does it mean, for Gstreamer community to accept the code changes, we will have to implement all the mandatory fields for all three stats structures as defined in that doc?

Thanks,
Sherrill



_______________________________________________

gstreamer-devel mailing list

gstreamer-devel at lists.freedesktop.org<mailto:gstreamer-devel at lists.freedesktop.org>

https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20201027/54f1217a/attachment-0001.htm>


More information about the gstreamer-devel mailing list