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

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

Issue 1711763003: New flag is_screencast in VideoOptions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase, on top of suspend_below_min_bitrate change. Created 4 years, 9 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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 cricket::VideoCodec codec = kVp8Codec360p; 1465 cricket::VideoCodec codec = kVp8Codec360p;
1466 cricket::VideoSendParameters parameters; 1466 cricket::VideoSendParameters parameters;
1467 parameters.codecs.push_back(codec); 1467 parameters.codecs.push_back(codec);
1468 parameters.options.screencast_min_bitrate_kbps = 1468 parameters.options.screencast_min_bitrate_kbps =
1469 rtc::Optional<int>(kScreenshareMinBitrateKbps); 1469 rtc::Optional<int>(kScreenshareMinBitrateKbps);
1470 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 1470 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1471 1471
1472 AddSendStream(); 1472 AddSendStream();
1473 1473
1474 cricket::FakeVideoCapturer capturer; 1474 cricket::FakeVideoCapturer capturer;
1475 capturer.SetScreencast(false);
1476 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1475 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1477 cricket::VideoFormat capture_format_hd = 1476 cricket::VideoFormat capture_format_hd =
1478 capturer.GetSupportedFormats()->front(); 1477 capturer.GetSupportedFormats()->front();
1479 EXPECT_EQ(1280, capture_format_hd.width); 1478 EXPECT_EQ(1280, capture_format_hd.width);
1480 EXPECT_EQ(720, capture_format_hd.height); 1479 EXPECT_EQ(720, capture_format_hd.height);
1481 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); 1480 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd));
1482 1481
1483 EXPECT_TRUE(channel_->SetSend(true)); 1482 EXPECT_TRUE(channel_->SetSend(true));
1484 1483
1485 EXPECT_TRUE(capturer.CaptureFrame()); 1484 EXPECT_TRUE(capturer.CaptureFrame());
1486 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 1485 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
1487 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); 1486 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
1488 1487
1489 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); 1488 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames());
1490 1489
1491 // Verify non-screencast settings. 1490 // Verify non-screencast settings.
1492 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig(); 1491 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig();
1493 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, 1492 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo,
1494 encoder_config.content_type); 1493 encoder_config.content_type);
1495 EXPECT_EQ(codec.width, encoder_config.streams.front().width); 1494 EXPECT_EQ(codec.width, encoder_config.streams.front().width);
1496 EXPECT_EQ(codec.height, encoder_config.streams.front().height); 1495 EXPECT_EQ(codec.height, encoder_config.streams.front().height);
1497 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) 1496 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps)
1498 << "Non-screenshare shouldn't use min-transmit bitrate."; 1497 << "Non-screenshare shouldn't use min-transmit bitrate.";
1499 1498
1500 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); 1499 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr));
1501 // Removing a capturer triggers a black frame to be sent. 1500 // Removing a capturer triggers a black frame to be sent.
1502 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); 1501 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames());
1503 capturer.SetScreencast(true); 1502
1504 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1503 FakeVideoCapturer screencast_capturer(true);
1505 EXPECT_TRUE(capturer.CaptureFrame()); 1504 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer));
1505 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start(capture_format_hd));
1506 parameters.options.is_screencast = rtc::Optional<bool>(true);
1507 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1508 EXPECT_TRUE(screencast_capturer.CaptureFrame());
1509 // Send stream not recreated after option change.
1510 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front());
1506 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); 1511 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames());
1507 1512
1508 // Verify screencast settings. 1513 // Verify screencast settings.
1509 encoder_config = send_stream->GetEncoderConfig(); 1514 encoder_config = send_stream->GetEncoderConfig();
1510 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, 1515 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen,
1511 encoder_config.content_type); 1516 encoder_config.content_type);
1512 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, 1517 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000,
1513 encoder_config.min_transmit_bitrate_bps); 1518 encoder_config.min_transmit_bitrate_bps);
1514 1519
1515 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width); 1520 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width);
1516 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); 1521 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height);
1517 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); 1522 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty());
1518 1523
1519 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1524 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL));
1520 } 1525 }
1521 1526
1527 TEST_F(WebRtcVideoChannel2Test, NoRecreateStreamForScreencast) {
1528 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
nisse-webrtc 2016/03/01 13:24:40 Maybe this test is somewhat redundant, behavior is
nisse-webrtc 2016/03/02 08:09:51 Something is broken, and the tests too... First,
1529 ASSERT_TRUE(
1530 channel_->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc)));
1531 EXPECT_TRUE(channel_->SetSend(true));
1532
1533 cricket::FakeVideoCapturer capturer;
1534 EXPECT_TRUE(channel_->SetCapturer(kSsrc, &capturer));
1535 EXPECT_EQ(cricket::CS_RUNNING,
1536 capturer.Start(capturer.GetSupportedFormats()->front()));
1537 EXPECT_TRUE(capturer.CaptureFrame());
1538
1539 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams());
1540 FakeVideoSendStream* stream1 = fake_call_->GetVideoSendStreams().front();
1541 webrtc::VideoEncoderConfig encoder_config = stream1->GetEncoderConfig();
1542 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo,
1543 encoder_config.content_type);
1544
1545 EXPECT_EQ(1, stream1->GetNumberOfSwappedFrames());
1546
1547 /* Switch to screencast source. We expect a reconfigure of the
1548 * encoder, but no change of the send stream. */
1549 struct VideoOptions video_options;
1550 video_options.is_screencast = rtc::Optional<bool>(true);
1551 channel_->SetVideoSend(kSsrc, true, &video_options);
1552
1553 EXPECT_TRUE(capturer.CaptureFrame());
1554 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams());
1555 FakeVideoSendStream* stream2 = fake_call_->GetVideoSendStreams().front();
1556 EXPECT_EQ(stream1, stream2);
1557 EXPECT_EQ(2, stream2->GetNumberOfSwappedFrames());
1558
1559 encoder_config = stream2->GetEncoderConfig();
1560 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen,
1561 encoder_config.content_type);
1562
1563 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL));
1564 }
pbos-webrtc 2016/03/01 16:11:36 Should we check switching from screencast? I think
1565
1522 TEST_F(WebRtcVideoChannel2Test, 1566 TEST_F(WebRtcVideoChannel2Test,
1523 ConferenceModeScreencastConfiguresTemporalLayer) { 1567 ConferenceModeScreencastConfiguresTemporalLayer) {
1524 static const int kConferenceScreencastTemporalBitrateBps = 1568 static const int kConferenceScreencastTemporalBitrateBps =
1525 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; 1569 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000;
1526 send_parameters_.conference_mode = true; 1570 send_parameters_.conference_mode = true;
1571 send_parameters_.options.is_screencast = rtc::Optional<bool>(true);
1527 channel_->SetSendParameters(send_parameters_); 1572 channel_->SetSendParameters(send_parameters_);
1528 1573
1529 AddSendStream(); 1574 AddSendStream();
1530 1575
1531 cricket::FakeVideoCapturer capturer; 1576 cricket::FakeVideoCapturer capturer(true);
1532 capturer.SetScreencast(true);
1533 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1577 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1534 cricket::VideoFormat capture_format_hd = 1578 cricket::VideoFormat capture_format_hd =
1535 capturer.GetSupportedFormats()->front(); 1579 capturer.GetSupportedFormats()->front();
1536 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); 1580 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd));
1537 1581
1538 EXPECT_TRUE(channel_->SetSend(true)); 1582 EXPECT_TRUE(channel_->SetSend(true));
1539 1583
1540 EXPECT_TRUE(capturer.CaptureFrame()); 1584 EXPECT_TRUE(capturer.CaptureFrame());
1541 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 1585 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
1542 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); 1586 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) { 1636 TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) {
1593 cricket::VideoSendParameters parameters; 1637 cricket::VideoSendParameters parameters;
1594 parameters.codecs.push_back(kVp8Codec720p); 1638 parameters.codecs.push_back(kVp8Codec720p);
1595 ASSERT_TRUE(channel_->SetSendParameters(parameters)); 1639 ASSERT_TRUE(channel_->SetSendParameters(parameters));
1596 1640
1597 // Single-stream settings should apply with RTX as well (verifies that we 1641 // Single-stream settings should apply with RTX as well (verifies that we
1598 // check number of regular SSRCs and not StreamParams::ssrcs which contains 1642 // check number of regular SSRCs and not StreamParams::ssrcs which contains
1599 // both RTX and regular SSRCs). 1643 // both RTX and regular SSRCs).
1600 FakeVideoSendStream* stream = SetUpSimulcast(false, true); 1644 FakeVideoSendStream* stream = SetUpSimulcast(false, true);
1601 1645
1602 cricket::FakeVideoCapturer capturer; 1646 cricket::FakeVideoCapturer capturer(false);
1603 capturer.SetScreencast(false);
1604 EXPECT_EQ(cricket::CS_RUNNING, 1647 EXPECT_EQ(cricket::CS_RUNNING,
1605 capturer.Start(capturer.GetSupportedFormats()->front())); 1648 capturer.Start(capturer.GetSupportedFormats()->front()));
1606 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1649 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1607 channel_->SetSend(true); 1650 channel_->SetSend(true);
1608 1651
1609 EXPECT_TRUE(capturer.CaptureFrame()); 1652 EXPECT_TRUE(capturer.CaptureFrame());
1610 1653
1611 webrtc::VideoCodecVP8 vp8_settings; 1654 webrtc::VideoCodecVP8 vp8_settings;
1612 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1655 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1613 EXPECT_TRUE(vp8_settings.denoisingOn) 1656 EXPECT_TRUE(vp8_settings.denoisingOn)
(...skipping 19 matching lines...) Expand all
1633 channel_->SetSend(true); 1676 channel_->SetSend(true);
1634 EXPECT_TRUE(capturer.CaptureFrame()); 1677 EXPECT_TRUE(capturer.CaptureFrame());
1635 1678
1636 EXPECT_EQ(3, stream->GetVideoStreams().size()); 1679 EXPECT_EQ(3, stream->GetVideoStreams().size());
1637 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1680 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1638 // Autmatic resize off when using simulcast. 1681 // Autmatic resize off when using simulcast.
1639 EXPECT_FALSE(vp8_settings.automaticResizeOn); 1682 EXPECT_FALSE(vp8_settings.automaticResizeOn);
1640 EXPECT_TRUE(vp8_settings.frameDroppingOn); 1683 EXPECT_TRUE(vp8_settings.frameDroppingOn);
1641 1684
1642 // In screen-share mode, denoising is forced off and simulcast disabled. 1685 // In screen-share mode, denoising is forced off and simulcast disabled.
1643 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); 1686 FakeVideoCapturer screencast_capturer(true);
1644 capturer.SetScreencast(true); 1687 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer));
1645 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1688 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start(
1646 EXPECT_TRUE(capturer.CaptureFrame()); 1689 screencast_capturer.GetSupportedFormats()->front()));
1647 stream = SetDenoisingOption(parameters, &capturer, false); 1690 parameters.options.is_screencast = rtc::Optional<bool>(true);
1691 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1692
1693 stream = SetDenoisingOption(parameters, &screencast_capturer, false);
1648 1694
1649 EXPECT_EQ(1, stream->GetVideoStreams().size()); 1695 EXPECT_EQ(1, stream->GetVideoStreams().size());
1650 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; 1696 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set.";
1651 EXPECT_FALSE(vp8_settings.denoisingOn); 1697 EXPECT_FALSE(vp8_settings.denoisingOn);
1652 // Resizing and frame dropping always off for screen sharing. 1698 // Resizing and frame dropping always off for screen sharing.
1653 EXPECT_FALSE(vp8_settings.automaticResizeOn); 1699 EXPECT_FALSE(vp8_settings.automaticResizeOn);
1654 EXPECT_FALSE(vp8_settings.frameDroppingOn); 1700 EXPECT_FALSE(vp8_settings.frameDroppingOn);
1655 1701
1656 stream = SetDenoisingOption(parameters, &capturer, true); 1702 stream = SetDenoisingOption(parameters, &capturer, true);
1657 1703
(...skipping 28 matching lines...) Expand all
1686 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_; 1732 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_;
1687 }; 1733 };
1688 1734
1689 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) { 1735 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) {
1690 cricket::VideoSendParameters parameters; 1736 cricket::VideoSendParameters parameters;
1691 parameters.codecs.push_back(kVp9Codec); 1737 parameters.codecs.push_back(kVp9Codec);
1692 ASSERT_TRUE(channel_->SetSendParameters(parameters)); 1738 ASSERT_TRUE(channel_->SetSendParameters(parameters));
1693 1739
1694 FakeVideoSendStream* stream = SetUpSimulcast(false, false); 1740 FakeVideoSendStream* stream = SetUpSimulcast(false, false);
1695 1741
1696 cricket::FakeVideoCapturer capturer; 1742 cricket::FakeVideoCapturer capturer(false);
1697 capturer.SetScreencast(false);
1698 EXPECT_EQ(cricket::CS_RUNNING, 1743 EXPECT_EQ(cricket::CS_RUNNING,
1699 capturer.Start(capturer.GetSupportedFormats()->front())); 1744 capturer.Start(capturer.GetSupportedFormats()->front()));
1700 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1745 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1701 channel_->SetSend(true); 1746 channel_->SetSend(true);
1702 1747
1703 EXPECT_TRUE(capturer.CaptureFrame()); 1748 EXPECT_TRUE(capturer.CaptureFrame());
1704 1749
1705 webrtc::VideoCodecVP9 vp9_settings; 1750 webrtc::VideoCodecVP9 vp9_settings;
1706 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1751 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1707 EXPECT_FALSE(vp9_settings.denoisingOn) 1752 EXPECT_FALSE(vp9_settings.denoisingOn)
1708 << "VP9 denoising should be off by default."; 1753 << "VP9 denoising should be off by default.";
1709 1754
1710 stream = SetDenoisingOption(parameters, &capturer, false); 1755 stream = SetDenoisingOption(parameters, &capturer, false);
1711 1756
1712 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1757 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1713 EXPECT_FALSE(vp9_settings.denoisingOn); 1758 EXPECT_FALSE(vp9_settings.denoisingOn);
1714 // Frame dropping always on for real time video. 1759 // Frame dropping always on for real time video.
1715 EXPECT_TRUE(vp9_settings.frameDroppingOn); 1760 EXPECT_TRUE(vp9_settings.frameDroppingOn);
1716 1761
1717 stream = SetDenoisingOption(parameters, &capturer, true); 1762 stream = SetDenoisingOption(parameters, &capturer, true);
1718 1763
1719 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1764 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1720 EXPECT_TRUE(vp9_settings.denoisingOn); 1765 EXPECT_TRUE(vp9_settings.denoisingOn);
1721 EXPECT_TRUE(vp9_settings.frameDroppingOn); 1766 EXPECT_TRUE(vp9_settings.frameDroppingOn);
1722 1767
1723 // In screen-share mode, denoising is forced off. 1768 // In screen-share mode, denoising is forced off.
1724 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); 1769 FakeVideoCapturer screencast_capturer(true);
1725 capturer.SetScreencast(true); 1770 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer));
1726 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1771 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start(
1772 screencast_capturer.GetSupportedFormats()->front()));
1773 parameters.options.is_screencast = rtc::Optional<bool>(true);
1774 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1727 1775
1728 EXPECT_TRUE(capturer.CaptureFrame()); 1776 stream = SetDenoisingOption(parameters, &screencast_capturer, false);
1729 stream = SetDenoisingOption(parameters, &capturer, false);
1730 1777
1731 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1778 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1732 EXPECT_FALSE(vp9_settings.denoisingOn); 1779 EXPECT_FALSE(vp9_settings.denoisingOn);
1733 // Frame dropping always off for screen sharing. 1780 // Frame dropping always off for screen sharing.
1734 EXPECT_FALSE(vp9_settings.frameDroppingOn); 1781 EXPECT_FALSE(vp9_settings.frameDroppingOn);
1735 1782
1736 stream = SetDenoisingOption(parameters, &capturer, false); 1783 stream = SetDenoisingOption(parameters, &capturer, false);
1737 1784
1738 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; 1785 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set.";
1739 EXPECT_FALSE(vp9_settings.denoisingOn); 1786 EXPECT_FALSE(vp9_settings.denoisingOn);
(...skipping 20 matching lines...) Expand all
1760 parameters.codecs.push_back(codec); 1807 parameters.codecs.push_back(codec);
1761 1808
1762 MediaConfig media_config = MediaConfig(); 1809 MediaConfig media_config = MediaConfig();
1763 channel_.reset( 1810 channel_.reset(
1764 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); 1811 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
1765 ASSERT_TRUE(channel_->SetSendParameters(parameters)); 1812 ASSERT_TRUE(channel_->SetSendParameters(parameters));
1766 1813
1767 AddSendStream(); 1814 AddSendStream();
1768 1815
1769 cricket::FakeVideoCapturer capturer; 1816 cricket::FakeVideoCapturer capturer;
1770 capturer.SetScreencast(false);
1771 ASSERT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1817 ASSERT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1772 ASSERT_EQ(cricket::CS_RUNNING, 1818 ASSERT_EQ(cricket::CS_RUNNING,
1773 capturer.Start(capturer.GetSupportedFormats()->front())); 1819 capturer.Start(capturer.GetSupportedFormats()->front()));
1774 ASSERT_TRUE(channel_->SetSend(true)); 1820 ASSERT_TRUE(channel_->SetSend(true));
1775 1821
1776 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 1822 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
1777 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); 1823 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
1778 webrtc::LoadObserver* overuse_callback = 1824 webrtc::LoadObserver* overuse_callback =
1779 send_stream->GetConfig().overuse_callback; 1825 send_stream->GetConfig().overuse_callback;
1780 ASSERT_TRUE(overuse_callback != NULL); 1826 ASSERT_TRUE(overuse_callback != NULL);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 if (!enable_overuse) { 1877 if (!enable_overuse) {
1832 media_config.video.enable_cpu_overuse_detection = false; 1878 media_config.video.enable_cpu_overuse_detection = false;
1833 } 1879 }
1834 channel_.reset( 1880 channel_.reset(
1835 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); 1881 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions()));
1836 1882
1837 EXPECT_TRUE(channel_->SetSendParameters(parameters)); 1883 EXPECT_TRUE(channel_->SetSendParameters(parameters));
1838 1884
1839 AddSendStream(); 1885 AddSendStream();
1840 1886
1841 cricket::FakeVideoCapturer capturer; 1887 cricket::FakeVideoCapturer capturer(is_screenshare);
1842 capturer.SetScreencast(is_screenshare);
1843 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); 1888 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer));
1844 EXPECT_EQ(cricket::CS_RUNNING, 1889 EXPECT_EQ(cricket::CS_RUNNING,
1845 capturer.Start(capturer.GetSupportedFormats()->front())); 1890 capturer.Start(capturer.GetSupportedFormats()->front()));
1846 1891
1847 EXPECT_TRUE(channel_->SetSend(true)); 1892 EXPECT_TRUE(channel_->SetSend(true));
1848 1893
1849 // Trigger overuse. 1894 // Trigger overuse.
1850 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); 1895 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size());
1851 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); 1896 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front();
1852 webrtc::LoadObserver* overuse_callback = 1897 webrtc::LoadObserver* overuse_callback =
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 // Test that we normalize send codec format size in simulcast. 3227 // Test that we normalize send codec format size in simulcast.
3183 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3228 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3184 cricket::VideoCodec codec(kVp8Codec270p); 3229 cricket::VideoCodec codec(kVp8Codec270p);
3185 codec.width += 1; 3230 codec.width += 1;
3186 codec.height += 1; 3231 codec.height += 1;
3187 VerifySimulcastSettings(codec, 2, 2); 3232 VerifySimulcastSettings(codec, 2, 2);
3188 } 3233 }
3189 } // namespace cricket 3234 } // namespace cricket
3190 3235
3191 #endif // HAVE_WEBRTC_VIDEO 3236 #endif // HAVE_WEBRTC_VIDEO
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698