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<double> jitter;
RTCStatsMember<int32_t> packets_lost; // Signed per RFC 3550 RTCStatsMember<int32_t> packets_lost; // Signed per RFC 3550
RTCStatsMember<uint64_t> packets_discarded;
protected: protected:
RTCReceivedRtpStreamStats(const std::string&& id, int64_t timestamp_us); 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> mid;
RTCStatsMember<std::string> remote_id; RTCStatsMember<std::string> remote_id;
RTCStatsMember<uint32_t> packets_received; RTCStatsMember<uint32_t> packets_received;
RTCStatsMember<uint64_t> packets_discarded;
RTCStatsMember<uint64_t> fec_packets_received; RTCStatsMember<uint64_t> fec_packets_received;
RTCStatsMember<uint64_t> fec_packets_discarded; RTCStatsMember<uint64_t> fec_packets_discarded;
RTCStatsMember<uint64_t> bytes_received; RTCStatsMember<uint64_t> bytes_received;

View File

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

View File

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