Skip to content
Permalink
Browse files
RTCInboundRtpStreamStats should have a framesDropped property
https://bugs.webkit.org/show_bug.cgi?id=241844
rdar://problem/95669239

Patch by Youenn Fablet <youennf@gmail.com> 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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Jun 23, 2022
1 parent 7b400c2 commit bae248d163fd1d512dcdc814445da18fd879b42d
Showing 3 changed files with 8 additions and 2 deletions.
@@ -9,7 +9,7 @@ PASS RTCReceivedRtpStreamStats's packetsReceived
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
@@ -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))
@@ -80,12 +80,15 @@ static inline void fillReceivedRtpStreamStats(RTCStatsReport::ReceivedRtpStreamS
{
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 @@ static inline void fillInboundRtpStreamStats(RTCStatsReport::InboundRtpStreamSta
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;

0 comments on commit bae248d

Please sign in to comment.