From e0edc2120e72c3174601df6e826fc58b271a7cd0 Mon Sep 17 00:00:00 2001 From: Per K Date: Fri, 22 Mar 2024 12:07:38 +0100 Subject: [PATCH] Update expectation on first Sinkwants in CallPerfTest.ReceivesCpuOveruseAndUnderuse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After cl https://webrtc-review.googlesource.com/c/src/+/343122 there is no default max frame rate. Bug: webrtc:15885 Change-Id: Iac38895486d31bd267b578bbd1ab905dcdae00ff Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/344142 Reviewed-by: Jeremy Leconte Commit-Queue: Erik Språng Reviewed-by: Erik Språng Auto-Submit: Per Kjellander Cr-Commit-Position: refs/heads/main@{#41952} --- call/call_perf_tests.cc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index 0e8fb428cd..c6842a501f 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -585,32 +585,34 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) { // TODO(sprang): Add integration test for maintain-framerate mode? void OnSinkWantsChanged(rtc::VideoSinkInterface* sink, const rtc::VideoSinkWants& wants) override { - // The sink wants can change either because an adaptation happened (i.e. - // the pixels or frame rate changed) or for other reasons, such as encoded - // resolutions being communicated (happens whenever we capture a new frame - // size). In this test, we only care about adaptations. + RTC_LOG(LS_INFO) << "OnSinkWantsChanged fps:" << wants.max_framerate_fps + << " max_pixel_count " << wants.max_pixel_count + << " target_pixel_count" + << wants.target_pixel_count.value_or(-1); + // The sink wants can change either because an adaptation happened + // (i.e. the pixels or frame rate changed) or for other reasons, such + // as encoded resolutions being communicated (happens whenever we + // capture a new frame size). In this test, we only care about + // adaptations. bool did_adapt = last_wants_.max_pixel_count != wants.max_pixel_count || last_wants_.target_pixel_count != wants.target_pixel_count || last_wants_.max_framerate_fps != wants.max_framerate_fps; last_wants_ = wants; if (!did_adapt) { + if (test_phase_ == TestPhase::kInit) { + test_phase_ = TestPhase::kStart; + } return; } // At kStart expect CPU overuse. Then expect CPU underuse when the encoder // delay has been decreased. switch (test_phase_) { case TestPhase::kInit: - // Max framerate should be set initially. - if (wants.max_framerate_fps != std::numeric_limits::max() && - wants.max_pixel_count == std::numeric_limits::max()) { - test_phase_ = TestPhase::kStart; - } else { - ADD_FAILURE() << "Got unexpected adaptation request, max res = " - << wants.max_pixel_count << ", target res = " - << wants.target_pixel_count.value_or(-1) - << ", max fps = " << wants.max_framerate_fps; - } + ADD_FAILURE() << "Got unexpected adaptation request, max res = " + << wants.max_pixel_count << ", target res = " + << wants.target_pixel_count.value_or(-1) + << ", max fps = " << wants.max_framerate_fps; break; case TestPhase::kStart: if (wants.max_pixel_count < std::numeric_limits::max()) {