Title: [292215] trunk/Source/WebCore
Revision
292215
Author
[email protected]
Date
2022-04-01 04:00:28 -0700 (Fri, 01 Apr 2022)

Log Message

[GStreamer][WebRTC] Improve RTP stats gathering
https://bugs.webkit.org/show_bug.cgi?id=238602

Patch by Philippe Normand <[email protected]> on 2022-04-01
Reviewed by Xabier Rodriguez-Calvar.

Proxy a few more stats fields from GstWebRTC to the WebCore StatsCollector.

* Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
(WebCore::fillInboundRTPStreamStats):
(WebCore::fillOutboundRTPStreamStats):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292214 => 292215)


--- trunk/Source/WebCore/ChangeLog	2022-04-01 10:49:10 UTC (rev 292214)
+++ trunk/Source/WebCore/ChangeLog	2022-04-01 11:00:28 UTC (rev 292215)
@@ -1,3 +1,16 @@
+2022-04-01  Philippe Normand  <[email protected]>
+
+        [GStreamer][WebRTC] Improve RTP stats gathering
+        https://bugs.webkit.org/show_bug.cgi?id=238602
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Proxy a few more stats fields from GstWebRTC to the WebCore StatsCollector.
+
+        * Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp:
+        (WebCore::fillInboundRTPStreamStats):
+        (WebCore::fillOutboundRTPStreamStats):
+
 2022-04-01  Tim Nguyen  <[email protected]>
 
         Unreviewed, fix obsolete FIXME comments in CSSParserFastPaths.cpp

Modified: trunk/Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp (292214 => 292215)


--- trunk/Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp	2022-04-01 10:49:10 UTC (rev 292214)
+++ trunk/Source/WebCore/Modules/mediastream/gstreamer/GStreamerStatsCollector.cpp	2022-04-01 11:00:28 UTC (rev 292215)
@@ -91,18 +91,47 @@
     if (gst_structure_get_uint64(structure, "bytes-received", &value))
         stats.bytesReceived = value;
 
+#if GST_CHECK_VERSION(1, 21, 0)
+    int64_t packetsLost;
+    if (gst_structure_get_int64(structure, "packets-lost", &packetsLost))
+        stats.packetsLost = packetsLosts;
+#else
     unsigned packetsLost;
     if (gst_structure_get_uint(structure, "packets-lost", &packetsLost))
         stats.packetsLost = packetsLost;
+#endif
 
     double jitter;
     if (gst_structure_get_double(structure, "jitter", &jitter))
         stats.jitter = jitter;
 
+    if (gst_structure_get_uint64(structure, "packets-repaired", &value))
+        stats.packetsRepaired = value;
+
+    if (gst_structure_get_uint64(structure, "packets-discarded", &value))
+        stats.packetsDiscarded = value;
+
+    if (gst_structure_get_uint64(structure, "packets-duplicated", &value))
+        stats.packetsDuplicated = value;
+
+    unsigned firCount;
+    if (gst_structure_get_uint(structure, "fir-count", &firCount))
+        stats.firCount = firCount;
+
+    unsigned pliCount;
+    if (gst_structure_get_uint(structure, "pli-count", &pliCount))
+        stats.pliCount = pliCount;
+
+    unsigned nackCount;
+    if (gst_structure_get_uint(structure, "nack-count", &nackCount))
+        stats.nackCount = nackCount;
+
+    uint64_t bytesReceived;
+    if (gst_structure_get_uint64(structure, "bytes-received", &bytesReceived))
+        stats.bytesReceived = bytesReceived;
+
     // FIXME:
     // stats.fractionLost =
-    // stats.packetsDiscarded =
-    // stats.packetsRepaired =
     // stats.burstPacketsLost =
     // stats.burstPacketsDiscarded =
     // stats.burstLossCount =
@@ -124,6 +153,21 @@
     if (gst_structure_get_uint64(structure, "bytes-sent", &value))
         stats.bytesSent = value;
 
+    unsigned firCount;
+    if (gst_structure_get_uint(structure, "fir-count", &firCount))
+        stats.firCount = firCount;
+
+    unsigned pliCount;
+    if (gst_structure_get_uint(structure, "pli-count", &pliCount))
+        stats.pliCount = pliCount;
+
+    unsigned nackCount;
+    if (gst_structure_get_uint(structure, "nack-count", &nackCount))
+        stats.nackCount = nackCount;
+
+    if (const char* remoteId = gst_structure_get_string(structure, "remote-id"))
+        stats.remoteId = remoteId;
+
     // FIXME
     // stats.targetBitrate =
     // stats.framesEncoded =
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to