From 1f98b466b8cbbd74d6be7329fd843bef0de6e783 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Tue, 7 Mar 2023 09:53:59 +0100 Subject: [PATCH] stats: rename RTCInboundRTPStreamStats and RTCOutboundRTPStreamStats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to RTCInboundRtpStreamStats and RTCOutboundRtpStreamStats respectively which follows the camel-casing convention used elsewhere. The old name is kept around as an alias for a limited amount of time to allow upgrading dependencies. BUG=webrtc:14973 Change-Id: Ibf4e65933fd6cc2e7e89955042f6f8fb0f6c7853 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/296261 Reviewed-by: Henrik Boström Reviewed-by: Harald Alvestrand Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/main@{#39497} --- api/stats/rtcstats_objects.h | 20 +++--- pc/peer_connection_field_trial_tests.cc | 4 +- pc/peer_connection_integrationtest.cc | 20 +++--- pc/peer_connection_simulcast_unittest.cc | 48 ++++++------- pc/rtc_stats_collector.cc | 48 ++++++------- pc/rtc_stats_collector.h | 2 +- pc/rtc_stats_collector_unittest.cc | 70 +++++++++---------- pc/rtc_stats_integrationtest.cc | 28 ++++---- pc/rtc_stats_traversal.cc | 8 +-- pc/test/integration_test_helpers.cc | 2 +- pc/test/integration_test_helpers.h | 6 +- pc/test/svc_e2e_tests.cc | 2 +- stats/rtcstats_objects.cc | 20 +++--- .../audio/default_audio_quality_analyzer.cc | 2 +- .../video/video_quality_metrics_reporter.cc | 2 +- test/pc/e2e/cross_media_metrics_reporter.cc | 8 +-- .../e2e/network_quality_metrics_reporter.cc | 4 +- ..._based_network_quality_metrics_reporter.cc | 4 +- 18 files changed, 151 insertions(+), 147 deletions(-) diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h index 44859375d8..b4b272d2af 100644 --- a/api/stats/rtcstats_objects.h +++ b/api/stats/rtcstats_objects.h @@ -406,14 +406,14 @@ class RTC_EXPORT RTCSentRtpStreamStats : public RTCRtpStreamStats { }; // https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* -class RTC_EXPORT RTCInboundRTPStreamStats final +class RTC_EXPORT RTCInboundRtpStreamStats final : public RTCReceivedRtpStreamStats { public: WEBRTC_RTCSTATS_DECL(); - RTCInboundRTPStreamStats(std::string id, Timestamp timestamp); - RTCInboundRTPStreamStats(const RTCInboundRTPStreamStats& other); - ~RTCInboundRTPStreamStats() override; + RTCInboundRtpStreamStats(std::string id, Timestamp timestamp); + RTCInboundRtpStreamStats(const RTCInboundRtpStreamStats& other); + ~RTCInboundRtpStreamStats() override; // TODO(https://crbug.com/webrtc/14174): Implement trackIdentifier and kind. @@ -493,16 +493,18 @@ class RTC_EXPORT RTCInboundRTPStreamStats final // The former googMinPlayoutDelayMs (in seconds). RTCNonStandardStatsMember min_playout_delay; }; +// TODO(bugs.webrtc.org/14973): remove name alias. +using RTCInboundRTPStreamStats = RTCInboundRtpStreamStats; // https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* -class RTC_EXPORT RTCOutboundRTPStreamStats final +class RTC_EXPORT RTCOutboundRtpStreamStats final : public RTCSentRtpStreamStats { public: WEBRTC_RTCSTATS_DECL(); - RTCOutboundRTPStreamStats(std::string id, Timestamp timestamp); - RTCOutboundRTPStreamStats(const RTCOutboundRTPStreamStats& other); - ~RTCOutboundRTPStreamStats() override; + RTCOutboundRtpStreamStats(std::string id, Timestamp timestamp); + RTCOutboundRtpStreamStats(const RTCOutboundRtpStreamStats& other); + ~RTCOutboundRtpStreamStats() override; RTCStatsMember media_source_id; RTCStatsMember remote_id; @@ -544,6 +546,8 @@ class RTC_EXPORT RTCOutboundRTPStreamStats final power_efficient_encoder; RTCStatsMember scalability_mode; }; +// TODO(bugs.webrtc.org/14973): remove name alias. +using RTCOutboundRTPStreamStats = RTCOutboundRtpStreamStats; // https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict* class RTC_EXPORT RTCRemoteInboundRtpStreamStats final diff --git a/pc/peer_connection_field_trial_tests.cc b/pc/peer_connection_field_trial_tests.cc index 784cfa4ad5..9220623e60 100644 --- a/pc/peer_connection_field_trial_tests.cc +++ b/pc/peer_connection_field_trial_tests.cc @@ -266,8 +266,8 @@ TEST_F(PeerConnectionFieldTrialTest, ApplyFakeNetworkConfig) { // Send packets for kDefaultTimeoutMs WAIT(false, kDefaultTimeoutMs); - std::vector outbound_rtp_stats = - caller->GetStats()->GetStatsOfType(); + std::vector outbound_rtp_stats = + caller->GetStats()->GetStatsOfType(); ASSERT_GE(outbound_rtp_stats.size(), 1u); ASSERT_TRUE(outbound_rtp_stats[0]->target_bitrate.is_defined()); // Link capacity is limited to 500k, so BWE is expected to be close to 500k. diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index feeeea3685..812833000b 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc @@ -1350,7 +1350,7 @@ TEST_P(PeerConnectionIntegrationTest, NewGetStatsManyAudioAndManyVideoStreams) { caller()->NewGetStats(); ASSERT_TRUE(caller_report); auto outbound_stream_stats = - caller_report->GetStatsOfType(); + caller_report->GetStatsOfType(); ASSERT_EQ(outbound_stream_stats.size(), 4u); std::vector outbound_track_ids; for (const auto& stat : outbound_stream_stats) { @@ -1375,7 +1375,7 @@ TEST_P(PeerConnectionIntegrationTest, NewGetStatsManyAudioAndManyVideoStreams) { callee()->NewGetStats(); ASSERT_TRUE(callee_report); auto inbound_stream_stats = - callee_report->GetStatsOfType(); + callee_report->GetStatsOfType(); ASSERT_EQ(4u, inbound_stream_stats.size()); std::vector inbound_track_ids; for (const auto& stat : inbound_stream_stats) { @@ -1414,7 +1414,7 @@ TEST_P(PeerConnectionIntegrationTest, callee()->NewGetStats(); ASSERT_NE(nullptr, report); auto inbound_stream_stats = - report->GetStatsOfType(); + report->GetStatsOfType(); ASSERT_EQ(1U, inbound_stream_stats.size()); ASSERT_TRUE(inbound_stream_stats[0]->bytes_received.is_defined()); ASSERT_GT(*inbound_stream_stats[0]->bytes_received, 0U); @@ -1463,7 +1463,7 @@ TEST_P(PeerConnectionIntegrationTest, ASSERT_NE(nullptr, report); auto inbound_rtps = - report->GetStatsOfType(); + report->GetStatsOfType(); auto index = FindFirstMediaStatsIndexByKind("audio", inbound_rtps); ASSERT_GE(index, 0); EXPECT_TRUE(inbound_rtps[index]->audio_level.is_defined()); @@ -1483,7 +1483,7 @@ void ModifySsrcs(cricket::SessionDescription* desc) { // Test that the "DEPRECATED_RTCMediaStreamTrackStats" object is updated // correctly when SSRCs are unsignaled, and the SSRC of the received (audio) -// stream changes. This should result in two "RTCInboundRTPStreamStats", but +// stream changes. This should result in two "RTCInboundRtpStreamStats", but // only one "DEPRECATED_RTCMediaStreamTrackStats", whose counters go up // continuously rather than being reset to 0 once the SSRC change occurs. // @@ -1558,13 +1558,13 @@ TEST_P(PeerConnectionIntegrationTest, *track_stats[0]->total_samples_received * kAcceptableConcealedSamplesPercentage); - // Also ensure that we have two "RTCInboundRTPStreamStats" as expected, as a + // Also ensure that we have two "RTCInboundRtpStreamStats" as expected, as a // sanity check that the SSRC really changed. // TODO(deadbeef): This isn't working right now, because we're not returning // *any* stats for the inactive stream. Uncomment when the bug is completely // fixed. // auto inbound_stream_stats = - // report->GetStatsOfType(); + // report->GetStatsOfType(); // ASSERT_EQ(2U, inbound_stream_stats.size()); } @@ -2989,7 +2989,7 @@ TEST_P(PeerConnectionIntegrationTest, DisableAndEnableAudioPlayout) { double GetAudioEnergyStat(PeerConnectionIntegrationWrapper* pc) { auto report = pc->NewGetStats(); auto inbound_rtps = - report->GetStatsOfType(); + report->GetStatsOfType(); RTC_CHECK(!inbound_rtps.empty()); auto* inbound_rtp = inbound_rtps[0]; if (!inbound_rtp->total_audio_energy.is_defined()) { @@ -3811,7 +3811,7 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndRtpSenderVideoEncoderSelector) { int NacksReceivedCount(PeerConnectionIntegrationWrapper& pc) { rtc::scoped_refptr report = pc.NewGetStats(); - auto sender_stats = report->GetStatsOfType(); + auto sender_stats = report->GetStatsOfType(); if (sender_stats.size() != 1) { ADD_FAILURE(); return 0; @@ -3824,7 +3824,7 @@ int NacksReceivedCount(PeerConnectionIntegrationWrapper& pc) { int NacksSentCount(PeerConnectionIntegrationWrapper& pc) { rtc::scoped_refptr report = pc.NewGetStats(); - auto receiver_stats = report->GetStatsOfType(); + auto receiver_stats = report->GetStatsOfType(); if (receiver_stats.size() != 1) { ADD_FAILURE(); return 0; diff --git a/pc/peer_connection_simulcast_unittest.cc b/pc/peer_connection_simulcast_unittest.cc index 8912b13309..9d8a62a4e4 100644 --- a/pc/peer_connection_simulcast_unittest.cc +++ b/pc/peer_connection_simulcast_unittest.cc @@ -138,7 +138,7 @@ bool IsReliabilityMechanism(const webrtc::RtpCodecCapability& codec) { std::string GetCurrentCodecMimeType( rtc::scoped_refptr report, - const webrtc::RTCOutboundRTPStreamStats& outbound_rtp) { + const webrtc::RTCOutboundRtpStreamStats& outbound_rtp) { return outbound_rtp.codec_id.is_defined() ? *report->GetAs(*outbound_rtp.codec_id) ->mime_type @@ -151,8 +151,8 @@ struct RidAndResolution { uint32_t height; }; -const webrtc::RTCOutboundRTPStreamStats* FindOutboundRtpByRid( - const std::vector& outbound_rtps, +const webrtc::RTCOutboundRtpStreamStats* FindOutboundRtpByRid( + const std::vector& outbound_rtps, const absl::string_view& rid) { for (const auto* outbound_rtp : outbound_rtps) { if (outbound_rtp->rid.is_defined() && *outbound_rtp->rid == rid) { @@ -964,8 +964,8 @@ class PeerConnectionSimulcastWithMediaFlowTests rtc::scoped_refptr pc_wrapper, size_t num_layers) { rtc::scoped_refptr report = GetStats(pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); if (outbound_rtps.size() != num_layers) { return false; } @@ -983,10 +983,10 @@ class PeerConnectionSimulcastWithMediaFlowTests std::vector resolutions, bool log_during_ramp_up) { rtc::scoped_refptr report = GetStats(pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); for (const RidAndResolution& resolution : resolutions) { - const RTCOutboundRTPStreamStats* outbound_rtp = nullptr; + const RTCOutboundRtpStreamStats* outbound_rtp = nullptr; if (!resolution.rid.empty()) { outbound_rtp = FindOutboundRtpByRid(outbound_rtps, resolution.rid); } else if (outbound_rtps.size() == 1u) { @@ -1102,8 +1102,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kLongTimeoutForRampingUp.ms()); // Verify codec and scalability mode. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP8")); @@ -1142,8 +1142,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kDefaultTimeout.ms()); // Verify codec and scalability mode. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(3u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP8")); @@ -1191,8 +1191,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kDefaultTimeout.ms()); // When `scalability_mode` is not set, VP8 defaults to L1T1. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP8")); @@ -1251,8 +1251,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, // GetStats() confirms "L1T2" is used which is different than the "L1T1" // default or the "L3T3_KEY" that was attempted. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP8")); @@ -1293,8 +1293,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kDefaultTimeout.ms()); // Verify codec and scalability mode. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(3u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/H264")); @@ -1345,8 +1345,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kLongTimeoutForRampingUp.ms()); // Verify codec and scalability mode. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP9")); @@ -1404,8 +1404,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, kLongTimeoutForRampingUp.ms()); // Verify codec and scalability mode. rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP9")); @@ -1457,8 +1457,8 @@ TEST_F(PeerConnectionSimulcastWithMediaFlowTests, EXPECT_TRUE_WAIT(HasOutboundRtpBytesSent(local_pc_wrapper, 1u), kLongTimeoutForRampingUp.ms()); rtc::scoped_refptr report = GetStats(local_pc_wrapper); - std::vector outbound_rtps = - report->GetStatsOfType(); + std::vector outbound_rtps = + report->GetStatsOfType(); ASSERT_THAT(outbound_rtps, SizeIs(1u)); EXPECT_THAT(GetCurrentCodecMimeType(report, *outbound_rtps[0]), StrCaseEq("video/VP9")); diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index 8a7839a95c..1d8cf3ca6d 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -124,7 +124,7 @@ std::string RTCTransportStatsIDFromTransportChannel( return sb.str(); } -std::string RTCInboundRTPStreamStatsIDFromSSRC(const std::string& transport_id, +std::string RTCInboundRtpStreamStatsIDFromSSRC(const std::string& transport_id, cricket::MediaType media_type, uint32_t ssrc) { char buf[1024]; @@ -134,7 +134,7 @@ std::string RTCInboundRTPStreamStatsIDFromSSRC(const std::string& transport_id, return sb.str(); } -std::string RTCOutboundRTPStreamStatsIDFromSSRC(const std::string& transport_id, +std::string RTCOutboundRtpStreamStatsIDFromSSRC(const std::string& transport_id, cricket::MediaType media_type, uint32_t ssrc) { char buf[1024]; @@ -412,7 +412,7 @@ void SetMediaStreamTrackStatsFromMediaStreamTrackInterface( // Provides the media independent counters (both audio and video). void SetInboundRTPStreamStatsFromMediaReceiverInfo( const cricket::MediaReceiverInfo& media_receiver_info, - RTCInboundRTPStreamStats* inbound_stats) { + RTCInboundRtpStreamStats* inbound_stats) { RTC_DCHECK(inbound_stats); inbound_stats->ssrc = media_receiver_info.ssrc(); inbound_stats->packets_received = @@ -440,15 +440,15 @@ void SetInboundRTPStreamStatsFromMediaReceiverInfo( } } -std::unique_ptr CreateInboundAudioStreamStats( +std::unique_ptr CreateInboundAudioStreamStats( const cricket::VoiceMediaInfo& voice_media_info, const cricket::VoiceReceiverInfo& voice_receiver_info, const std::string& transport_id, const std::string& mid, Timestamp timestamp, RTCStatsReport* report) { - auto inbound_audio = std::make_unique( - /*id=*/RTCInboundRTPStreamStatsIDFromSSRC( + auto inbound_audio = std::make_unique( + /*id=*/RTCInboundRtpStreamStatsIDFromSSRC( transport_id, cricket::MEDIA_TYPE_AUDIO, voice_receiver_info.ssrc()), timestamp); SetInboundRTPStreamStatsFromMediaReceiverInfo(voice_receiver_info, @@ -537,7 +537,7 @@ std::unique_ptr CreateRemoteOutboundAudioStreamStats( const cricket::VoiceReceiverInfo& voice_receiver_info, const std::string& mid, - const RTCInboundRTPStreamStats& inbound_audio_stats, + const RTCInboundRtpStreamStats& inbound_audio_stats, const std::string& transport_id) { if (!voice_receiver_info.last_sender_report_timestamp_ms.has_value()) { // Cannot create `RTCRemoteOutboundRtpStreamStats` when the RTCP SR arrival @@ -584,7 +584,7 @@ CreateRemoteOutboundAudioStreamStats( return stats; } -std::unique_ptr +std::unique_ptr CreateInboundRTPStreamStatsFromVideoReceiverInfo( const std::string& transport_id, const std::string& mid, @@ -592,8 +592,8 @@ CreateInboundRTPStreamStatsFromVideoReceiverInfo( const cricket::VideoReceiverInfo& video_receiver_info, Timestamp timestamp, RTCStatsReport* report) { - auto inbound_video = std::make_unique( - RTCInboundRTPStreamStatsIDFromSSRC( + auto inbound_video = std::make_unique( + RTCInboundRtpStreamStatsIDFromSSRC( transport_id, cricket::MEDIA_TYPE_VIDEO, video_receiver_info.ssrc()), timestamp); SetInboundRTPStreamStatsFromMediaReceiverInfo(video_receiver_info, @@ -691,7 +691,7 @@ CreateInboundRTPStreamStatsFromVideoReceiverInfo( // video). void SetOutboundRTPStreamStatsFromMediaSenderInfo( const cricket::MediaSenderInfo& media_sender_info, - RTCOutboundRTPStreamStats* outbound_stats) { + RTCOutboundRtpStreamStats* outbound_stats) { RTC_DCHECK(outbound_stats); outbound_stats->ssrc = media_sender_info.ssrc(); outbound_stats->packets_sent = @@ -712,7 +712,7 @@ void SetOutboundRTPStreamStatsFromMediaSenderInfo( } } -std::unique_ptr +std::unique_ptr CreateOutboundRTPStreamStatsFromVoiceSenderInfo( const std::string& transport_id, const std::string& mid, @@ -720,8 +720,8 @@ CreateOutboundRTPStreamStatsFromVoiceSenderInfo( const cricket::VoiceSenderInfo& voice_sender_info, Timestamp timestamp, RTCStatsReport* report) { - auto outbound_audio = std::make_unique( - RTCOutboundRTPStreamStatsIDFromSSRC( + auto outbound_audio = std::make_unique( + RTCOutboundRtpStreamStatsIDFromSSRC( transport_id, cricket::MEDIA_TYPE_AUDIO, voice_sender_info.ssrc()), timestamp); SetOutboundRTPStreamStatsFromMediaSenderInfo(voice_sender_info, @@ -749,7 +749,7 @@ CreateOutboundRTPStreamStatsFromVoiceSenderInfo( return outbound_audio; } -std::unique_ptr +std::unique_ptr CreateOutboundRTPStreamStatsFromVideoSenderInfo( const std::string& transport_id, const std::string& mid, @@ -757,8 +757,8 @@ CreateOutboundRTPStreamStatsFromVideoSenderInfo( const cricket::VideoSenderInfo& video_sender_info, Timestamp timestamp, RTCStatsReport* report) { - auto outbound_video = std::make_unique( - RTCOutboundRTPStreamStatsIDFromSSRC( + auto outbound_video = std::make_unique( + RTCOutboundRtpStreamStatsIDFromSSRC( transport_id, cricket::MEDIA_TYPE_VIDEO, video_sender_info.ssrc()), timestamp); SetOutboundRTPStreamStatsFromMediaSenderInfo(video_sender_info, @@ -842,7 +842,7 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData( const std::string& transport_id, const ReportBlockData& report_block_data, cricket::MediaType media_type, - const std::map& outbound_rtps, + const std::map& outbound_rtps, const RTCStatsReport& report) { const auto& report_block = report_block_data.report_block(); // RTCStats' timestamp generally refers to when the metric was sampled, but @@ -869,7 +869,7 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData( remote_inbound->round_trip_time_measurements = report_block_data.num_rtts(); - std::string local_id = RTCOutboundRTPStreamStatsIDFromSSRC( + std::string local_id = RTCOutboundRtpStreamStatsIDFromSSRC( transport_id, media_type, report_block.source_ssrc); // Look up local stat from `outbound_rtps` where the pointers are non-const. auto local_id_it = outbound_rtps.find(local_id); @@ -1170,7 +1170,7 @@ ProduceMediaStreamTrackStatsFromVideoReceiverInfo( // TODO(hbos): When we support receiving simulcast, this should be the total // number of frames correctly decoded, independent of which SSRC it was // received from. Since we don't support that, this is correct and is the same - // value as "RTCInboundRTPStreamStats.framesDecoded". https://crbug.com/659137 + // value as "RTCInboundRtpStreamStats.framesDecoded". https://crbug.com/659137 video_track_stats->frames_decoded = video_receiver_info.frames_decoded; video_track_stats->frames_dropped = video_receiver_info.frames_dropped; @@ -1292,7 +1292,7 @@ RTCStatsCollector::CreateReportFilteredBySelector( // Find outbound-rtp(s) of the sender using ssrc lookup. auto encodings = sender_selector->GetParametersInternal().encodings; for (const auto* outbound_rtp : - report->GetStatsOfType()) { + report->GetStatsOfType()) { RTC_DCHECK(outbound_rtp->ssrc.is_defined()); auto it = std::find_if( encodings.begin(), encodings.end(), @@ -1313,7 +1313,7 @@ RTCStatsCollector::CreateReportFilteredBySelector( worker_thread_->BlockingCall([&] { ssrc = receiver_selector->ssrc(); }); if (ssrc.has_value()) { for (const auto* inbound_rtp : - report->GetStatsOfType()) { + report->GetStatsOfType()) { RTC_DCHECK(inbound_rtp->ssrc.is_defined()); if (*inbound_rtp->ssrc == *ssrc) { rtpstream_ids.push_back(inbound_rtp->id()); @@ -2049,7 +2049,7 @@ void RTCStatsCollector::ProduceAudioRTPStreamStats_n( } } // Outbound. - std::map audio_outbound_rtps; + std::map audio_outbound_rtps; for (const cricket::VoiceSenderInfo& voice_sender_info : stats.track_media_info_map.voice_media_info()->senders) { if (!voice_sender_info.connected()) @@ -2134,7 +2134,7 @@ void RTCStatsCollector::ProduceVideoRTPStreamStats_n( } } // Outbound - std::map video_outbound_rtps; + std::map video_outbound_rtps; for (const cricket::VideoSenderInfo& video_sender_info : stats.track_media_info_map.video_media_info()->senders) { if (!video_sender_info.connected()) diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h index 20df528774..7c7c177ebe 100644 --- a/pc/rtc_stats_collector.h +++ b/pc/rtc_stats_collector.h @@ -211,7 +211,7 @@ class RTCStatsCollector : public rtc::RefCountInterface { // Produces `RTCAudioPlayoutStats`. void ProduceAudioPlayoutStats_s(Timestamp timestamp, RTCStatsReport* report) const; - // Produces `RTCInboundRTPStreamStats`, `RTCOutboundRTPStreamStats`, + // Produces `RTCInboundRtpStreamStats`, `RTCOutboundRtpStreamStats`, // `RTCRemoteInboundRtpStreamStats`, `RTCRemoteOutboundRtpStreamStats` and any // referenced `RTCCodecStats`. This has to be invoked after transport stats // have been created because some metrics are calculated through lookup of diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index dded2831b6..d4c03de1b9 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc @@ -122,11 +122,11 @@ void PrintTo(const DEPRECATED_RTCMediaStreamTrackStats& stats, *os << stats.ToJson(); } -void PrintTo(const RTCInboundRTPStreamStats& stats, ::std::ostream* os) { +void PrintTo(const RTCInboundRtpStreamStats& stats, ::std::ostream* os) { *os << stats.ToJson(); } -void PrintTo(const RTCOutboundRTPStreamStats& stats, ::std::ostream* os) { +void PrintTo(const RTCOutboundRtpStreamStats& stats, ::std::ostream* os) { *os << stats.ToJson(); } @@ -809,7 +809,7 @@ class RTCStatsCollectorTest : public ::testing::Test { ->cast_to(); EXPECT_EQ(*sender_track.media_source_id, graph.media_source_id); const auto& outbound_rtp = graph.full_report->Get(graph.outbound_rtp_id) - ->cast_to(); + ->cast_to(); EXPECT_EQ(*outbound_rtp.media_source_id, graph.media_source_id); EXPECT_EQ(*outbound_rtp.codec_id, graph.send_codec_id); EXPECT_EQ(*outbound_rtp.track_id, graph.sender_track_id); @@ -820,7 +820,7 @@ class RTCStatsCollectorTest : public ::testing::Test { return graph; } const auto& inbound_rtp = graph.full_report->Get(graph.inbound_rtp_id) - ->cast_to(); + ->cast_to(); EXPECT_EQ(*inbound_rtp.codec_id, graph.recv_codec_id); EXPECT_EQ(*inbound_rtp.track_id, graph.receiver_track_id); EXPECT_EQ(*inbound_rtp.transport_id, graph.transport_id); @@ -931,7 +931,7 @@ class RTCStatsCollectorTest : public ::testing::Test { ->cast_to(); EXPECT_EQ(*sender_track.media_source_id, graph.media_source_id); const auto& outbound_rtp = graph.full_report->Get(graph.outbound_rtp_id) - ->cast_to(); + ->cast_to(); EXPECT_EQ(*outbound_rtp.media_source_id, graph.media_source_id); EXPECT_EQ(*outbound_rtp.codec_id, graph.send_codec_id); EXPECT_EQ(*outbound_rtp.track_id, graph.sender_track_id); @@ -942,7 +942,7 @@ class RTCStatsCollectorTest : public ::testing::Test { return graph; } const auto& inbound_rtp = graph.full_report->Get(graph.inbound_rtp_id) - ->cast_to(); + ->cast_to(); EXPECT_EQ(*inbound_rtp.codec_id, graph.recv_codec_id); EXPECT_EQ(*inbound_rtp.track_id, graph.receiver_track_id); EXPECT_EQ(*inbound_rtp.transport_id, graph.transport_id); @@ -1079,8 +1079,8 @@ TEST_F(RTCStatsCollectorTest, ValidSsrcCollisionDoesNotCrash) { // This should not crash (https://crbug.com/1361612). rtc::scoped_refptr report = stats_->GetStatsReport(); - auto inbound_rtps = report->GetStatsOfType(); - auto outbound_rtps = report->GetStatsOfType(); + auto inbound_rtps = report->GetStatsOfType(); + auto outbound_rtps = report->GetStatsOfType(); EXPECT_EQ(inbound_rtps.size(), 4u); EXPECT_EQ(outbound_rtps.size(), 4u); } @@ -2460,7 +2460,7 @@ TEST_F(RTCStatsCollectorTest, ->cast_to()); } -TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { +TEST_F(RTCStatsCollectorTest, CollectRTCInboundRtpStreamStats_Audio) { cricket::VoiceMediaInfo voice_media_info; voice_media_info.receivers.push_back(cricket::VoiceReceiverInfo()); @@ -2523,7 +2523,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { report->GetStatsOfType(); ASSERT_EQ(1U, stats_of_track_type.size()); - RTCInboundRTPStreamStats expected_audio("ITTransportName1A1", + RTCInboundRtpStreamStats expected_audio("ITTransportName1A1", report->timestamp()); expected_audio.ssrc = 1; expected_audio.media_type = "audio"; @@ -2565,7 +2565,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( - report->Get(expected_audio.id())->cast_to(), + report->Get(expected_audio.id())->cast_to(), expected_audio); // Set previously undefined values and "GetStats" again. @@ -2580,14 +2580,14 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( - report->Get(expected_audio.id())->cast_to(), + report->Get(expected_audio.id())->cast_to(), expected_audio); EXPECT_TRUE(report->Get(*expected_audio.track_id)); EXPECT_TRUE(report->Get(*expected_audio.transport_id)); EXPECT_TRUE(report->Get(*expected_audio.codec_id)); } -TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio_PlayoutId) { +TEST_F(RTCStatsCollectorTest, CollectRTCInboundRtpStreamStats_Audio_PlayoutId) { cricket::VoiceMediaInfo voice_media_info; voice_media_info.receivers.push_back(cricket::VoiceReceiverInfo()); @@ -2608,7 +2608,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio_PlayoutId) { rtc::scoped_refptr report = stats_->GetStatsReport(); ASSERT_TRUE(report->Get("ITTransportName1A1")); auto stats = - report->Get("ITTransportName1A1")->cast_to(); + report->Get("ITTransportName1A1")->cast_to(); ASSERT_FALSE(stats.playout_id.is_defined()); } { @@ -2619,13 +2619,13 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio_PlayoutId) { stats_->GetFreshStatsReport(); ASSERT_TRUE(report->Get("ITTransportName1A1")); auto stats = - report->Get("ITTransportName1A1")->cast_to(); + report->Get("ITTransportName1A1")->cast_to(); ASSERT_TRUE(stats.playout_id.is_defined()); EXPECT_EQ(*stats.playout_id, "AP"); } } -TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) { +TEST_F(RTCStatsCollectorTest, CollectRTCInboundRtpStreamStats_Video) { cricket::VideoMediaInfo video_media_info; video_media_info.receivers.push_back(cricket::VideoReceiverInfo()); @@ -2693,7 +2693,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) { rtc::scoped_refptr report = stats_->GetStatsReport(); - RTCInboundRTPStreamStats expected_video("ITTransportName1V1", + RTCInboundRtpStreamStats expected_video("ITTransportName1V1", report->timestamp()); expected_video.ssrc = 1; expected_video.media_type = "video"; @@ -2740,7 +2740,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) { ASSERT_TRUE(report->Get(expected_video.id())); EXPECT_EQ( - report->Get(expected_video.id())->cast_to(), + report->Get(expected_video.id())->cast_to(), expected_video); // Set previously undefined values and "GetStats" again. @@ -2763,7 +2763,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) { ASSERT_TRUE(report->Get(expected_video.id())); EXPECT_EQ( - report->Get(expected_video.id())->cast_to(), + report->Get(expected_video.id())->cast_to(), expected_video); EXPECT_TRUE(report->Get(*expected_video.track_id)); EXPECT_TRUE(report->Get(*expected_video.transport_id)); @@ -2825,14 +2825,14 @@ TEST_F(RTCStatsCollectorTest, CollectGoogTimingFrameInfo) { cricket::MEDIA_TYPE_VIDEO, "RemoteVideoTrackID", "RemoteStreamId", 1); rtc::scoped_refptr report = stats_->GetStatsReport(); - auto inbound_rtps = report->GetStatsOfType(); + auto inbound_rtps = report->GetStatsOfType(); ASSERT_EQ(inbound_rtps.size(), 1u); ASSERT_TRUE(inbound_rtps[0]->goog_timing_frame_info.is_defined()); EXPECT_EQ(*inbound_rtps[0]->goog_timing_frame_info, "1,2,3,4,5,6,7,8,9,10,11,12,13,1,0"); } -TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) { +TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRtpStreamStats_Audio) { cricket::VoiceMediaInfo voice_media_info; voice_media_info.senders.push_back(cricket::VoiceSenderInfo()); @@ -2864,7 +2864,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) { rtc::scoped_refptr report = stats_->GetStatsReport(); - RTCOutboundRTPStreamStats expected_audio("OTTransportName1A1", + RTCOutboundRtpStreamStats expected_audio("OTTransportName1A1", report->timestamp()); expected_audio.media_source_id = "SA50"; // `expected_audio.remote_id` should be undefined. @@ -2888,19 +2888,19 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Audio) { ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( - report->Get(expected_audio.id())->cast_to(), + report->Get(expected_audio.id())->cast_to(), expected_audio); ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( - report->Get(expected_audio.id())->cast_to(), + report->Get(expected_audio.id())->cast_to(), expected_audio); EXPECT_TRUE(report->Get(*expected_audio.track_id)); EXPECT_TRUE(report->Get(*expected_audio.transport_id)); EXPECT_TRUE(report->Get(*expected_audio.codec_id)); } -TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { +TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRtpStreamStats_Video) { cricket::VideoMediaInfo video_media_info; video_media_info.senders.push_back(cricket::VideoSenderInfo()); @@ -2954,13 +2954,13 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { rtc::scoped_refptr report = stats_->GetStatsReport(); - auto stats_of_my_type = report->GetStatsOfType(); + auto stats_of_my_type = report->GetStatsOfType(); ASSERT_EQ(1U, stats_of_my_type.size()); auto stats_of_track_type = report->GetStatsOfType(); ASSERT_EQ(1U, stats_of_track_type.size()); - RTCOutboundRTPStreamStats expected_video(stats_of_my_type[0]->id(), + RTCOutboundRtpStreamStats expected_video(stats_of_my_type[0]->id(), report->timestamp()); expected_video.media_source_id = "SV50"; // `expected_video.remote_id` should be undefined. @@ -3003,7 +3003,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { ASSERT_TRUE(report->Get(expected_video.id())); EXPECT_EQ( - report->Get(expected_video.id())->cast_to(), + report->Get(expected_video.id())->cast_to(), expected_video); // Set previously undefined values and "GetStats" again. @@ -3023,7 +3023,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { ASSERT_TRUE(report->Get(expected_video.id())); EXPECT_EQ( - report->Get(expected_video.id())->cast_to(), + report->Get(expected_video.id())->cast_to(), expected_video); EXPECT_TRUE(report->Get(*expected_video.track_id)); EXPECT_TRUE(report->Get(*expected_video.transport_id)); @@ -3275,7 +3275,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) { report->Get(expected_rtp_transport.id())->cast_to()); } -TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRTPStreamStats_Audio) { +TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRtpStreamStats_Audio) { cricket::VoiceMediaInfo voice_media_info; voice_media_info.senders.push_back(cricket::VoiceSenderInfo()); @@ -3307,7 +3307,7 @@ TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRTPStreamStats_Audio) { rtc::scoped_refptr report = stats_->GetStatsReport(); - RTCOutboundRTPStreamStats expected_audio("OTTransportName1A1", + RTCOutboundRtpStreamStats expected_audio("OTTransportName1A1", report->timestamp()); expected_audio.media_source_id = "SA50"; expected_audio.mid = "AudioMid"; @@ -3329,7 +3329,7 @@ TEST_F(RTCStatsCollectorTest, CollectNoStreamRTCOutboundRTPStreamStats_Audio) { ASSERT_TRUE(report->Get(expected_audio.id())); EXPECT_EQ( - report->Get(expected_audio.id())->cast_to(), + report->Get(expected_audio.id())->cast_to(), expected_audio); EXPECT_TRUE(report->Get(*expected_audio.track_id)); EXPECT_TRUE(report->Get(*expected_audio.transport_id)); @@ -3656,7 +3656,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind, ASSERT_TRUE(report->Get(*expected_remote_inbound_rtp.local_id)); // Lookup works in both directions. EXPECT_EQ(*report->Get(*expected_remote_inbound_rtp.local_id) - ->cast_to() + ->cast_to() .remote_id, expected_remote_inbound_rtp.id()); } @@ -4006,7 +4006,7 @@ TEST_F(RTCStatsCollectorTest, RtpIsMissingWhileSsrcIsZero) { auto tracks = report->GetStatsOfType(); EXPECT_EQ(1U, tracks.size()); - auto outbound_rtps = report->GetStatsOfType(); + auto outbound_rtps = report->GetStatsOfType(); EXPECT_TRUE(outbound_rtps.empty()); } @@ -4027,7 +4027,7 @@ TEST_F(RTCStatsCollectorTest, DoNotCrashIfSsrcIsKnownButInfosAreStillMissing) { std::vector track_stats = report->GetStatsOfType(); EXPECT_EQ(1U, track_stats.size()); - auto outbound_rtps = report->GetStatsOfType(); + auto outbound_rtps = report->GetStatsOfType(); EXPECT_TRUE(outbound_rtps.empty()); } diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index 2f8d64baa7..b0bc8108be 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -342,8 +342,8 @@ class RTCStatsReportVerifier { stats_types.insert(DEPRECATED_RTCMediaStreamStats::kType); stats_types.insert(DEPRECATED_RTCMediaStreamTrackStats::kType); stats_types.insert(RTCPeerConnectionStats::kType); - stats_types.insert(RTCInboundRTPStreamStats::kType); - stats_types.insert(RTCOutboundRTPStreamStats::kType); + stats_types.insert(RTCInboundRtpStreamStats::kType); + stats_types.insert(RTCOutboundRtpStreamStats::kType); stats_types.insert(RTCTransportStats::kType); return stats_types; } @@ -389,12 +389,12 @@ class RTCStatsReportVerifier { } else if (stats.type() == RTCPeerConnectionStats::kType) { verify_successful &= VerifyRTCPeerConnectionStats( stats.cast_to()); - } else if (stats.type() == RTCInboundRTPStreamStats::kType) { + } else if (stats.type() == RTCInboundRtpStreamStats::kType) { verify_successful &= VerifyRTCInboundRtpStreamStats( - stats.cast_to()); - } else if (stats.type() == RTCOutboundRTPStreamStats::kType) { + stats.cast_to()); + } else if (stats.type() == RTCOutboundRtpStreamStats::kType) { verify_successful &= VerifyRTCOutboundRtpStreamStats( - stats.cast_to()); + stats.cast_to()); } else if (stats.type() == RTCRemoteInboundRtpStreamStats::kType) { verify_successful &= VerifyRTCRemoteInboundRtpStreamStats( stats.cast_to()); @@ -721,8 +721,8 @@ class RTCStatsReportVerifier { verifier.TestMemberIsDefined(stream.kind); // Some legacy metrics are only defined for some of the RTP types in the // hierarcy. - if (stream.type() == RTCInboundRTPStreamStats::kType || - stream.type() == RTCOutboundRTPStreamStats::kType) { + if (stream.type() == RTCInboundRtpStreamStats::kType || + stream.type() == RTCOutboundRtpStreamStats::kType) { verifier.TestMemberIsDefined(stream.media_type); verifier.TestMemberIsIDReference( stream.track_id, DEPRECATED_RTCMediaStreamTrackStats::kType); @@ -743,7 +743,7 @@ class RTCStatsReportVerifier { } bool VerifyRTCInboundRtpStreamStats( - const RTCInboundRTPStreamStats& inbound_stream) { + const RTCInboundRtpStreamStats& inbound_stream) { RTCStatsVerifier verifier(report_.get(), &inbound_stream); VerifyRTCReceivedRtpStreamStats(inbound_stream, verifier); verifier.TestMemberIsOptionalIDReference( @@ -921,7 +921,7 @@ class RTCStatsReportVerifier { } bool VerifyRTCOutboundRtpStreamStats( - const RTCOutboundRTPStreamStats& outbound_stream) { + const RTCOutboundRtpStreamStats& outbound_stream) { RTCStatsVerifier verifier(report_.get(), &outbound_stream); VerifyRTCRtpStreamStats(outbound_stream, verifier); verifier.TestMemberIsDefined(outbound_stream.mid); @@ -1034,7 +1034,7 @@ class RTCStatsReportVerifier { VerifyRTCReceivedRtpStreamStats(remote_inbound_stream, verifier); verifier.TestMemberIsDefined(remote_inbound_stream.fraction_lost); verifier.TestMemberIsIDReference(remote_inbound_stream.local_id, - RTCOutboundRTPStreamStats::kType); + RTCOutboundRtpStreamStats::kType); verifier.TestMemberIsNonNegative( remote_inbound_stream.round_trip_time); verifier.TestMemberIsNonNegative( @@ -1050,7 +1050,7 @@ class RTCStatsReportVerifier { VerifyRTCRtpStreamStats(remote_outbound_stream, verifier); VerifyRTCSentRtpStreamStats(remote_outbound_stream, verifier); verifier.TestMemberIsIDReference(remote_outbound_stream.local_id, - RTCOutboundRTPStreamStats::kType); + RTCOutboundRtpStreamStats::kType); verifier.TestMemberIsNonNegative( remote_outbound_stream.remote_timestamp); verifier.TestMemberIsDefined(remote_outbound_stream.reports_sent); @@ -1196,7 +1196,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithSenderSelector) { // TODO(hbos): Include RTC[Audio/Video]ReceiverStats when implemented. // TODO(hbos): Include RTCRemoteOutboundRtpStreamStats when implemented. // TODO(hbos): Include RTCRtpContributingSourceStats when implemented. - RTCInboundRTPStreamStats::kType, + RTCInboundRtpStreamStats::kType, RTCPeerConnectionStats::kType, DEPRECATED_RTCMediaStreamStats::kType, RTCDataChannelStats::kType, @@ -1215,7 +1215,7 @@ TEST_F(RTCStatsIntegrationTest, GetStatsWithReceiverSelector) { // TODO(hbos): Include RTC[Audio/Video]SenderStats when implemented. // TODO(hbos): Include RTCRemoteInboundRtpStreamStats when implemented. // TODO(hbos): Include RTCRtpContributingSourceStats when implemented. - RTCOutboundRTPStreamStats::kType, + RTCOutboundRtpStreamStats::kType, RTCPeerConnectionStats::kType, DEPRECATED_RTCMediaStreamStats::kType, RTCDataChannelStats::kType, diff --git a/pc/rtc_stats_traversal.cc b/pc/rtc_stats_traversal.cc index 98401126ed..20ca0efa6c 100644 --- a/pc/rtc_stats_traversal.cc +++ b/pc/rtc_stats_traversal.cc @@ -101,17 +101,17 @@ std::vector GetStatsReferencedIds(const RTCStats& stats) { AddIdIfDefined(track.media_source_id, &neighbor_ids); } else if (type == RTCPeerConnectionStats::kType) { // RTCPeerConnectionStats does not have any neighbor references. - } else if (type == RTCInboundRTPStreamStats::kType) { + } else if (type == RTCInboundRtpStreamStats::kType) { const auto& inbound_rtp = - static_cast(stats); + static_cast(stats); AddIdIfDefined(inbound_rtp.remote_id, &neighbor_ids); AddIdIfDefined(inbound_rtp.track_id, &neighbor_ids); AddIdIfDefined(inbound_rtp.transport_id, &neighbor_ids); AddIdIfDefined(inbound_rtp.codec_id, &neighbor_ids); AddIdIfDefined(inbound_rtp.playout_id, &neighbor_ids); - } else if (type == RTCOutboundRTPStreamStats::kType) { + } else if (type == RTCOutboundRtpStreamStats::kType) { const auto& outbound_rtp = - static_cast(stats); + static_cast(stats); AddIdIfDefined(outbound_rtp.remote_id, &neighbor_ids); AddIdIfDefined(outbound_rtp.track_id, &neighbor_ids); AddIdIfDefined(outbound_rtp.transport_id, &neighbor_ids); diff --git a/pc/test/integration_test_helpers.cc b/pc/test/integration_test_helpers.cc index 471271f068..911ce3f263 100644 --- a/pc/test/integration_test_helpers.cc +++ b/pc/test/integration_test_helpers.cc @@ -46,7 +46,7 @@ void RemoveSsrcsAndKeepMsids(cricket::SessionDescription* desc) { int FindFirstMediaStatsIndexByKind( const std::string& kind, - const std::vector& inbound_rtps) { + const std::vector& inbound_rtps) { for (size_t i = 0; i < inbound_rtps.size(); i++) { if (*inbound_rtps[i]->kind == kind) { return i; diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h index 4e01b333b9..c2fc7993aa 100644 --- a/pc/test/integration_test_helpers.h +++ b/pc/test/integration_test_helpers.h @@ -173,7 +173,7 @@ void RemoveSsrcsAndKeepMsids(cricket::SessionDescription* desc); int FindFirstMediaStatsIndexByKind( const std::string& kind, - const std::vector& inbound_rtps); + const std::vector& inbound_rtps); class TaskQueueMetronome : public webrtc::Metronome { public: @@ -648,7 +648,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver, // Get the baseline numbers for audio_packets and audio_delay. auto received_stats = NewGetStats(); auto rtp_stats = - received_stats->GetStatsOfType()[0]; + received_stats->GetStatsOfType()[0]; ASSERT_TRUE(rtp_stats->relative_packet_arrival_delay.is_defined()); ASSERT_TRUE(rtp_stats->packets_received.is_defined()); ASSERT_TRUE(rtp_stats->track_id.is_defined()); @@ -662,7 +662,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver, void UpdateDelayStats(std::string tag, int desc_size) { auto report = NewGetStats(); auto rtp_stats = - report->GetAs(rtp_stats_id_); + report->GetAs(rtp_stats_id_); ASSERT_TRUE(rtp_stats); auto delta_packets = *rtp_stats->packets_received - audio_packets_stat_; auto delta_rpad = diff --git a/pc/test/svc_e2e_tests.cc b/pc/test/svc_e2e_tests.cc index 9e911a9dba..4aced7f160 100644 --- a/pc/test/svc_e2e_tests.cc +++ b/pc/test/svc_e2e_tests.cc @@ -209,7 +209,7 @@ class SvcVideoQualityAnalyzer : public DefaultVideoQualityAnalyzer { absl::string_view pc_label, const rtc::scoped_refptr& report) override { // Extract the scalability mode reported in the stats. - auto outbound_stats = report->GetStatsOfType(); + auto outbound_stats = report->GetStatsOfType(); for (const auto& stat : outbound_stats) { if (stat->scalability_mode.is_defined()) { reported_scalability_mode_ = *stat->scalability_mode; diff --git a/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc index b0e1a06fc6..997764b38c 100644 --- a/stats/rtcstats_objects.cc +++ b/stats/rtcstats_objects.cc @@ -456,7 +456,7 @@ RTCSentRtpStreamStats::~RTCSentRtpStreamStats() {} // clang-format off WEBRTC_RTCSTATS_IMPL( - RTCInboundRTPStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp", + RTCInboundRtpStreamStats, RTCReceivedRtpStreamStats, "inbound-rtp", &track_identifier, &mid, &remote_id, @@ -515,7 +515,7 @@ WEBRTC_RTCSTATS_IMPL( &min_playout_delay) // clang-format on -RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string id, +RTCInboundRtpStreamStats::RTCInboundRtpStreamStats(std::string id, Timestamp timestamp) : RTCReceivedRtpStreamStats(std::move(id), timestamp), playout_id("playoutId"), @@ -583,13 +583,13 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string id, total_interruption_duration("totalInterruptionDuration"), min_playout_delay("minPlayoutDelay") {} -RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( - const RTCInboundRTPStreamStats& other) = default; -RTCInboundRTPStreamStats::~RTCInboundRTPStreamStats() {} +RTCInboundRtpStreamStats::RTCInboundRtpStreamStats( + const RTCInboundRtpStreamStats& other) = default; +RTCInboundRtpStreamStats::~RTCInboundRtpStreamStats() {} // clang-format off WEBRTC_RTCSTATS_IMPL( - RTCOutboundRTPStreamStats, RTCSentRtpStreamStats, "outbound-rtp", + RTCOutboundRtpStreamStats, RTCSentRtpStreamStats, "outbound-rtp", &media_source_id, &remote_id, &mid, @@ -622,7 +622,7 @@ WEBRTC_RTCSTATS_IMPL( &scalability_mode) // clang-format on -RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string id, +RTCOutboundRtpStreamStats::RTCOutboundRtpStreamStats(std::string id, Timestamp timestamp) : RTCSentRtpStreamStats(std::move(id), timestamp), media_source_id("mediaSourceId"), @@ -657,10 +657,10 @@ RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats(std::string id, power_efficient_encoder("powerEfficientEncoder"), scalability_mode("scalabilityMode") {} -RTCOutboundRTPStreamStats::RTCOutboundRTPStreamStats( - const RTCOutboundRTPStreamStats& other) = default; +RTCOutboundRtpStreamStats::RTCOutboundRtpStreamStats( + const RTCOutboundRtpStreamStats& other) = default; -RTCOutboundRTPStreamStats::~RTCOutboundRTPStreamStats() {} +RTCOutboundRtpStreamStats::~RTCOutboundRtpStreamStats() {} // clang-format off WEBRTC_RTCSTATS_IMPL( diff --git a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc index 98d0c533c2..49e165795a 100644 --- a/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.cc @@ -39,7 +39,7 @@ void DefaultAudioQualityAnalyzer::Start(std::string test_case_name, void DefaultAudioQualityAnalyzer::OnStatsReports( absl::string_view pc_label, const rtc::scoped_refptr& report) { - auto stats = report->GetStatsOfType(); + auto stats = report->GetStatsOfType(); for (auto& stat : stats) { if (!stat->kind.is_defined() || diff --git a/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc b/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc index 8049af308e..224eb0c59f 100644 --- a/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc +++ b/test/pc/e2e/analyzer/video/video_quality_metrics_reporter.cc @@ -68,7 +68,7 @@ void VideoQualityMetricsReporter::OnStatsReports( const RTCIceCandidatePairStats ice_candidate_pair_stats = report->Get(selected_ice_id)->cast_to(); - auto outbound_rtp_stats = report->GetStatsOfType(); + auto outbound_rtp_stats = report->GetStatsOfType(); StatsSample sample; for (auto& s : outbound_rtp_stats) { if (!s->kind.is_defined()) { diff --git a/test/pc/e2e/cross_media_metrics_reporter.cc b/test/pc/e2e/cross_media_metrics_reporter.cc index 0d4fe7478d..549eafd95a 100644 --- a/test/pc/e2e/cross_media_metrics_reporter.cc +++ b/test/pc/e2e/cross_media_metrics_reporter.cc @@ -43,8 +43,8 @@ void CrossMediaMetricsReporter::Start( void CrossMediaMetricsReporter::OnStatsReports( absl::string_view pc_label, const rtc::scoped_refptr& report) { - auto inbound_stats = report->GetStatsOfType(); - std::map> + auto inbound_stats = report->GetStatsOfType(); + std::map> sync_group_stats; for (const auto& stat : inbound_stats) { if (stat->estimated_playout_timestamp.ValueOrDefault(0.) > 0 && @@ -63,8 +63,8 @@ void CrossMediaMetricsReporter::OnStatsReports( continue; } auto sync_group = std::string(pair.first); - const RTCInboundRTPStreamStats* audio_stat = pair.second[0]; - const RTCInboundRTPStreamStats* video_stat = pair.second[1]; + const RTCInboundRtpStreamStats* audio_stat = pair.second[0]; + const RTCInboundRtpStreamStats* video_stat = pair.second[1]; RTC_CHECK(pair.second.size() == 2 && audio_stat->kind.is_defined() && video_stat->kind.is_defined() && diff --git a/test/pc/e2e/network_quality_metrics_reporter.cc b/test/pc/e2e/network_quality_metrics_reporter.cc index 60990a87c9..2d6aa597ce 100644 --- a/test/pc/e2e/network_quality_metrics_reporter.cc +++ b/test/pc/e2e/network_quality_metrics_reporter.cc @@ -76,14 +76,14 @@ void NetworkQualityMetricsReporter::OnStatsReports( DataSize payload_received = DataSize::Zero(); DataSize payload_sent = DataSize::Zero(); - auto inbound_stats = report->GetStatsOfType(); + auto inbound_stats = report->GetStatsOfType(); for (const auto& stat : inbound_stats) { payload_received += DataSize::Bytes(stat->bytes_received.ValueOrDefault(0ul) + stat->header_bytes_received.ValueOrDefault(0ul)); } - auto outbound_stats = report->GetStatsOfType(); + auto outbound_stats = report->GetStatsOfType(); for (const auto& stat : outbound_stats) { payload_sent += DataSize::Bytes(stat->bytes_sent.ValueOrDefault(0ul) + diff --git a/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc b/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc index 65dca5b518..eb5f29287e 100644 --- a/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc +++ b/test/pc/e2e/stats_based_network_quality_metrics_reporter.cc @@ -296,14 +296,14 @@ void StatsBasedNetworkQualityMetricsReporter::OnStatsReports( const rtc::scoped_refptr& report) { PCStats cur_stats; - auto inbound_stats = report->GetStatsOfType(); + auto inbound_stats = report->GetStatsOfType(); for (const auto& stat : inbound_stats) { cur_stats.payload_received += DataSize::Bytes(stat->bytes_received.ValueOrDefault(0ul) + stat->header_bytes_received.ValueOrDefault(0ul)); } - auto outbound_stats = report->GetStatsOfType(); + auto outbound_stats = report->GetStatsOfType(); for (const auto& stat : outbound_stats) { cur_stats.payload_sent += DataSize::Bytes(stat->bytes_sent.ValueOrDefault(0ul) +