<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Various information provided by the
      get-stats signal are incomplete.  You may have to implement some
      of the information you need inside webrtcbin itself.<br>
      <br>
      Cheers<br>
      -Matt<br>
      <br>
      On 7/10/20 3:25 pm, Faraz Khan wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALBWJdUR0x_Avji0fpzhjf2od=gpPcGX54kvQ8A3sA_eLOxt-g@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi everyone,
        <div>Gstreamer noob here - but have worked on C/C++ audio/video
          apps for many years now. I have successfully established a
          webrtc connection with electron as the receiver (and gstreamer
          as send-only) and am now looking to implement some sort of
          simplistic bitrate control and also just to understand how
          gstreamer works.</div>
        <div><br>
        </div>
        <div>My first attempt was to get webrtc peerconnection stats. I
          did:</div>
        <div><br>
        </div>
        <div>GstPromise *p = gst_promise_new_with_change_func(_on_stats,
          NULL, NULL);<br>
          g_signal_emit_by_name(peer->webrtcbin, "get-stats", NULL,
          p);<br>
        </div>
        <div><br>
        </div>
        <div>And decode them using:</div>
        <div><br>
        </div>
        <div>gboolean on_stats_iter(GQuark field, const GValue * value,
          gpointer pfx) {<br>
              gchar *str = gst_value_serialize (value);<br>
              g_print ("%15s: %s", g_quark_to_string (field), str);<br>
              std::cout << std::endl;<br>
              g_free (str);<br>
              return TRUE;<br>
          }<br>
          <br>
          static void _on_stats (GstPromise * promise, gpointer
          user_data) {<br>
              const GstStructure *reply =
          gst_promise_get_reply(promise);<br>
              gst_structure_foreach(reply, on_stats_iter,
          (gpointer)reply);<br>
          }<br>
        </div>
        <div><br>
        </div>
        <div>And this generates: </div>
        <div>peer-connection-stats: "peer-connection\,\
          data-channels-opened\=\(uint\)0\,\
          data-channels-closed\=\(uint\)0\,\
          data-channels-requested\=\(uint\)0\,\
          data-channels-accepted\=\(uint\)0\,\
          type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_PEER_CONNECTION\,\
          timestamp\=\(double\)180230225.79899999\,\
          id\=\(string\)peer-connection-stats\;"<br>
          codec-stats-sink_0: "codec\,\
          type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\
          timestamp\=\(double\)180230225.79899999\,\
          id\=\(string\)codec-stats-sink_0\,\
          payload-type\=\(uint\)96\,\ clock-rate\=\(uint\)90000\,\
          ssrc\=\(uint\)2002222005\;"<br>
          transport-stats_webrtcdtlstransport0: "transport\,\
          type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\
          timestamp\=\(double\)180230225.79899999\,\
          id\=\(string\)transport-stats_webrtcdtlstransport0\;"<br>
          ice-candidate-pair_webrtcnicetransport0: "transport\,\
          type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_TRANSPORT\,\
          timestamp\=\(double\)180230225.79899999\,\
          id\=\(string\)ice-candidate-pair_webrtcnicetransport0\;"<br>
          codec-stats-sink_1: "codec\,\
          type\=\(GstWebRTCStatsType\)GST_WEBRTC_STATS_CODEC\,\
          timestamp\=\(double\)180230225.79899999\,\
          id\=\(string\)codec-stats-sink_1\,\
          payload-type\=\(uint\)97\,\ clock-rate\=\(uint\)48000\,\
          ssrc\=\(uint\)1224562656\;"<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>This has the correct SSRC and codec info - but missing RTP
          information and the data channel stats are incorrect (I do
          have a open and working data channel).</div>
        <div><br>
        </div>
        <div>How does one proceed to debug this? What am I missing?</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>