diff --git a/video/BUILD.gn b/video/BUILD.gn index e4d3c51c36..0589215ac5 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -45,8 +45,8 @@ rtc_library("video") { "quality_limitation_reason_tracker.h", "quality_threshold.cc", "quality_threshold.h", - "receive_statistics_proxy2.cc", - "receive_statistics_proxy2.h", + "receive_statistics_proxy.cc", + "receive_statistics_proxy.h", "report_block_stats.cc", "report_block_stats.h", "rtp_streams_synchronizer2.cc", @@ -756,7 +756,7 @@ if (rtc_include_tests) { "quality_limitation_reason_tracker_unittest.cc", "quality_scaling_tests.cc", "quality_threshold_unittest.cc", - "receive_statistics_proxy2_unittest.cc", + "receive_statistics_proxy_unittest.cc", "report_block_stats_unittest.cc", "rtp_video_stream_receiver2_unittest.cc", "send_delay_stats_unittest.cc", diff --git a/video/g3doc/stats.md b/video/g3doc/stats.md index 7d485a0155..14ec14893e 100644 --- a/video/g3doc/stats.md +++ b/video/g3doc/stats.md @@ -195,7 +195,7 @@ Updated when a RTCP packet is sent, `RTCPSender::ComputeCompoundRTCPPacket`. [VideoReceiveStream]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_receive_stream.h [VideoReceiveStream::Stats]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_receive_stream.h?q=VideoReceiveStream::Stats -[ReceiveStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/receive_statistics_proxy2.h +[ReceiveStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/receive_statistics_proxy.h [rtcinboundrtpstreamstats-keyframesdecoded]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded [rtcinboundrtpstreamstats-jitterbufferdelay]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferdelay [rtcinboundrtpstreamstats-jitterbufferemittedcount]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferemittedcount diff --git a/video/receive_statistics_proxy2.cc b/video/receive_statistics_proxy.cc similarity index 99% rename from video/receive_statistics_proxy2.cc rename to video/receive_statistics_proxy.cc index 67798b4453..daae7a3b68 100644 --- a/video/receive_statistics_proxy2.cc +++ b/video/receive_statistics_proxy.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "video/receive_statistics_proxy2.h" +#include "video/receive_statistics_proxy.h" #include #include diff --git a/video/receive_statistics_proxy2.h b/video/receive_statistics_proxy.h similarity index 98% rename from video/receive_statistics_proxy2.h rename to video/receive_statistics_proxy.h index 6e7445aeb2..b69c77be20 100644 --- a/video/receive_statistics_proxy2.h +++ b/video/receive_statistics_proxy.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef VIDEO_RECEIVE_STATISTICS_PROXY2_H_ -#define VIDEO_RECEIVE_STATISTICS_PROXY2_H_ +#ifndef VIDEO_RECEIVE_STATISTICS_PROXY_H_ +#define VIDEO_RECEIVE_STATISTICS_PROXY_H_ #include #include @@ -219,4 +219,4 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback, } // namespace internal } // namespace webrtc -#endif // VIDEO_RECEIVE_STATISTICS_PROXY2_H_ +#endif // VIDEO_RECEIVE_STATISTICS_PROXY_H_ diff --git a/video/receive_statistics_proxy2_unittest.cc b/video/receive_statistics_proxy_unittest.cc similarity index 93% rename from video/receive_statistics_proxy2_unittest.cc rename to video/receive_statistics_proxy_unittest.cc index 0c628f7b83..b0c8a13d45 100644 --- a/video/receive_statistics_proxy2_unittest.cc +++ b/video/receive_statistics_proxy_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "video/receive_statistics_proxy2.h" +#include "video/receive_statistics_proxy.h" #include #include @@ -42,16 +42,16 @@ const int kHeight = 720; } // namespace // TODO(sakal): ReceiveStatisticsProxy is lacking unittesting. -class ReceiveStatisticsProxy2Test : public ::testing::Test { +class ReceiveStatisticsProxyTest : public ::testing::Test { public: - ReceiveStatisticsProxy2Test() : time_controller_(Timestamp::Millis(1234)) { + ReceiveStatisticsProxyTest() : time_controller_(Timestamp::Millis(1234)) { metrics::Reset(); statistics_proxy_ = std::make_unique( kRemoteSsrc, time_controller_.GetClock(), time_controller_.GetMainThread()); } - ~ReceiveStatisticsProxy2Test() override { statistics_proxy_.reset(); } + ~ReceiveStatisticsProxyTest() override { statistics_proxy_.reset(); } protected: // Convenience method to avoid too many explict flushes. @@ -110,7 +110,7 @@ class ReceiveStatisticsProxy2Test : public ::testing::Test { std::unique_ptr statistics_proxy_; }; -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesFramesDecoded) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesFramesDecoded) { EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); for (uint32_t i = 1; i <= 3; ++i) { @@ -120,7 +120,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesFramesDecoded) { } } -TEST_F(ReceiveStatisticsProxy2Test, DecodedFpsIsReported) { +TEST_F(ReceiveStatisticsProxyTest, DecodedFpsIsReported) { const Frequency kFps = Frequency::Hertz(20); const int kRequiredSamples = TimeDelta::Seconds(metrics::kMinRunTimeInSeconds) * kFps; @@ -137,7 +137,7 @@ TEST_F(ReceiveStatisticsProxy2Test, DecodedFpsIsReported) { kFps.hertz())); } -TEST_F(ReceiveStatisticsProxy2Test, DecodedFpsIsNotReportedForTooFewSamples) { +TEST_F(ReceiveStatisticsProxyTest, DecodedFpsIsNotReportedForTooFewSamples) { const Frequency kFps = Frequency::Hertz(20); const int kRequiredSamples = TimeDelta::Seconds(metrics::kMinRunTimeInSeconds) * kFps; @@ -152,7 +152,7 @@ TEST_F(ReceiveStatisticsProxy2Test, DecodedFpsIsNotReportedForTooFewSamples) { metrics::NumSamples("WebRTC.Video.DecodedFramesPerSecond")); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithQpDoesNotResetFramesDecodedOrTotalDecodeTime) { EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -181,7 +181,7 @@ TEST_F(ReceiveStatisticsProxy2Test, statistics_proxy_->GetStats().total_decode_time); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesProcessingDelay) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesProcessingDelay) { const TimeDelta kProcessingDelay = TimeDelta::Millis(10); EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -218,7 +218,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesProcessingDelay) { statistics_proxy_->GetStats().total_processing_delay); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesAssemblyTime) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesAssemblyTime) { const TimeDelta kAssemblyTime = TimeDelta::Millis(7); EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_decoded); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -290,7 +290,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesAssemblyTime) { statistics_proxy_->GetStats().frames_assembled_from_multiple_packets); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesQpSum) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesQpSum) { EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, 3u, TimeDelta::Zero(), @@ -301,7 +301,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesQpSum) { EXPECT_EQ(130u, FlushAndGetStats().qp_sum); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesTotalDecodeTime) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameIncreasesTotalDecodeTime) { EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, 3u, TimeDelta::Millis(4), @@ -312,7 +312,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameIncreasesTotalDecodeTime) { EXPECT_EQ(11u, FlushAndGetStats().total_decode_time.ms()); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsContentType) { +TEST_F(ReceiveStatisticsProxyTest, ReportsContentType) { const std::string kRealtimeString("realtime"); const std::string kScreenshareString("screen"); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -328,7 +328,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsContentType) { videocontenttypehelpers::ToString(FlushAndGetStats().content_type)); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsMaxInterframeDelay) { +TEST_F(ReceiveStatisticsProxyTest, ReportsMaxInterframeDelay) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); const TimeDelta kInterframeDelay1 = TimeDelta::Millis(100); const TimeDelta kInterframeDelay2 = TimeDelta::Millis(200); @@ -355,7 +355,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsMaxInterframeDelay) { EXPECT_EQ(kInterframeDelay2.ms(), FlushAndGetStats().interframe_delay_max_ms); } -TEST_F(ReceiveStatisticsProxy2Test, ReportInterframeDelayInWindow) { +TEST_F(ReceiveStatisticsProxyTest, ReportInterframeDelayInWindow) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); const TimeDelta kInterframeDelay1 = TimeDelta::Millis(900); const TimeDelta kInterframeDelay2 = TimeDelta::Millis(750); @@ -383,7 +383,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportInterframeDelayInWindow) { EXPECT_EQ(kInterframeDelay2.ms(), FlushAndGetStats().interframe_delay_max_ms); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsFreezeMetrics) { +TEST_F(ReceiveStatisticsProxyTest, ReportsFreezeMetrics) { const TimeDelta kFreezeDuration = TimeDelta::Seconds(1); VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); @@ -406,7 +406,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsFreezeMetrics) { EXPECT_EQ(kFreezeDuration.ms(), stats.total_freezes_duration_ms); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsPauseMetrics) { +TEST_F(ReceiveStatisticsProxyTest, ReportsPauseMetrics) { VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); ASSERT_EQ(0u, stats.pause_count); ASSERT_EQ(0u, stats.total_pauses_duration_ms); @@ -424,7 +424,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsPauseMetrics) { EXPECT_EQ(5432u, stats.total_pauses_duration_ms); } -TEST_F(ReceiveStatisticsProxy2Test, PauseBeforeFirstAndAfterLastFrameIgnored) { +TEST_F(ReceiveStatisticsProxyTest, PauseBeforeFirstAndAfterLastFrameIgnored) { VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); ASSERT_EQ(0u, stats.pause_count); ASSERT_EQ(0u, stats.total_pauses_duration_ms); @@ -447,7 +447,7 @@ TEST_F(ReceiveStatisticsProxy2Test, PauseBeforeFirstAndAfterLastFrameIgnored) { EXPECT_EQ(0u, stats.total_pauses_duration_ms); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsTotalInterFrameDelay) { +TEST_F(ReceiveStatisticsProxyTest, ReportsTotalInterFrameDelay) { VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); ASSERT_EQ(0.0, stats.total_inter_frame_delay); @@ -466,7 +466,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsTotalInterFrameDelay) { EXPECT_EQ(10 * 30 / 1000.0, stats.total_inter_frame_delay); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsTotalSquaredInterFrameDelay) { +TEST_F(ReceiveStatisticsProxyTest, ReportsTotalSquaredInterFrameDelay) { VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); ASSERT_EQ(0.0, stats.total_squared_inter_frame_delay); @@ -483,7 +483,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsTotalSquaredInterFrameDelay) { stats.total_squared_inter_frame_delay); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameWithoutQpQpSumWontExist) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), @@ -491,7 +491,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameWithoutQpQpSumWontExist) { EXPECT_EQ(absl::nullopt, FlushAndGetStats().qp_sum); } -TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameWithoutQpResetsQpSum) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); statistics_proxy_->OnDecodedFrame(frame, 3u, TimeDelta::Zero(), @@ -502,7 +502,7 @@ TEST_F(ReceiveStatisticsProxy2Test, OnDecodedFrameWithoutQpResetsQpSum) { EXPECT_EQ(absl::nullopt, FlushAndGetStats().qp_sum); } -TEST_F(ReceiveStatisticsProxy2Test, OnRenderedFrameIncreasesFramesRendered) { +TEST_F(ReceiveStatisticsProxyTest, OnRenderedFrameIncreasesFramesRendered) { EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_rendered); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); for (uint32_t i = 1; i <= 3; ++i) { @@ -511,18 +511,18 @@ TEST_F(ReceiveStatisticsProxy2Test, OnRenderedFrameIncreasesFramesRendered) { } } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsSsrc) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsSsrc) { EXPECT_EQ(kRemoteSsrc, statistics_proxy_->GetStats().ssrc); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsIncomingPayloadType) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsIncomingPayloadType) { const int kPayloadType = 111; statistics_proxy_->OnIncomingPayloadType(kPayloadType); time_controller_.AdvanceTime(TimeDelta::Zero()); EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsDecoderInfo) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderInfo) { auto init_stats = statistics_proxy_->GetStats(); EXPECT_EQ(init_stats.decoder_implementation_name, "unknown"); EXPECT_EQ(init_stats.power_efficient_decoder, absl::nullopt); @@ -537,7 +537,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsDecoderInfo) { EXPECT_TRUE(stats.power_efficient_decoder); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsOnCompleteFrame) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) { const int kFrameSizeBytes = 1000; statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes, VideoContentType::UNSPECIFIED); @@ -547,7 +547,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsOnCompleteFrame) { EXPECT_EQ(0, stats.frame_counts.delta_frames); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsOnDroppedFrame) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnDroppedFrame) { unsigned int dropped_frames = 0; for (int i = 0; i < 10; ++i) { statistics_proxy_->OnDroppedFrames(i); @@ -557,7 +557,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsOnDroppedFrame) { EXPECT_EQ(dropped_frames, stats.frames_dropped); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsDecodeTimingStats) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { const int kMaxDecodeMs = 2; const int kCurrentDelayMs = 3; const int kTargetDelayMs = 4; @@ -578,7 +578,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsDecodeTimingStats) { EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsRtcpPacketTypeCounts) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsRtcpPacketTypeCounts) { const uint32_t kFirPackets = 33; const uint32_t kPliPackets = 44; const uint32_t kNackPackets = 55; @@ -593,7 +593,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsRtcpPacketTypeCounts) { EXPECT_EQ(kNackPackets, stats.rtcp_packet_type_counts.nack_packets); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsNoRtcpPacketTypeCountsForUnknownSsrc) { RtcpPacketTypeCounter counter; counter.fir_packets = 33; @@ -602,7 +602,7 @@ TEST_F(ReceiveStatisticsProxy2Test, statistics_proxy_->GetStats().rtcp_packet_type_counts.fir_packets); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsFrameCounts) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsFrameCounts) { const int kKeyFrames = 3; const int kDeltaFrames = 22; for (int i = 0; i < kKeyFrames; i++) { @@ -617,19 +617,19 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsFrameCounts) { EXPECT_EQ(kDeltaFrames, stats.frame_counts.delta_frames); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsCName) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsCName) { const char* kName = "cName"; statistics_proxy_->OnCname(kRemoteSsrc, kName); EXPECT_STREQ(kName, statistics_proxy_->GetStats().c_name.c_str()); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsNoCNameForUnknownSsrc) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsNoCNameForUnknownSsrc) { const char* kName = "cName"; statistics_proxy_->OnCname(kRemoteSsrc + 1, kName); EXPECT_STREQ("", statistics_proxy_->GetStats().c_name.c_str()); } -TEST_F(ReceiveStatisticsProxy2Test, ReportsLongestTimingFrameInfo) { +TEST_F(ReceiveStatisticsProxyTest, ReportsLongestTimingFrameInfo) { const int64_t kShortEndToEndDelay = 10; const int64_t kMedEndToEndDelay = 20; const int64_t kLongEndToEndDelay = 100; @@ -654,7 +654,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReportsLongestTimingFrameInfo) { EXPECT_EQ(kExpectedRtpTimestamp, result->rtp_timestamp); } -TEST_F(ReceiveStatisticsProxy2Test, RespectsReportingIntervalForTimingFrames) { +TEST_F(ReceiveStatisticsProxyTest, RespectsReportingIntervalForTimingFrames) { TimingFrameInfo info; const int64_t kShortEndToEndDelay = 10; const uint32_t kExpectedRtpTimestamp = 2; @@ -674,7 +674,7 @@ TEST_F(ReceiveStatisticsProxy2Test, RespectsReportingIntervalForTimingFrames) { EXPECT_FALSE(result); } -TEST_F(ReceiveStatisticsProxy2Test, LifetimeHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, LifetimeHistogramIsUpdated) { const TimeDelta kLifetime = TimeDelta::Seconds(3); time_controller_.AdvanceTime(kLifetime); // Need at least one frame to report stream lifetime. @@ -688,7 +688,7 @@ TEST_F(ReceiveStatisticsProxy2Test, LifetimeHistogramIsUpdated) { kLifetime.seconds())); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, LifetimeHistogramNotReportedForEmptyStreams) { const TimeDelta kLifetime = TimeDelta::Seconds(3); time_controller_.AdvanceTime(kLifetime); @@ -699,7 +699,7 @@ TEST_F(ReceiveStatisticsProxy2Test, 0, metrics::NumSamples("WebRTC.Video.ReceiveStreamLifetimeInSeconds")); } -TEST_F(ReceiveStatisticsProxy2Test, BadCallHistogramsAreUpdated) { +TEST_F(ReceiveStatisticsProxyTest, BadCallHistogramsAreUpdated) { // Based on the tuning parameters this will produce 7 uncertain states, // then 10 certainly bad states. There has to be 10 certain states before // any histograms are recorded. @@ -730,7 +730,7 @@ TEST_F(ReceiveStatisticsProxy2Test, BadCallHistogramsAreUpdated) { EXPECT_METRIC_EQ(0, metrics::NumSamples("WebRTC.Video.BadCall.Qp")); } -TEST_F(ReceiveStatisticsProxy2Test, PacketLossHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, PacketLossHistogramIsUpdated) { statistics_proxy_->UpdateHistograms(10, StreamDataCounters(), nullptr); EXPECT_METRIC_EQ( 0, metrics::NumSamples("WebRTC.Video.ReceivedPacketsLostInPercent")); @@ -748,7 +748,7 @@ TEST_F(ReceiveStatisticsProxy2Test, PacketLossHistogramIsUpdated) { 1, metrics::NumEvents("WebRTC.Video.ReceivedPacketsLostInPercent", 10)); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsPlayoutTimestamp) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsPlayoutTimestamp) { const int64_t kVideoNtpMs = 21; const int64_t kSyncOffsetMs = 22; const double kFreqKhz = 90.0; @@ -764,7 +764,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsPlayoutTimestamp) { statistics_proxy_->GetStats().estimated_playout_ntp_timestamp_ms); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsAvSyncOffset) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsAvSyncOffset) { const int64_t kVideoNtpMs = 21; const int64_t kSyncOffsetMs = 22; const double kFreqKhz = 90.0; @@ -774,7 +774,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsAvSyncOffset) { EXPECT_EQ(kSyncOffsetMs, FlushAndGetStats().sync_offset_ms); } -TEST_F(ReceiveStatisticsProxy2Test, AvSyncOffsetHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, AvSyncOffsetHistogramIsUpdated) { const int64_t kVideoNtpMs = 21; const int64_t kSyncOffsetMs = 22; const double kFreqKhz = 90.0; @@ -788,7 +788,7 @@ TEST_F(ReceiveStatisticsProxy2Test, AvSyncOffsetHistogramIsUpdated) { 1, metrics::NumEvents("WebRTC.Video.AVSyncOffsetInMs", kSyncOffsetMs)); } -TEST_F(ReceiveStatisticsProxy2Test, RtpToNtpFrequencyOffsetHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, RtpToNtpFrequencyOffsetHistogramIsUpdated) { const int64_t kVideoNtpMs = 21; const int64_t kSyncOffsetMs = 22; const double kFreqKhz = 90.0; @@ -814,7 +814,7 @@ TEST_F(ReceiveStatisticsProxy2Test, RtpToNtpFrequencyOffsetHistogramIsUpdated) { 1, metrics::NumEvents("WebRTC.Video.RtpToNtpFreqOffsetInKhz", 3)); } -TEST_F(ReceiveStatisticsProxy2Test, Vp8QpHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, Vp8QpHistogramIsUpdated) { const int kQp = 22; for (int i = 0; i < kMinRequiredSamples; ++i) @@ -825,8 +825,7 @@ TEST_F(ReceiveStatisticsProxy2Test, Vp8QpHistogramIsUpdated) { EXPECT_METRIC_EQ(1, metrics::NumEvents("WebRTC.Video.Decoded.Vp8.Qp", kQp)); } -TEST_F(ReceiveStatisticsProxy2Test, - Vp8QpHistogramIsNotUpdatedForTooFewSamples) { +TEST_F(ReceiveStatisticsProxyTest, Vp8QpHistogramIsNotUpdatedForTooFewSamples) { const int kQp = 22; for (int i = 0; i < kMinRequiredSamples - 1; ++i) @@ -837,7 +836,7 @@ TEST_F(ReceiveStatisticsProxy2Test, EXPECT_METRIC_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); } -TEST_F(ReceiveStatisticsProxy2Test, Vp8QpHistogramIsNotUpdatedIfNoQpValue) { +TEST_F(ReceiveStatisticsProxyTest, Vp8QpHistogramIsNotUpdatedIfNoQpValue) { for (int i = 0; i < kMinRequiredSamples; ++i) statistics_proxy_->OnPreDecode(kVideoCodecVP8, -1); @@ -846,7 +845,7 @@ TEST_F(ReceiveStatisticsProxy2Test, Vp8QpHistogramIsNotUpdatedIfNoQpValue) { EXPECT_METRIC_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, KeyFrameHistogramNotUpdatedForTooFewSamples) { const bool kIsKeyFrame = false; const int kFrameSizeBytes = 1000; @@ -865,7 +864,7 @@ TEST_F(ReceiveStatisticsProxy2Test, 0, metrics::NumSamples("WebRTC.Video.KeyFramesReceivedInPermille")); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, KeyFrameHistogramUpdatedForMinRequiredSamples) { const bool kIsKeyFrame = false; const int kFrameSizeBytes = 1000; @@ -886,7 +885,7 @@ TEST_F(ReceiveStatisticsProxy2Test, 1, metrics::NumEvents("WebRTC.Video.KeyFramesReceivedInPermille", 0)); } -TEST_F(ReceiveStatisticsProxy2Test, KeyFrameHistogramIsUpdated) { +TEST_F(ReceiveStatisticsProxyTest, KeyFrameHistogramIsUpdated) { const int kFrameSizeBytes = 1000; for (int i = 0; i < kMinRequiredSamples; ++i) @@ -910,8 +909,7 @@ TEST_F(ReceiveStatisticsProxy2Test, KeyFrameHistogramIsUpdated) { 1, metrics::NumEvents("WebRTC.Video.KeyFramesReceivedInPermille", 500)); } -TEST_F(ReceiveStatisticsProxy2Test, - TimingHistogramsNotUpdatedForTooFewSamples) { +TEST_F(ReceiveStatisticsProxyTest, TimingHistogramsNotUpdatedForTooFewSamples) { const int kMaxDecodeMs = 2; const int kCurrentDelayMs = 3; const int kTargetDelayMs = 4; @@ -935,7 +933,7 @@ TEST_F(ReceiveStatisticsProxy2Test, EXPECT_METRIC_EQ(0, metrics::NumSamples("WebRTC.Video.OnewayDelayInMs")); } -TEST_F(ReceiveStatisticsProxy2Test, TimingHistogramsAreUpdated) { +TEST_F(ReceiveStatisticsProxyTest, TimingHistogramsAreUpdated) { const int kMaxDecodeMs = 2; const int kCurrentDelayMs = 3; const int kTargetDelayMs = 4; @@ -966,7 +964,7 @@ TEST_F(ReceiveStatisticsProxy2Test, TimingHistogramsAreUpdated) { 1, metrics::NumEvents("WebRTC.Video.OnewayDelayInMs", kTargetDelayMs)); } -TEST_F(ReceiveStatisticsProxy2Test, DoesNotReportStaleFramerates) { +TEST_F(ReceiveStatisticsProxyTest, DoesNotReportStaleFramerates) { const Frequency kDefaultFps = Frequency::Hertz(30); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -994,7 +992,7 @@ TEST_F(ReceiveStatisticsProxy2Test, DoesNotReportStaleFramerates) { EXPECT_EQ(0, statistics_proxy_->GetStats().render_frame_rate); } -TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsReceivedFrameStats) { +TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsReceivedFrameStats) { EXPECT_EQ(0, statistics_proxy_->GetStats().width); EXPECT_EQ(0, statistics_proxy_->GetStats().height); EXPECT_EQ(0u, statistics_proxy_->GetStats().frames_rendered); @@ -1006,7 +1004,7 @@ TEST_F(ReceiveStatisticsProxy2Test, GetStatsReportsReceivedFrameStats) { EXPECT_EQ(1u, statistics_proxy_->GetStats().frames_rendered); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, ReceivedFrameHistogramsAreNotUpdatedForTooFewSamples) { for (int i = 0; i < kMinRequiredSamples - 1; ++i) { statistics_proxy_->OnRenderedFrame(MetaData(CreateFrame(kWidth, kHeight))); @@ -1024,7 +1022,7 @@ TEST_F(ReceiveStatisticsProxy2Test, 0, metrics::NumSamples("WebRTC.Video.RenderSqrtPixelsPerSecond")); } -TEST_F(ReceiveStatisticsProxy2Test, ReceivedFrameHistogramsAreUpdated) { +TEST_F(ReceiveStatisticsProxyTest, ReceivedFrameHistogramsAreUpdated) { for (int i = 0; i < kMinRequiredSamples; ++i) { statistics_proxy_->OnRenderedFrame(MetaData(CreateFrame(kWidth, kHeight))); } @@ -1045,7 +1043,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ReceivedFrameHistogramsAreUpdated) { 1, metrics::NumEvents("WebRTC.Video.ReceivedHeightInPixels", kHeight)); } -TEST_F(ReceiveStatisticsProxy2Test, ZeroDelayReportedIfFrameNotDelayed) { +TEST_F(ReceiveStatisticsProxyTest, ZeroDelayReportedIfFrameNotDelayed) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), VideoContentType::UNSPECIFIED); @@ -1066,7 +1064,7 @@ TEST_F(ReceiveStatisticsProxy2Test, ZeroDelayReportedIfFrameNotDelayed) { "WebRTC.Video.DelayedFramesToRenderer_AvgDelayInMs")); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, DelayedFrameHistogramsAreNotUpdatedIfMinRuntimeHasNotPassed) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), @@ -1087,7 +1085,7 @@ TEST_F(ReceiveStatisticsProxy2Test, "WebRTC.Video.DelayedFramesToRenderer_AvgDelayInMs")); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, DelayedFramesHistogramsAreNotUpdatedIfNoRenderedFrames) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), @@ -1104,7 +1102,7 @@ TEST_F(ReceiveStatisticsProxy2Test, "WebRTC.Video.DelayedFramesToRenderer_AvgDelayInMs")); } -TEST_F(ReceiveStatisticsProxy2Test, DelayReportedIfFrameIsDelayed) { +TEST_F(ReceiveStatisticsProxyTest, DelayReportedIfFrameIsDelayed) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), VideoContentType::UNSPECIFIED); @@ -1128,7 +1126,7 @@ TEST_F(ReceiveStatisticsProxy2Test, DelayReportedIfFrameIsDelayed) { 1)); } -TEST_F(ReceiveStatisticsProxy2Test, AverageDelayOfDelayedFramesIsReported) { +TEST_F(ReceiveStatisticsProxyTest, AverageDelayOfDelayedFramesIsReported) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, TimeDelta::Zero(), VideoContentType::UNSPECIFIED); @@ -1160,7 +1158,7 @@ TEST_F(ReceiveStatisticsProxy2Test, AverageDelayOfDelayedFramesIsReported) { 8)); } -TEST_F(ReceiveStatisticsProxy2Test, +TEST_F(ReceiveStatisticsProxyTest, RtcpHistogramsNotUpdatedIfMinRuntimeHasNotPassed) { StreamDataCounters data_counters; data_counters.first_packet_time_ms = @@ -1181,7 +1179,7 @@ TEST_F(ReceiveStatisticsProxy2Test, 0, metrics::NumSamples("WebRTC.Video.NackPacketsSentPerMinute")); } -TEST_F(ReceiveStatisticsProxy2Test, RtcpHistogramsAreUpdated) { +TEST_F(ReceiveStatisticsProxyTest, RtcpHistogramsAreUpdated) { StreamDataCounters data_counters; data_counters.first_packet_time_ms = time_controller_.GetClock()->TimeInMilliseconds(); @@ -1216,8 +1214,8 @@ TEST_F(ReceiveStatisticsProxy2Test, RtcpHistogramsAreUpdated) { kNackPackets * 60 / metrics::kMinRunTimeInSeconds)); } -class ReceiveStatisticsProxy2TestWithFreezeDuration - : public ReceiveStatisticsProxy2Test, +class ReceiveStatisticsProxyTestWithFreezeDuration + : public ReceiveStatisticsProxyTest, public ::testing::WithParamInterface< std::tuple> { protected: @@ -1239,13 +1237,13 @@ const auto kFreezeDetectionCond2Freeze = std::make_tuple(30, 185, 1); const auto kFreezeDetectionCond2NotFreeze = std::make_tuple(30, 184, 0); INSTANTIATE_TEST_SUITE_P(_, - ReceiveStatisticsProxy2TestWithFreezeDuration, + ReceiveStatisticsProxyTestWithFreezeDuration, ::testing::Values(kFreezeDetectionCond1Freeze, kFreezeDetectionCond1NotFreeze, kFreezeDetectionCond2Freeze, kFreezeDetectionCond2NotFreeze)); -TEST_P(ReceiveStatisticsProxy2TestWithFreezeDuration, FreezeDetection) { +TEST_P(ReceiveStatisticsProxyTestWithFreezeDuration, FreezeDetection) { VideoReceiveStreamInterface::Stats stats = statistics_proxy_->GetStats(); EXPECT_EQ(0u, stats.freeze_count); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1268,19 +1266,19 @@ TEST_P(ReceiveStatisticsProxy2TestWithFreezeDuration, FreezeDetection) { EXPECT_EQ(stats.freeze_count, expected_freeze_count_); } -class ReceiveStatisticsProxy2TestWithContent - : public ReceiveStatisticsProxy2Test, +class ReceiveStatisticsProxyTestWithContent + : public ReceiveStatisticsProxyTest, public ::testing::WithParamInterface { protected: const webrtc::VideoContentType content_type_{GetParam()}; }; INSTANTIATE_TEST_SUITE_P(ContentTypes, - ReceiveStatisticsProxy2TestWithContent, + ReceiveStatisticsProxyTestWithContent, ::testing::Values(VideoContentType::UNSPECIFIED, VideoContentType::SCREENSHARE)); -TEST_P(ReceiveStatisticsProxy2TestWithContent, InterFrameDelaysAreReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, InterFrameDelaysAreReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1313,7 +1311,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, InterFrameDelaysAreReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, +TEST_P(ReceiveStatisticsProxyTestWithContent, InterFrameDelaysPercentilesAreReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); const int kLastFivePercentsSamples = kMinRequiredSamples * 5 / 100; @@ -1349,7 +1347,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, +TEST_P(ReceiveStatisticsProxyTestWithContent, MaxInterFrameDelayOnlyWithValidAverage) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1373,8 +1371,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, "WebRTC.Video.Screenshare.InterframeDelayMaxInMs")); } -TEST_P(ReceiveStatisticsProxy2TestWithContent, - MaxInterFrameDelayOnlyWithPause) { +TEST_P(ReceiveStatisticsProxyTestWithContent, MaxInterFrameDelayOnlyWithPause) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1420,7 +1417,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, FreezesAreReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, FreezesAreReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); const TimeDelta kFreezeDelay = TimeDelta::Millis(200); const TimeDelta kCallDuration = @@ -1468,7 +1465,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, FreezesAreReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, HarmonicFrameRateIsReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, HarmonicFrameRateIsReported) { const TimeDelta kFrameDuration = TimeDelta::Millis(33); const TimeDelta kFreezeDuration = TimeDelta::Millis(200); const TimeDelta kPauseDuration = TimeDelta::Seconds(10); @@ -1517,7 +1514,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, HarmonicFrameRateIsReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, PausesAreIgnored) { +TEST_P(ReceiveStatisticsProxyTestWithContent, PausesAreIgnored) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); const TimeDelta kPauseDuration = TimeDelta::Seconds(10); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1562,7 +1559,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, PausesAreIgnored) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, ManyPausesAtTheBeginning) { +TEST_P(ReceiveStatisticsProxyTestWithContent, ManyPausesAtTheBeginning) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(33); const TimeDelta kPauseDuration = TimeDelta::Seconds(10); webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); @@ -1591,7 +1588,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, ManyPausesAtTheBeginning) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, TimeInHdReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, TimeInHdReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(20); webrtc::VideoFrame frame_hd = CreateFrame(1280, 720); webrtc::VideoFrame frame_sd = CreateFrame(640, 360); @@ -1630,7 +1627,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, TimeInHdReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, TimeInBlockyVideoReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, TimeInBlockyVideoReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(20); const int kHighQp = 80; const int kLowQp = 30; @@ -1673,7 +1670,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, TimeInBlockyVideoReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, DownscalesReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, DownscalesReported) { // To ensure long enough call duration. const TimeDelta kInterFrameDelay = TimeDelta::Seconds(2); @@ -1704,7 +1701,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, DownscalesReported) { } } -TEST_P(ReceiveStatisticsProxy2TestWithContent, DecodeTimeReported) { +TEST_P(ReceiveStatisticsProxyTestWithContent, DecodeTimeReported) { const TimeDelta kInterFrameDelay = TimeDelta::Millis(20); const int kLowQp = 30; const TimeDelta kDecodeTime = TimeDelta::Millis(7); @@ -1721,7 +1718,7 @@ TEST_P(ReceiveStatisticsProxy2TestWithContent, DecodeTimeReported) { 1, metrics::NumEvents("WebRTC.Video.DecodeTimeInMs", kDecodeTime.ms())); } -TEST_P(ReceiveStatisticsProxy2TestWithContent, +TEST_P(ReceiveStatisticsProxyTestWithContent, StatsAreSlicedOnSimulcastAndExperiment) { const uint8_t experiment_id = 1; webrtc::VideoContentType content_type = content_type_; diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 6a9b000db4..7adf0d230d 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -52,7 +52,7 @@ #include "system_wrappers/include/clock.h" #include "video/call_stats2.h" #include "video/frame_dumping_decoder.h" -#include "video/receive_statistics_proxy2.h" +#include "video/receive_statistics_proxy.h" #include "video/render/incoming_video_stream.h" #include "video/task_queue_frame_decode_scheduler.h" diff --git a/video/video_receive_stream2.h b/video/video_receive_stream2.h index ef4f900f94..31b9a7eb7c 100644 --- a/video/video_receive_stream2.h +++ b/video/video_receive_stream2.h @@ -34,7 +34,7 @@ #include "rtc_base/task_queue.h" #include "rtc_base/thread_annotations.h" #include "system_wrappers/include/clock.h" -#include "video/receive_statistics_proxy2.h" +#include "video/receive_statistics_proxy.h" #include "video/rtp_streams_synchronizer2.h" #include "video/rtp_video_stream_receiver2.h" #include "video/transport_adapter.h" diff --git a/video/video_stream_decoder2.cc b/video/video_stream_decoder2.cc index 1ef2d0ecd0..ba36d127b0 100644 --- a/video/video_stream_decoder2.cc +++ b/video/video_stream_decoder2.cc @@ -13,7 +13,7 @@ #include "api/video_codecs/video_decoder.h" #include "modules/video_coding/video_receiver2.h" #include "rtc_base/checks.h" -#include "video/receive_statistics_proxy2.h" +#include "video/receive_statistics_proxy.h" namespace webrtc { namespace internal {