OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 | 1739 |
1740 cricket::FakeVideoCapturer capturer; | 1740 cricket::FakeVideoCapturer capturer; |
1741 capturer.SetScreencast(is_screenshare); | 1741 capturer.SetScreencast(is_screenshare); |
1742 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1742 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1743 EXPECT_EQ(cricket::CS_RUNNING, | 1743 EXPECT_EQ(cricket::CS_RUNNING, |
1744 capturer.Start(capturer.GetSupportedFormats()->front())); | 1744 capturer.Start(capturer.GetSupportedFormats()->front())); |
1745 | 1745 |
1746 EXPECT_TRUE(channel_->SetSend(true)); | 1746 EXPECT_TRUE(channel_->SetSend(true)); |
1747 | 1747 |
1748 // Trigger overuse. | 1748 // Trigger overuse. |
| 1749 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| 1750 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
1749 webrtc::LoadObserver* overuse_callback = | 1751 webrtc::LoadObserver* overuse_callback = |
1750 fake_call_->GetConfig().overuse_callback; | 1752 send_stream->GetConfig().overuse_callback; |
1751 ASSERT_TRUE(overuse_callback != NULL); | 1753 ASSERT_TRUE(overuse_callback != NULL); |
1752 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse); | 1754 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse); |
1753 | 1755 |
1754 EXPECT_TRUE(capturer.CaptureFrame()); | 1756 EXPECT_TRUE(capturer.CaptureFrame()); |
1755 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | |
1756 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | |
1757 | |
1758 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); | 1757 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); |
1759 | 1758 |
1760 if (enable_overuse && !is_screenshare) { | 1759 if (enable_overuse && !is_screenshare) { |
1761 EXPECT_LT(send_stream->GetLastWidth(), codec.width); | 1760 EXPECT_LT(send_stream->GetLastWidth(), codec.width); |
1762 EXPECT_LT(send_stream->GetLastHeight(), codec.height); | 1761 EXPECT_LT(send_stream->GetLastHeight(), codec.height); |
1763 } else { | 1762 } else { |
1764 EXPECT_EQ(codec.width, send_stream->GetLastWidth()); | 1763 EXPECT_EQ(codec.width, send_stream->GetLastWidth()); |
1765 EXPECT_EQ(codec.height, send_stream->GetLastHeight()); | 1764 EXPECT_EQ(codec.height, send_stream->GetLastHeight()); |
1766 } | 1765 } |
1767 | 1766 |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2336 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30, 0); | 2335 cricket::VideoCodec send_codec(100, "VP8", 640, 480, 30, 0); |
2337 std::vector<cricket::VideoCodec> codecs; | 2336 std::vector<cricket::VideoCodec> codecs; |
2338 codecs.push_back(send_codec); | 2337 codecs.push_back(send_codec); |
2339 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); | 2338 EXPECT_TRUE(channel_->SetSendCodecs(codecs)); |
2340 EXPECT_TRUE(channel_->SetSend(true)); | 2339 EXPECT_TRUE(channel_->SetSend(true)); |
2341 | 2340 |
2342 // Verify that the CpuOveruseObserver is registered and trigger downgrade. | 2341 // Verify that the CpuOveruseObserver is registered and trigger downgrade. |
2343 cricket::VideoOptions options; | 2342 cricket::VideoOptions options; |
2344 options.cpu_overuse_detection.Set(true); | 2343 options.cpu_overuse_detection.Set(true); |
2345 EXPECT_TRUE(channel_->SetOptions(options)); | 2344 EXPECT_TRUE(channel_->SetOptions(options)); |
| 2345 |
2346 // Trigger overuse. | 2346 // Trigger overuse. |
| 2347 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
2347 webrtc::LoadObserver* overuse_callback = | 2348 webrtc::LoadObserver* overuse_callback = |
2348 fake_call_->GetConfig().overuse_callback; | 2349 fake_call_->GetVideoSendStreams().front()->GetConfig().overuse_callback; |
| 2350 ASSERT_TRUE(overuse_callback != NULL); |
2349 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse); | 2351 overuse_callback->OnLoadUpdate(webrtc::LoadObserver::kOveruse); |
2350 | 2352 |
2351 // Capture format VGA -> adapt (OnCpuResolutionRequest downgrade) -> VGA/2. | 2353 // Capture format VGA -> adapt (OnCpuResolutionRequest downgrade) -> VGA/2. |
2352 EXPECT_TRUE(video_capturer_vga.CaptureFrame()); | 2354 EXPECT_TRUE(video_capturer_vga.CaptureFrame()); |
2353 cricket::VideoMediaInfo info; | 2355 cricket::VideoMediaInfo info; |
2354 EXPECT_TRUE(channel_->GetStats(&info)); | 2356 EXPECT_TRUE(channel_->GetStats(&info)); |
2355 ASSERT_EQ(1U, info.senders.size()); | 2357 ASSERT_EQ(1U, info.senders.size()); |
2356 EXPECT_EQ(1, info.senders[0].adapt_changes); | 2358 EXPECT_EQ(1, info.senders[0].adapt_changes); |
2357 EXPECT_EQ(CoordinatedVideoAdapter::ADAPTREASON_CPU, | 2359 EXPECT_EQ(CoordinatedVideoAdapter::ADAPTREASON_CPU, |
2358 info.senders[0].adapt_reason); | 2360 info.senders[0].adapt_reason); |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 // Ensures that the correct settings are applied to the codec when two temporal | 3180 // Ensures that the correct settings are applied to the codec when two temporal |
3179 // layer screencasting is enabled, and that the correct simulcast settings are | 3181 // layer screencasting is enabled, and that the correct simulcast settings are |
3180 // reapplied when disabling screencasting. | 3182 // reapplied when disabling screencasting. |
3181 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3183 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3182 DISABLED_TwoTemporalLayerScreencastSettings) { | 3184 DISABLED_TwoTemporalLayerScreencastSettings) { |
3183 // TODO(pbos): Implement. | 3185 // TODO(pbos): Implement. |
3184 FAIL() << "Not implemented."; | 3186 FAIL() << "Not implemented."; |
3185 } | 3187 } |
3186 | 3188 |
3187 } // namespace cricket | 3189 } // namespace cricket |
OLD | NEW |