Move packetsDiscarded to inbound-rtp.

packetsDiscarded was previously moved to RTCInboundRtpStreamStats:
https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict*

Bug: webrtc:14514
Change-Id: I322b64ede4e64cef1c8234e9626121d96d945355
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277820
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38297}
This commit is contained in:
Henrik Boström 2022-10-03 17:26:41 +02:00 committed by WebRTC LUCI CQ
parent cfbda697ec
commit a494e4b517
3 changed files with 13 additions and 19 deletions

View File

@ -412,7 +412,6 @@ class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRTPStreamStats {
RTCStatsMember<double> jitter;
RTCStatsMember<int32_t> packets_lost; // Signed per RFC 3550
RTCStatsMember<uint64_t> packets_discarded;
protected:
RTCReceivedRtpStreamStats(const std::string&& id, int64_t timestamp_us);
@ -452,6 +451,7 @@ class RTC_EXPORT RTCInboundRTPStreamStats final
RTCStatsMember<std::string> mid;
RTCStatsMember<std::string> remote_id;
RTCStatsMember<uint32_t> packets_received;
RTCStatsMember<uint64_t> packets_discarded;
RTCStatsMember<uint64_t> fec_packets_received;
RTCStatsMember<uint64_t> fec_packets_discarded;
RTCStatsMember<uint64_t> bytes_received;

View File

@ -795,9 +795,7 @@ class RTCStatsReportVerifier {
bool VerifyRTCInboundRTPStreamStats(
const RTCInboundRTPStreamStats& inbound_stream) {
RTCStatsVerifier verifier(report_.get(), &inbound_stream);
VerifyRTCReceivedRtpStreamStats(
inbound_stream, verifier,
inbound_stream.kind.is_defined() && *inbound_stream.kind == "audio");
VerifyRTCReceivedRtpStreamStats(inbound_stream, verifier);
verifier.TestMemberIsOptionalIDReference(
inbound_stream.remote_id, RTCRemoteOutboundRtpStreamStats::kType);
verifier.TestMemberIsDefined(inbound_stream.mid);
@ -811,11 +809,14 @@ class RTCStatsReportVerifier {
}
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_received);
if (inbound_stream.kind.is_defined() && *inbound_stream.kind == "audio") {
verifier.TestMemberIsNonNegative<uint64_t>(
inbound_stream.packets_discarded);
verifier.TestMemberIsNonNegative<uint64_t>(
inbound_stream.fec_packets_received);
verifier.TestMemberIsNonNegative<uint64_t>(
inbound_stream.fec_packets_discarded);
} else {
verifier.TestMemberIsUndefined(inbound_stream.packets_discarded);
verifier.TestMemberIsUndefined(inbound_stream.fec_packets_received);
verifier.TestMemberIsUndefined(inbound_stream.fec_packets_discarded);
}
@ -1025,23 +1026,16 @@ class RTCStatsReportVerifier {
void VerifyRTCReceivedRtpStreamStats(
const RTCReceivedRtpStreamStats& received_rtp,
RTCStatsVerifier& verifier,
bool packets_discarded_defined) {
RTCStatsVerifier& verifier) {
VerifyRTCRTPStreamStats(received_rtp, verifier);
verifier.TestMemberIsNonNegative<double>(received_rtp.jitter);
verifier.TestMemberIsDefined(received_rtp.packets_lost);
if (packets_discarded_defined) {
verifier.TestMemberIsNonNegative<uint64_t>(
received_rtp.packets_discarded);
} else {
verifier.TestMemberIsUndefined(received_rtp.packets_discarded);
}
}
bool VerifyRTCRemoteInboundRtpStreamStats(
const RTCRemoteInboundRtpStreamStats& remote_inbound_stream) {
RTCStatsVerifier verifier(report_.get(), &remote_inbound_stream);
VerifyRTCReceivedRtpStreamStats(remote_inbound_stream, verifier, false);
VerifyRTCReceivedRtpStreamStats(remote_inbound_stream, verifier);
verifier.TestMemberIsDefined(remote_inbound_stream.fraction_lost);
verifier.TestMemberIsIDReference(remote_inbound_stream.local_id,
RTCOutboundRTPStreamStats::kType);

View File

@ -601,8 +601,7 @@ RTCRTPStreamStats::~RTCRTPStreamStats() {}
WEBRTC_RTCSTATS_IMPL(
RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp",
&jitter,
&packets_lost,
&packets_discarded)
&packets_lost)
// clang-format on
RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id,
@ -613,15 +612,13 @@ RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id,
int64_t timestamp_us)
: RTCRTPStreamStats(std::move(id), timestamp_us),
jitter("jitter"),
packets_lost("packetsLost"),
packets_discarded("packetsDiscarded") {}
packets_lost("packetsLost") {}
RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(
const RTCReceivedRtpStreamStats& other)
: RTCRTPStreamStats(other),
jitter(other.jitter),
packets_lost(other.packets_lost),
packets_discarded(other.packets_discarded) {}
packets_lost(other.packets_lost) {}
RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {}
@ -656,6 +653,7 @@ WEBRTC_RTCSTATS_IMPL(
&mid,
&remote_id,
&packets_received,
&packets_discarded,
&fec_packets_received,
&fec_packets_discarded,
&bytes_received,
@ -708,6 +706,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id,
mid("mid"),
remote_id("remoteId"),
packets_received("packetsReceived"),
packets_discarded("packetsDiscarded"),
fec_packets_received("fecPacketsReceived"),
fec_packets_discarded("fecPacketsDiscarded"),
bytes_received("bytesReceived"),
@ -756,6 +755,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(
mid(other.mid),
remote_id(other.remote_id),
packets_received(other.packets_received),
packets_discarded(other.packets_discarded),
fec_packets_received(other.fec_packets_received),
fec_packets_discarded(other.fec_packets_discarded),
bytes_received(other.bytes_received),