Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1695263002: Move direct use of VideoCapturer::VideoAdapter to VideoSinkWants. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 EXPECT_EQ(cricket::CS_RUNNING, 1756 EXPECT_EQ(cricket::CS_RUNNING,
1757 capturer.Start(capturer.GetSupportedFormats()->front())); 1757 capturer.Start(capturer.GetSupportedFormats()->front()));
1758 1758
1759 EXPECT_TRUE(channel_->SetSend(true)); 1759 EXPECT_TRUE(channel_->SetSend(true));
1760 1760
1761 // Trigger overuse. 1761 // Trigger overuse.
1762 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 1762 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
1763 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); 1763 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
1764 webrtc::LoadObserver* overuse_callback = 1764 webrtc::LoadObserver* overuse_callback =
1765 send_stream->GetConfig().overuse_callback; 1765 send_stream->GetConfig().overuse_callback;
1766
1767 if (!enable_overuse) {
1768 ASSERT_TRUE(overuse_callback == NULL);
1769
1770 EXPECT_TRUE(capturer.CaptureFrame());
1771 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
1772
1773 EXPECT_EQ(codec.width, send_stream->GetLastWidth());
1774 EXPECT_EQ(codec.height, send_stream->GetLastHeight());
1775
1776 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1777 return;
1778 }
1779
1766 ASSERT_TRUE(overuse_callback != NULL); 1780 ASSERT_TRUE(overuse_callback != NULL);
1767 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse); 1781 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse);
1768 1782
1769 EXPECT_TRUE(capturer.CaptureFrame()); 1783 EXPECT_TRUE(capturer.CaptureFrame());
1770 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); 1784 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
1771 1785
1772 if (enable_overuse && !is_screenshare) { 1786 if (is_screenshare) {
1787 // Do not adapt screen share.
1788 EXPECT_EQ(codec.width, send_stream->GetLastWidth());
1789 EXPECT_EQ(codec.height, send_stream->GetLastHeight());
1790 } else {
1773 EXPECT_LT(send_stream->GetLastWidth(), codec.width); 1791 EXPECT_LT(send_stream->GetLastWidth(), codec.width);
1774 EXPECT_LT(send_stream->GetLastHeight(), codec.height); 1792 EXPECT_LT(send_stream->GetLastHeight(), codec.height);
1775 } else {
1776 EXPECT_EQ(codec.width, send_stream->GetLastWidth());
1777 EXPECT_EQ(codec.height, send_stream->GetLastHeight());
1778 } 1793 }
1779 1794
1780 // Trigger underuse which should go back to normal resolution. 1795 // Trigger underuse which should go back to normal resolution.
1781 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kUnderuse); 1796 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kUnderuse);
1782 EXPECT_TRUE(capturer.CaptureFrame()); 1797 EXPECT_TRUE(capturer.CaptureFrame());
1783 1798
1784 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); 1799 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames());
1785 1800
1786 EXPECT_EQ(codec.width, send_stream->GetLastWidth()); 1801 EXPECT_EQ(codec.width, send_stream->GetLastWidth());
1787 EXPECT_EQ(codec.height, send_stream->GetLastHeight()); 1802 EXPECT_EQ(codec.height, send_stream->GetLastHeight());
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3078 // Test that we normalize send codec format size in simulcast. 3093 // Test that we normalize send codec format size in simulcast.
3079 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3094 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3080 cricket::VideoCodec codec(kVp8Codec270p); 3095 cricket::VideoCodec codec(kVp8Codec270p);
3081 codec.width += 1; 3096 codec.width += 1;
3082 codec.height += 1; 3097 codec.height += 1;
3083 VerifySimulcastSettings(codec, 2, 2); 3098 VerifySimulcastSettings(codec, 2, 2);
3084 } 3099 }
3085 } // namespace cricket 3100 } // namespace cricket
3086 3101
3087 #endif // HAVE_WEBRTC_VIDEO 3102 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« webrtc/media/engine/webrtcvideoengine2.cc ('K') | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698