Title: [295773] trunk
Revision
295773
Author
[email protected]
Date
2022-06-23 03:01:41 -0700 (Thu, 23 Jun 2022)

Log Message

RTCInboundRtpStreamStats  should have a framesDropped property
https://bugs.webkit.org/show_bug.cgi?id=241844
rdar://problem/95669239

Patch by Youenn Fablet <[email protected]> on 2022-06-23
Reviewed by Eric Carlson.

We should add framesDropped to RTCReceivedRtpStreamStats as per spec but our WebRC backend only supports it in RTCInboundRtpStreamStats.
Let's add this property there since this is used by some applications.

* LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html:
* LayoutTests/webrtc/video-stats.html:
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillReceivedRtpStreamStats):
(WebCore::fillInboundRtpStreamStats):

Canonical link: https://commits.webkit.org/251778@main

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https-expected.txt (295772 => 295773)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https-expected.txt	2022-06-23 09:56:38 UTC (rev 295772)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https-expected.txt	2022-06-23 10:01:41 UTC (rev 295773)
@@ -9,7 +9,7 @@
 PASS RTCReceivedRtpStreamStats's packetsLost
 PASS RTCReceivedRtpStreamStats's jitter
 PASS RTCReceivedRtpStreamStats's packetsDiscarded
-FAIL RTCReceivedRtpStreamStats's framesDropped assert_true: Is framesDropped present expected true got false
+PASS RTCReceivedRtpStreamStats's framesDropped
 FAIL RTCInboundRtpStreamStats's receiverId assert_true: Is receiverId present expected true got false
 FAIL RTCInboundRtpStreamStats's remoteId assert_true: Is remoteId present expected true got false
 PASS RTCInboundRtpStreamStats's framesDecoded

Modified: trunk/LayoutTests/webrtc/video-stats.html (295772 => 295773)


--- trunk/LayoutTests/webrtc/video-stats.html	2022-06-23 09:56:38 UTC (rev 295772)
+++ trunk/LayoutTests/webrtc/video-stats.html	2022-06-23 10:01:41 UTC (rev 295773)
@@ -122,6 +122,7 @@
 function checkInboundFramesNumberIncreased(secondConnection, statsSecondConnection, count)
 {
     return getInboundRTPStats(secondConnection).then((stats) => {
+        assert_true("framesDropped" in stats);
         assert_true(!!stats.kind);
         if (stats.framesDecoded > statsSecondConnection.framesDecoded) {
             if (testTimestampDifference(stats.timestamp - statsSecondConnection.timestamp, stats.framesDecoded - statsSecondConnection.framesDecoded))

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp (295772 => 295773)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp	2022-06-23 09:56:38 UTC (rev 295772)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp	2022-06-23 10:01:41 UTC (rev 295773)
@@ -80,12 +80,15 @@
 {
     fillRtpStreamStats(stats, rtcStats);
 
+    // packetsReceived
     if (rtcStats.packets_lost.is_defined())
         stats.packetsLost = *rtcStats.packets_lost;
     if (rtcStats.jitter.is_defined())
         stats.jitter = *rtcStats.jitter;
+    // FIXME: Remove packets_discarded
     if (rtcStats.packets_discarded.is_defined())
         stats.packetsDiscarded = *rtcStats.packets_discarded;
+    // framesDropped
 }
 
 static inline void fillInboundRtpStreamStats(RTCStatsReport::InboundRtpStreamStats& stats, const webrtc::RTCInboundRTPStreamStats& rtcStats)
@@ -114,7 +117,9 @@
         stats.gapLossRate = *rtcStats.gap_loss_rate;
     if (rtcStats.gap_discard_rate.is_defined())
         stats.gapDiscardRate = *rtcStats.gap_discard_rate;
-    // Add frames_dropped and full_frames_lost.
+    if (rtcStats.frames_dropped.is_defined())
+        stats.framesDropped = *rtcStats.frames_dropped;
+    // full_frames_lost.
 
     if (rtcStats.frames_decoded.is_defined())
         stats.framesDecoded = *rtcStats.frames_decoded;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to