Update expectation on first Sinkwants in CallPerfTest.ReceivesCpuOveruseAndUnderuse

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 <jleconte@google.com>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41952}
This commit is contained in:
Per K 2024-03-22 12:07:38 +01:00 committed by WebRTC LUCI CQ
parent faf398785b
commit e0edc2120e

View File

@ -585,32 +585,34 @@ TEST_F(CallPerfTest, ReceivesCpuOveruseAndUnderuse) {
// TODO(sprang): Add integration test for maintain-framerate mode?
void OnSinkWantsChanged(rtc::VideoSinkInterface<VideoFrame>* 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<int>::max() &&
wants.max_pixel_count == std::numeric_limits<int>::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<int>::max()) {