<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40" dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1332637715;
        mso-list-type:hybrid;
        mso-list-template-ids:353152896 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>
</head>
<body lang="EN-CA" style="text-align:left; direction:ltr;"><div>Hi,</div><div><br></div><div>Answering with my libnice maintainer hat.</div><div><br></div><div>On Tue, 2020-10-27 at 19:31 +0000, Lin, Sherrill wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi Matthew,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks a lot for your reply!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">We’d like to elaborate on it a bit more. According to webrtc spec (<a href="https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats">https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats</a>),
 the mandatory fields for "RTCIceCandidatePairStats" include: <b><i>transportId, localCandidateId, remoteCandidateId, state, nominated, bytesSent, bytesReceived, totalRoundTripTime, currentRoundTripTime</i></b><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">However, we find some of the fields not easy to implement:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><b><i><span style="font-size:11.0pt">state, nominated, totalRoundTripTime, currentRoundTripTime<o:p></o:p></span></i></b></li></ol>
<p class="MsoListParagraph"><span style="font-size:11.0pt">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.</span></p></div></blockquote><div><br></div><div>Libnice currently the state and nominated-ness of each pair in an internal data structure. I think it would be relatively simple to just add a function to retrieve a copy of those.</div><div><br></div><div>Libnice doesn't currently measures the RTT, but we could relatively easily store the time when a STUN request is sent and do the substraction when a reply is received to get this. And we could expose it in the same API.</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="WordSection1"><p class="MsoListParagraph"><span style="font-size:11.0pt"><o:p></o:p></span></p>
<ol style="margin-top:0cm" start="2" type="1">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level1 lfo1"><b><i><span style="font-size:11.0pt">bytesSent, bytesReceived<o:p></o:p></span></i></b></li></ol>
<p class="MsoListParagraph"><span style="font-size:11.0pt">These represent the total number of payload bytes sent/received on the candidate pair. We think of some potential approaches:<o:p></o:p></span></p>
<ol style="margin-top:0cm" start="2" type="1">
<ol style="margin-top:0cm" start="1" type="a">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1"><span style="font-size:11.0pt">Add buffer probes in dtlssrtpenc and dtlssrtpdemux to calculate the bytes sent/received<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1"><span style="font-size:11.0pt">Collect from srtpenc(<a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/srtp/gstsrtpenc.c#L1205">https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/srtp/gstsrtpenc.c#L1205</a>),
 dtlsenc(<a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlsenc.c#L519">https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlsenc.c#L519</a>), and dtlssrtpdemux(<a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlssrtpdemux.c#L105">https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/dtls/gstdtlssrtpdemux.c#L105</a>).
 And we could expose an property in dtlssrtpenc and dtlssrtpdemux for the collected data.<o:p></o:p></span></li><li class="MsoListParagraph" style="margin-left:0cm;mso-list:l0 level2 lfo1"><span style="font-size:11.0pt">Calculate from the bytes sent/received data in RTP stream stats (<a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c#L91">https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c#L91</a>).
 We would also need to gather the data for data-channel because that's not covered in RTP stream stats.<o:p></o:p></span></li></ol>
</ol>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt">Please let us know if there's a better way to do it.
</span></p></div></blockquote><div><br></div><div>I wonder if the best approach wouldn't be to calculate these in libnice and expose them from there directly.</div><div><br></div><div>Doing this at the GStreamer level wouldn't give the accurate result per candidate pair.</div><div><br></div><div>Olivier</div><div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div class="WordSection1"><p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">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?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Sherrill<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:black">From: </span></b><span style="color:black">Matthew Waters <ystreet00@gmail.com><br>
<b>Date: </b>Friday, October 23, 2020 at 2:44 AM<br>
<b>To: </b>Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org>, "Lin, Sherrill" <lshuying@amazon.com><br>
<b>Cc: </b>comms-media-process <comms-media-process@amazon.com><br>
<b>Subject: </b>RE: [EXTERNAL] Question about implementing WebRTC Stats<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
<br>
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.<br>
<br>
Cheers<br>
-Matt<o:p></o:p></p>
<div>
<p class="MsoNormal">On 23/10/20 8:00 am, Lin, Sherrill wrote:<o:p></o:p></p>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi there,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Our team in Alexa Communications wants to add selected ice candidates information to WebRTC stats. We find that in gstwebrtcstats.c (<a href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c">https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/blob/master/ext/webrtc/gstwebrtcstats.c</a>),
 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
 (<a href="https://www.w3.org/TR/webrtc-stats/">https://www.w3.org/TR/webrtc-stats/</a>).</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">However, we notice there’s a list of mandatory fields for implementing each stats structure:
<a href="https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats">https://w3c.github.io/webrtc-pc/#mandatory-to-implement-stats</a>. 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?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Sherrill</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________</pre>
<pre>gstreamer-devel mailing list</pre>
<a href="mailto:gstreamer-devel@lists.freedesktop.org"><pre>gstreamer-devel@lists.freedesktop.org</pre></a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"><pre>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</pre></a>
</blockquote>
<p class="MsoNormal"><span style="font-size:11.0pt"><br>
<br>
<o:p></o:p></span></p>
</div>


<pre>_______________________________________________</pre><pre>gstreamer-devel mailing list</pre><a href="mailto:gstreamer-devel@lists.freedesktop.org"><pre>gstreamer-devel@lists.freedesktop.org</pre></a><pre><br></pre><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel"><pre>https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</pre></a><pre><br></pre></blockquote><div><span><pre>-- <br></pre><div>Olivier Crête</div><div><a href="mailto:olivier.crete@collabora.com">olivier.crete@collabora.com</a></div><div><br></div></span></div></body></html>