From fb7a6a7f8dc8f7f549203dc95bc1789183b88c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 17 Jan 2019 13:09:07 +0100 Subject: [PATCH] Delete test WebRtcVideoChannelTest.AdaptsOnOveruseAndChangeResolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It only tests the videoadaptation in the test class FakeVideoCapturer. Bug: webrtc:6353 Change-Id: I4766eebc5cfa7412fde9fd6e5173f1b2381a5d87 Reviewed-on: https://webrtc-review.googlesource.com/c/118042 Reviewed-by: Erik Språng Reviewed-by: Per Kjellander Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#26297} --- media/engine/webrtc_video_engine_unittest.cc | 80 -------------------- 1 file changed, 80 deletions(-) diff --git a/media/engine/webrtc_video_engine_unittest.cc b/media/engine/webrtc_video_engine_unittest.cc index b02d5a9054..fc95a7e5e6 100644 --- a/media/engine/webrtc_video_engine_unittest.cc +++ b/media/engine/webrtc_video_engine_unittest.cc @@ -3254,86 +3254,6 @@ TEST_F(WebRtcVideoChannelTest, DoesNotAdaptOnOveruseWhenScreensharing) { TestCpuAdaptation(true, true); } -TEST_F(WebRtcVideoChannelTest, AdaptsOnOveruseAndChangeResolution) { - cricket::VideoCodec codec = GetEngineCodec("VP8"); - cricket::VideoSendParameters parameters; - parameters.codecs.push_back(codec); - - MediaConfig media_config = GetMediaConfig(); - channel_.reset(engine_.CreateMediaChannel( - fake_call_.get(), media_config, VideoOptions(), webrtc::CryptoOptions())); - channel_->OnReadyToSend(true); - ASSERT_TRUE(channel_->SetSendParameters(parameters)); - - AddSendStream(); - - FakeVideoCapturerWithTaskQueue capturer; - ASSERT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, &capturer)); - ASSERT_EQ(cricket::CS_RUNNING, - capturer.Start(capturer.GetSupportedFormats()->front())); - ASSERT_TRUE(channel_->SetSend(true)); - - ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); - FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); - - EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720)); - EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1280, send_stream->GetLastWidth()); - EXPECT_EQ(720, send_stream->GetLastHeight()); - - // Trigger overuse. - rtc::VideoSinkWants wants; - wants.max_pixel_count = - send_stream->GetLastWidth() * send_stream->GetLastHeight() - 1; - send_stream->InjectVideoSinkWants(wants); - EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720)); - EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1280 * 3 / 4, send_stream->GetLastWidth()); - EXPECT_EQ(720 * 3 / 4, send_stream->GetLastHeight()); - - // Trigger overuse again. - wants.max_pixel_count = - send_stream->GetLastWidth() * send_stream->GetLastHeight() - 1; - send_stream->InjectVideoSinkWants(wants); - EXPECT_TRUE(capturer.CaptureCustomFrame(1280, 720)); - EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1280 * 2 / 4, send_stream->GetLastWidth()); - EXPECT_EQ(720 * 2 / 4, send_stream->GetLastHeight()); - - // Change input resolution. - EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724)); - EXPECT_EQ(4, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1284 / 2, send_stream->GetLastWidth()); - EXPECT_EQ(724 / 2, send_stream->GetLastHeight()); - - // Trigger underuse which should go back up in resolution. - int current_pixel_count = - send_stream->GetLastWidth() * send_stream->GetLastHeight(); - // Cap the max to 4x the pixel count (assuming max 1/2 x 1/2 scale downs) - // of the current stream, so we don't take too large steps. - wants.max_pixel_count = current_pixel_count * 4; - // Default step down is 3/5 pixel count, so go up by 5/3. - wants.target_pixel_count = (current_pixel_count * 5 / 3); - send_stream->InjectVideoSinkWants(wants); - EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724)); - EXPECT_EQ(5, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1284 * 3 / 4, send_stream->GetLastWidth()); - EXPECT_EQ(724 * 3 / 4, send_stream->GetLastHeight()); - - // Trigger underuse again, should go back up to full resolution. - current_pixel_count = - send_stream->GetLastWidth() * send_stream->GetLastHeight(); - wants.max_pixel_count = current_pixel_count * 4; - wants.target_pixel_count = (current_pixel_count * 5 / 3); - send_stream->InjectVideoSinkWants(wants); - EXPECT_TRUE(capturer.CaptureCustomFrame(1284, 724)); - EXPECT_EQ(6, send_stream->GetNumberOfSwappedFrames()); - EXPECT_EQ(1284, send_stream->GetLastWidth()); - EXPECT_EQ(724, send_stream->GetLastHeight()); - - EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, nullptr, nullptr)); -} - TEST_F(WebRtcVideoChannelTest, PreviousAdaptationDoesNotApplyToScreenshare) { cricket::VideoCodec codec = GetEngineCodec("VP8"); cricket::VideoSendParameters parameters;