Generate signed packets_lost in WebRTC-stats
Bug: webrtc:8626 Change-Id: Ibeca29c5bb01e57c87fbf6a3c8589eb4e03089d5 Reviewed-on: https://webrtc-review.googlesource.com/32660 Commit-Queue: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21241}
This commit is contained in:
parent
7ca9ae2e26
commit
719487ec7a
@ -361,7 +361,7 @@ class RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
|
||||
|
||||
RTCStatsMember<uint32_t> packets_received;
|
||||
RTCStatsMember<uint64_t> bytes_received;
|
||||
RTCStatsMember<uint32_t> packets_lost;
|
||||
RTCStatsMember<int32_t> packets_lost; // Signed per RFC 3550
|
||||
// TODO(hbos): Collect and populate this value for both "audio" and "video",
|
||||
// currently not collected for "video". https://bugs.webrtc.org/7065
|
||||
RTCStatsMember<double> jitter;
|
||||
|
||||
@ -633,7 +633,9 @@ class RTCStatsReportVerifier {
|
||||
}
|
||||
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_received);
|
||||
verifier.TestMemberIsNonNegative<uint64_t>(inbound_stream.bytes_received);
|
||||
verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_lost);
|
||||
// packets_lost is defined as signed, but this should never happen in
|
||||
// this test. See RFC 3550.
|
||||
verifier.TestMemberIsNonNegative<int32_t>(inbound_stream.packets_lost);
|
||||
if (inbound_stream.media_type.is_defined() &&
|
||||
*inbound_stream.media_type == "video") {
|
||||
verifier.TestMemberIsUndefined(inbound_stream.jitter);
|
||||
|
||||
@ -224,7 +224,7 @@ void SetInboundRTPStreamStatsFromMediaReceiverInfo(
|
||||
inbound_stats->bytes_received =
|
||||
static_cast<uint64_t>(media_receiver_info.bytes_rcvd);
|
||||
inbound_stats->packets_lost =
|
||||
static_cast<uint32_t>(media_receiver_info.packets_lost);
|
||||
static_cast<int32_t>(media_receiver_info.packets_lost);
|
||||
inbound_stats->fraction_lost =
|
||||
static_cast<double>(media_receiver_info.fraction_lost);
|
||||
}
|
||||
|
||||
@ -1817,7 +1817,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) {
|
||||
voice_media_info.receivers[0].local_stats.push_back(
|
||||
cricket::SsrcReceiverInfo());
|
||||
voice_media_info.receivers[0].local_stats[0].ssrc = 1;
|
||||
voice_media_info.receivers[0].packets_lost = 42;
|
||||
voice_media_info.receivers[0].packets_lost = -1; // Signed per RFC3550
|
||||
voice_media_info.receivers[0].packets_rcvd = 2;
|
||||
voice_media_info.receivers[0].bytes_rcvd = 3;
|
||||
voice_media_info.receivers[0].codec_payload_type = 42;
|
||||
@ -1867,7 +1867,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) {
|
||||
expected_audio.codec_id = "RTCCodec_InboundAudio_42";
|
||||
expected_audio.packets_received = 2;
|
||||
expected_audio.bytes_received = 3;
|
||||
expected_audio.packets_lost = 42;
|
||||
expected_audio.packets_lost = -1;
|
||||
expected_audio.jitter = 4.5;
|
||||
expected_audio.fraction_lost = 5.5;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user