Title: [290865] trunk
Revision
290865
Author
you...@apple.com
Date
2022-03-05 03:33:24 -0800 (Sat, 05 Mar 2022)

Log Message

Implement remote-inbound-rtp packetsLost
https://bugs.webkit.org/show_bug.cgi?id=237443

Reviewed by Eric Carlson.

Source/WebCore:

Take benefit of latest backend to expose RemoteInboundRtpStreamStats values inherited from ReceivedRtpStreamStats.
Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillReceivedRtpStreamStats):
(WebCore::fillInboundRtpStreamStats):
(WebCore::fillRemoteInboundRtpStreamStats):

LayoutTests:

* platform/mac/TestExpectations:
* webrtc/video-stats.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290864 => 290865)


--- trunk/LayoutTests/ChangeLog	2022-03-05 11:18:55 UTC (rev 290864)
+++ trunk/LayoutTests/ChangeLog	2022-03-05 11:33:24 UTC (rev 290865)
@@ -1,3 +1,13 @@
+2022-03-05  Youenn Fablet  <you...@apple.com>
+
+        Implement remote-inbound-rtp packetsLost
+        https://bugs.webkit.org/show_bug.cgi?id=237443
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/TestExpectations:
+        * webrtc/video-stats.html:
+
 2022-03-04  Tyler Wilcock  <tyle...@apple.com>
 
         AX: [WebAccessibilityObjectWrapperMac AXAttributeStringSetFont] crashes when given a font with a nil postscript name, font family, or display name

Modified: trunk/LayoutTests/platform/mac/TestExpectations (290864 => 290865)


--- trunk/LayoutTests/platform/mac/TestExpectations	2022-03-05 11:18:55 UTC (rev 290864)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-03-05 11:33:24 UTC (rev 290865)
@@ -2097,7 +2097,6 @@
 [ arm64 ] webrtc/captureCanvas-webrtc-software-h264-high.html [ Pass Failure ]
 #These two are failing on intel as well for ews
 webrtc/h264-baseline.html  [ Failure Timeout ]
-webrtc/video-stats.html [ Pass Failure ]
 
 webkit.org/b/223043 [ BigSur ] webrtc/multi-audio.html [ Pass Failure ]
 

Modified: trunk/LayoutTests/webrtc/video-stats.html (290864 => 290865)


--- trunk/LayoutTests/webrtc/video-stats.html	2022-03-05 11:18:55 UTC (rev 290864)
+++ trunk/LayoutTests/webrtc/video-stats.html	2022-03-05 11:33:24 UTC (rev 290865)
@@ -130,7 +130,7 @@
             assert_not_equals(Object.keys(stats).indexOf("trackId"), -1, "trackId");
             return;
         }
