diff --git a/webrtc/api/stats/rtcstats_objects.h b/webrtc/api/stats/rtcstats_objects.h index cc01b5e551..49135f89a1 100644 --- a/webrtc/api/stats/rtcstats_objects.h +++ b/webrtc/api/stats/rtcstats_objects.h @@ -327,8 +327,8 @@ class RTCRTPStreamStats : public RTCStats { }; // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* -// Tracking bug crbug.com/657855 -// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657855 +// TODO(hbos): Support the remote case |is_remote = true|. +// https://bugs.webrtc.org/7065 class RTCInboundRTPStreamStats final : public RTCRTPStreamStats { public: WEBRTC_RTCSTATS_DECL(); @@ -341,36 +341,38 @@ class RTCInboundRTPStreamStats final : public RTCRTPStreamStats { RTCStatsMember packets_received; RTCStatsMember bytes_received; RTCStatsMember packets_lost; - // TODO(hbos): Not collected in the "video" case by |RTCStatsCollector|. - // crbug.com/657855 + // TODO(hbos): Collect and populate this value for both "audio" and "video", + // currently not collected for "video". https://bugs.webrtc.org/7065 RTCStatsMember jitter; RTCStatsMember fraction_lost; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 + RTCStatsMember round_trip_time; + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember packets_discarded; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember packets_repaired; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_packets_lost; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_packets_discarded; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_loss_count; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_discard_count; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_loss_rate; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_discard_rate; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember gap_loss_rate; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657855 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember gap_discard_rate; RTCStatsMember frames_decoded; }; // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* -// Tracking bug crbug.com/657856 -// TODO(hbos): Support the remote case |is_remote = true|. crbug.com/657856 +// TODO(hbos): Support the remote case |is_remote = true|. +// https://bugs.webrtc.org/7066 class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { public: WEBRTC_RTCSTATS_DECL(); @@ -382,9 +384,8 @@ class RTCOutboundRTPStreamStats final : public RTCRTPStreamStats { RTCStatsMember packets_sent; RTCStatsMember bytes_sent; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/657856 + // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7066 RTCStatsMember target_bitrate; - RTCStatsMember round_trip_time; RTCStatsMember frames_encoded; }; diff --git a/webrtc/pc/rtcstats_integrationtest.cc b/webrtc/pc/rtcstats_integrationtest.cc index 1176b54aee..922e07c12a 100644 --- a/webrtc/pc/rtcstats_integrationtest.cc +++ b/webrtc/pc/rtcstats_integrationtest.cc @@ -553,6 +553,7 @@ class RTCStatsReportVerifier { verifier.TestMemberIsNonNegative(inbound_stream.jitter); } verifier.TestMemberIsNonNegative(inbound_stream.fraction_lost); + verifier.TestMemberIsUndefined(inbound_stream.round_trip_time); verifier.TestMemberIsUndefined(inbound_stream.packets_discarded); verifier.TestMemberIsUndefined(inbound_stream.packets_repaired); verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost); @@ -585,8 +586,6 @@ class RTCStatsReportVerifier { verifier.TestMemberIsNonNegative(outbound_stream.packets_sent); verifier.TestMemberIsNonNegative(outbound_stream.bytes_sent); verifier.TestMemberIsUndefined(outbound_stream.target_bitrate); - // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877 - verifier.MarkMemberTested(outbound_stream.round_trip_time, true); if (outbound_stream.media_type.is_defined() && *outbound_stream.media_type == "video") { verifier.TestMemberIsDefined(outbound_stream.frames_encoded); diff --git a/webrtc/pc/rtcstatscollector.cc b/webrtc/pc/rtcstatscollector.cc index 36a4bdef7e..347bca53ea 100644 --- a/webrtc/pc/rtcstatscollector.cc +++ b/webrtc/pc/rtcstatscollector.cc @@ -261,10 +261,6 @@ void SetOutboundRTPStreamStatsFromMediaSenderInfo( static_cast(media_sender_info.packets_sent); outbound_stats->bytes_sent = static_cast(media_sender_info.bytes_sent); - if (media_sender_info.rtt_ms >= 0) { - outbound_stats->round_trip_time = static_cast( - media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec; - } } void SetOutboundRTPStreamStatsFromVoiceSenderInfo( diff --git a/webrtc/pc/rtcstatscollector_unittest.cc b/webrtc/pc/rtcstatscollector_unittest.cc index db26096c3b..ea7b34a933 100644 --- a/webrtc/pc/rtcstatscollector_unittest.cc +++ b/webrtc/pc/rtcstatscollector_unittest.cc @@ -1959,7 +1959,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) { voice_media_info.senders[0].local_stats[0].ssrc = 1; voice_media_info.senders[0].packets_sent = 2; voice_media_info.senders[0].bytes_sent = 3; - voice_media_info.senders[0].rtt_ms = -1; voice_media_info.senders[0].codec_payload_type = rtc::Optional(42); RtpCodecParameters codec_parameters; @@ -2005,22 +2004,12 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) { expected_audio.codec_id = "RTCCodec_OutboundAudio_42"; expected_audio.packets_sent = 2; expected_audio.bytes_sent = 3; - // |expected_audio.round_trip_time| should be undefined. ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( report->Get(expected_audio.id())->cast_to(), expected_audio); - // Set previously undefined values and "GetStats" again. - voice_media_info.senders[0].rtt_ms = 4500; - expected_audio.round_trip_time = 4.5; - - EXPECT_CALL(*voice_media_channel, GetStats(_)) - .WillOnce(DoAll(SetArgPointee<0>(voice_media_info), Return(true))); - collector_->ClearCachedStatsReport(); - report = GetStatsReport(); - ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( report->Get(expected_audio.id())->cast_to(), @@ -2050,7 +2039,6 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { video_media_info.senders[0].nacks_rcvd = 4; video_media_info.senders[0].packets_sent = 5; video_media_info.senders[0].bytes_sent = 6; - video_media_info.senders[0].rtt_ms = -1; video_media_info.senders[0].codec_payload_type = rtc::Optional(42); video_media_info.senders[0].frames_encoded = 8; video_media_info.senders[0].qp_sum = rtc::Optional(); @@ -2102,8 +2090,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { expected_video.packets_sent = 5; expected_video.bytes_sent = 6; expected_video.frames_encoded = 8; - // |expected_video.round_trip_time| and |expected_video.qp_sum| should be - // undefined. + // |expected_video.qp_sum| should be undefined. ASSERT_TRUE(report->Get(expected_video.id())); EXPECT_EQ( @@ -2111,9 +2098,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { expected_video); // Set previously undefined values and "GetStats" again. - video_media_info.senders[0].rtt_ms = 7500; video_media_info.senders[0].qp_sum = rtc::Optional(9); - expected_video.round_trip_time = 7.5; expected_video.qp_sum = 9; EXPECT_CALL(*video_media_channel, GetStats(_)) diff --git a/webrtc/stats/rtcstats_objects.cc b/webrtc/stats/rtcstats_objects.cc index 9a7ebede6e..5397ef782c 100644 --- a/webrtc/stats/rtcstats_objects.cc +++ b/webrtc/stats/rtcstats_objects.cc @@ -513,6 +513,7 @@ WEBRTC_RTCSTATS_IMPL( &packets_lost, &jitter, &fraction_lost, + &round_trip_time, &packets_discarded, &packets_repaired, &burst_packets_lost, @@ -538,6 +539,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( packets_lost("packetsLost"), jitter("jitter"), fraction_lost("fractionLost"), + round_trip_time("roundTripTime"), packets_discarded("packetsDiscarded"), packets_repaired("packetsRepaired"), burst_packets_lost("burstPacketsLost"), @@ -559,6 +561,7 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( packets_lost(other.packets_lost), jitter(other.jitter), fraction_lost(other.fraction_lost), + round_trip_time(other.round_trip_time), packets_discarded(other.packets_discarded), packets_repaired(other.packets_repaired), burst_packets_lost(other.burst_packets_lost), @@ -580,7 +583,6 @@ WEBRTC_RTCSTATS_IMPL( &packets_sent, &bytes_sent, &target_bitrate, - &round_trip_time, &frames_encoded); RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( @@ -594,7 +596,6 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( packets_sent("packetsSent"), bytes_sent("bytesSent"), target_bitrate("targetBitrate"), - round_trip_time("roundTripTime"), frames_encoded("framesEncoded") { } @@ -604,7 +605,6 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( packets_sent(other.packets_sent), bytes_sent(other.bytes_sent), target_bitrate(other.target_bitrate), - round_trip_time(other.round_trip_time), frames_encoded(other.frames_encoded) { }