-        if (++count === 20)
+        if (++count === 50)
             return Promise.reject("checking inbound stats frame number increasing timed out");
         return waitFor(50).then(() => {
             return checkInboundFramesNumberIncreased(secondConnection, statsSecondConnection, count)
@@ -148,7 +148,7 @@
             assert_not_equals(Object.keys(stats).indexOf("trackId"), -1, "trackId");
             return;
         }
-        if (++count === 20)
+        if (++count === 50)
             return Promise.reject("checking outbound stats frame number increasing timed out");
         return waitFor(50).then(() => {
             return checkOutboundFramesNumberIncreased(firstConnection, statsFirstConnection, count)
@@ -220,6 +220,7 @@
 
     const remoteInboundStats = await getRemoteInboundRTPStats(firstConnection);
     assert_true(remoteInboundStats.kind === "audio"|| remoteInboundStats.kind === "video", "kind is present");
+    assert_not_equals(remoteInboundStats.packetsLost, undefined);
 }, "Basic video stats");
 
 promise_test(async (test) => {

Modified: trunk/Source/WebCore/ChangeLog (290864 => 290865)


--- trunk/Source/WebCore/ChangeLog	2022-03-05 11:18:55 UTC (rev 290864)
+++ trunk/Source/WebCore/ChangeLog	2022-03-05 11:33:24 UTC (rev 290865)
@@ -1,3 +1,18 @@
+2022-03-05  Youenn Fablet  <you...@apple.com>
+
+        Implement remote-inbound-rtp packetsLost
+        https://bugs.webkit.org/show_bug.cgi?id=237443
+
+        Reviewed by Eric Carlson.
+
+        Take benefit of latest backend to expose RemoteInboundRtpStreamStats values inherited from ReceivedRtpStreamStats.
+        Covered by updated test.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
+        (WebCore::fillReceivedRtpStreamStats):
+        (WebCore::fillInboundRtpStreamStats):
+        (WebCore::fillRemoteInboundRtpStreamStats):
+
 2022-03-05  Oriol Brufau  <obru...@igalia.com>
 
         [css-cascade] Let 'revert-layer' in lowest layer roll back to user styles

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


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp	2022-03-05 11:18:55 UTC (rev 290864)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp	2022-03-05 11:33:24 UTC (rev 290865)
@@ -76,12 +76,10 @@
     }
 }
 
-static inline void fillReceivedRtpStreamStats(RTCStatsReport::ReceivedRtpStreamStats& stats, const webrtc::RTCInboundRTPStreamStats& rtcStats)
+static inline void fillReceivedRtpStreamStats(RTCStatsReport::ReceivedRtpStreamStats& stats, const webrtc::RTCReceivedRtpStreamStats& rtcStats)
 {
     fillRtpStreamStats(stats, rtcStats);
 
-    if (rtcStats.packets_received.is_defined())
-        stats.packetsReceived = *rtcStats.packets_received;
     if (rtcStats.packets_lost.is_defined())
         stats.packetsLost = *rtcStats.packets_lost;
     if (rtcStats.jitter.is_defined())
@@ -88,6 +86,16 @@
         stats.jitter = *rtcStats.jitter;
     if (rtcStats.packets_discarded.is_defined())
         stats.packetsDiscarded = *rtcStats.packets_discarded;
+}
+
+static inline void fillInboundRtpStreamStats(RTCStatsReport::InboundRtpStreamStats& stats, const webrtc::RTCInboundRTPStreamStats& rtcStats)
+{
+    fillReceivedRtpStreamStats(stats, rtcStats);
+
+    // receiverId
+    // remoteId
+    if (rtcStats.packets_received.is_defined())
+        stats.packetsReceived = *rtcStats.packets_received;
     if (rtcStats.packets_repaired.is_defined())
         stats.packetsRepaired = *rtcStats.packets_repaired;
     if (rtcStats.burst_packets_lost.is_defined())
@@ -107,14 +115,7 @@
     if (rtcStats.gap_discard_rate.is_defined())
         stats.gapDiscardRate = *rtcStats.gap_discard_rate;
     // Add frames_dropped and full_frames_lost.
-}
 
-static inline void fillInboundRtpStreamStats(RTCStatsReport::InboundRtpStreamStats& stats, const webrtc::RTCInboundRTPStreamStats& rtcStats)
-{
-    fillReceivedRtpStreamStats(stats, rtcStats);
-
-    // receiverId
-    // remoteId
     if (rtcStats.frames_decoded.is_defined())
         stats.framesDecoded = *rtcStats.frames_decoded;
     if (rtcStats.key_frames_decoded.is_defined())
@@ -188,7 +189,7 @@
 
 static inline void fillRemoteInboundRtpStreamStats(RTCStatsReport::RemoteInboundRtpStreamStats& stats, const webrtc::RTCRemoteInboundRtpStreamStats& rtcStats)
 {
-    fillRTCStats(stats, rtcStats);
+    fillReceivedRtpStreamStats(stats, rtcStats);
 
     // FIXME: this should be filled in fillRtpStreamStats.
     if (rtcStats.ssrc.is_defined())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to