OLD | NEW |
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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 EXPECT_EQ(expected_extension, | 1041 EXPECT_EQ(expected_extension, |
1042 send_stream->GetConfig().rtp.extensions[0].name); | 1042 send_stream->GetConfig().rtp.extensions[0].name); |
1043 } | 1043 } |
1044 | 1044 |
1045 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); | 1045 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); |
1046 void TestReceiverLocalSsrcConfiguration(bool receiver_first); | 1046 void TestReceiverLocalSsrcConfiguration(bool receiver_first); |
1047 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, | 1047 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, |
1048 bool expect_created_receive_stream); | 1048 bool expect_created_receive_stream); |
1049 | 1049 |
1050 FakeVideoSendStream* SetDenoisingOption( | 1050 FakeVideoSendStream* SetDenoisingOption( |
1051 const cricket::VideoSendParameters& parameters, | 1051 uint32_t ssrc, |
1052 cricket::FakeVideoCapturer* capturer, | 1052 cricket::FakeVideoCapturer* capturer, |
1053 bool enabled) { | 1053 bool enabled) { |
1054 cricket::VideoSendParameters params = parameters; | 1054 cricket::VideoOptions options; |
1055 params.options.video_noise_reduction = rtc::Optional<bool>(enabled); | 1055 options.video_noise_reduction = rtc::Optional<bool>(enabled); |
1056 // TODO(nisse): Switch to using SetOptions? | 1056 channel_->SetVideoSend(ssrc, true, &options); |
1057 channel_->SetSendParameters(params); | |
1058 // Options only take effect on the next frame. | 1057 // Options only take effect on the next frame. |
1059 EXPECT_TRUE(capturer->CaptureFrame()); | 1058 EXPECT_TRUE(capturer->CaptureFrame()); |
1060 | 1059 |
1061 return fake_call_->GetVideoSendStreams().back(); | 1060 return fake_call_->GetVideoSendStreams().back(); |
1062 } | 1061 } |
1063 | 1062 |
1064 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { | 1063 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { |
1065 const int kRtxSsrcOffset = 0xDEADBEEF; | 1064 const int kRtxSsrcOffset = 0xDEADBEEF; |
1066 last_ssrc_ += 3; | 1065 last_ssrc_ += 3; |
1067 std::vector<uint32_t> ssrcs; | 1066 std::vector<uint32_t> ssrcs; |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 EXPECT_EQ(0, stream->GetNumberOfSwappedFrames()); | 1522 EXPECT_EQ(0, stream->GetNumberOfSwappedFrames()); |
1524 | 1523 |
1525 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1524 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
1526 } | 1525 } |
1527 | 1526 |
1528 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { | 1527 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { |
1529 static const int kScreenshareMinBitrateKbps = 800; | 1528 static const int kScreenshareMinBitrateKbps = 800; |
1530 cricket::VideoCodec codec = kVp8Codec360p; | 1529 cricket::VideoCodec codec = kVp8Codec360p; |
1531 cricket::VideoSendParameters parameters; | 1530 cricket::VideoSendParameters parameters; |
1532 parameters.codecs.push_back(codec); | 1531 parameters.codecs.push_back(codec); |
1533 parameters.options.screencast_min_bitrate_kbps = | 1532 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1533 AddSendStream(); |
| 1534 |
| 1535 VideoOptions min_bitrate_options; |
| 1536 min_bitrate_options.screencast_min_bitrate_kbps = |
1534 rtc::Optional<int>(kScreenshareMinBitrateKbps); | 1537 rtc::Optional<int>(kScreenshareMinBitrateKbps); |
1535 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1538 channel_->SetVideoSend(last_ssrc_, true, &min_bitrate_options); |
1536 | |
1537 AddSendStream(); | |
1538 | 1539 |
1539 cricket::FakeVideoCapturer capturer; | 1540 cricket::FakeVideoCapturer capturer; |
1540 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1541 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1541 cricket::VideoFormat capture_format_hd = | 1542 cricket::VideoFormat capture_format_hd = |
1542 capturer.GetSupportedFormats()->front(); | 1543 capturer.GetSupportedFormats()->front(); |
1543 EXPECT_EQ(1280, capture_format_hd.width); | 1544 EXPECT_EQ(1280, capture_format_hd.width); |
1544 EXPECT_EQ(720, capture_format_hd.height); | 1545 EXPECT_EQ(720, capture_format_hd.height); |
1545 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1546 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
1546 | 1547 |
1547 EXPECT_TRUE(channel_->SetSend(true)); | 1548 EXPECT_TRUE(channel_->SetSend(true)); |
(...skipping 10 matching lines...) Expand all Loading... |
1558 encoder_config.content_type); | 1559 encoder_config.content_type); |
1559 EXPECT_EQ(codec.width, encoder_config.streams.front().width); | 1560 EXPECT_EQ(codec.width, encoder_config.streams.front().width); |
1560 EXPECT_EQ(codec.height, encoder_config.streams.front().height); | 1561 EXPECT_EQ(codec.height, encoder_config.streams.front().height); |
1561 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) | 1562 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) |
1562 << "Non-screenshare shouldn't use min-transmit bitrate."; | 1563 << "Non-screenshare shouldn't use min-transmit bitrate."; |
1563 | 1564 |
1564 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); | 1565 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); |
1565 // Removing a capturer triggers a black frame to be sent. | 1566 // Removing a capturer triggers a black frame to be sent. |
1566 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); | 1567 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); |
1567 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1568 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1568 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1569 VideoOptions screencast_options; |
1569 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1570 screencast_options.is_screencast = rtc::Optional<bool>(true); |
| 1571 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &screencast_options)); |
1570 EXPECT_TRUE(capturer.CaptureFrame()); | 1572 EXPECT_TRUE(capturer.CaptureFrame()); |
1571 // Send stream not recreated after option change. | 1573 // Send stream not recreated after option change. |
1572 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); | 1574 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); |
1573 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); | 1575 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); |
1574 | 1576 |
1575 // Verify screencast settings. | 1577 // Verify screencast settings. |
1576 encoder_config = send_stream->GetEncoderConfig(); | 1578 encoder_config = send_stream->GetEncoderConfig(); |
1577 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1579 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
1578 encoder_config.content_type); | 1580 encoder_config.content_type); |
1579 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, | 1581 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 encoder_config.content_type); | 1637 encoder_config.content_type); |
1636 | 1638 |
1637 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); | 1639 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); |
1638 } | 1640 } |
1639 | 1641 |
1640 TEST_F(WebRtcVideoChannel2Test, | 1642 TEST_F(WebRtcVideoChannel2Test, |
1641 ConferenceModeScreencastConfiguresTemporalLayer) { | 1643 ConferenceModeScreencastConfiguresTemporalLayer) { |
1642 static const int kConferenceScreencastTemporalBitrateBps = | 1644 static const int kConferenceScreencastTemporalBitrateBps = |
1643 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; | 1645 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; |
1644 send_parameters_.conference_mode = true; | 1646 send_parameters_.conference_mode = true; |
1645 send_parameters_.options.is_screencast = rtc::Optional<bool>(true); | |
1646 channel_->SetSendParameters(send_parameters_); | 1647 channel_->SetSendParameters(send_parameters_); |
1647 | 1648 |
1648 AddSendStream(); | 1649 AddSendStream(); |
1649 | 1650 VideoOptions options; |
| 1651 options.is_screencast = rtc::Optional<bool>(true); |
| 1652 channel_->SetVideoSend(last_ssrc_, true, &options); |
1650 cricket::FakeVideoCapturer capturer; | 1653 cricket::FakeVideoCapturer capturer; |
1651 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1654 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1652 cricket::VideoFormat capture_format_hd = | 1655 cricket::VideoFormat capture_format_hd = |
1653 capturer.GetSupportedFormats()->front(); | 1656 capturer.GetSupportedFormats()->front(); |
1654 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1657 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
1655 | 1658 |
1656 EXPECT_TRUE(channel_->SetSend(true)); | 1659 EXPECT_TRUE(channel_->SetSend(true)); |
1657 | 1660 |
1658 EXPECT_TRUE(capturer.CaptureFrame()); | 1661 EXPECT_TRUE(capturer.CaptureFrame()); |
1659 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1662 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1726 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1724 channel_->SetSend(true); | 1727 channel_->SetSend(true); |
1725 | 1728 |
1726 EXPECT_TRUE(capturer.CaptureFrame()); | 1729 EXPECT_TRUE(capturer.CaptureFrame()); |
1727 | 1730 |
1728 webrtc::VideoCodecVP8 vp8_settings; | 1731 webrtc::VideoCodecVP8 vp8_settings; |
1729 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1732 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1730 EXPECT_TRUE(vp8_settings.denoisingOn) | 1733 EXPECT_TRUE(vp8_settings.denoisingOn) |
1731 << "VP8 denoising should be on by default."; | 1734 << "VP8 denoising should be on by default."; |
1732 | 1735 |
1733 stream = SetDenoisingOption(parameters, &capturer, false); | 1736 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
1734 | 1737 |
1735 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1738 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1736 EXPECT_FALSE(vp8_settings.denoisingOn); | 1739 EXPECT_FALSE(vp8_settings.denoisingOn); |
1737 EXPECT_TRUE(vp8_settings.automaticResizeOn); | 1740 EXPECT_TRUE(vp8_settings.automaticResizeOn); |
1738 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1741 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
1739 | 1742 |
1740 stream = SetDenoisingOption(parameters, &capturer, true); | 1743 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
1741 | 1744 |
1742 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1745 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1743 EXPECT_TRUE(vp8_settings.denoisingOn); | 1746 EXPECT_TRUE(vp8_settings.denoisingOn); |
1744 EXPECT_TRUE(vp8_settings.automaticResizeOn); | 1747 EXPECT_TRUE(vp8_settings.automaticResizeOn); |
1745 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1748 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
1746 | 1749 |
1747 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1750 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
1748 stream = SetUpSimulcast(true, false); | 1751 stream = SetUpSimulcast(true, false); |
1749 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1752 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1750 channel_->SetSend(true); | 1753 channel_->SetSend(true); |
1751 EXPECT_TRUE(capturer.CaptureFrame()); | 1754 EXPECT_TRUE(capturer.CaptureFrame()); |
1752 | 1755 |
1753 EXPECT_EQ(3, stream->GetVideoStreams().size()); | 1756 EXPECT_EQ(3, stream->GetVideoStreams().size()); |
1754 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1757 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1755 // Autmatic resize off when using simulcast. | 1758 // Autmatic resize off when using simulcast. |
1756 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1759 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
1757 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1760 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
1758 | 1761 |
1759 // In screen-share mode, denoising is forced off and simulcast disabled. | 1762 // In screen-share mode, denoising is forced off and simulcast disabled. |
1760 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1763 VideoOptions options; |
1761 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1764 options.is_screencast = rtc::Optional<bool>(true); |
| 1765 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
1762 | 1766 |
1763 stream = SetDenoisingOption(parameters, &capturer, false); | 1767 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
1764 | 1768 |
1765 EXPECT_EQ(1, stream->GetVideoStreams().size()); | 1769 EXPECT_EQ(1, stream->GetVideoStreams().size()); |
1766 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1770 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1767 EXPECT_FALSE(vp8_settings.denoisingOn); | 1771 EXPECT_FALSE(vp8_settings.denoisingOn); |
1768 // Resizing and frame dropping always off for screen sharing. | 1772 // Resizing and frame dropping always off for screen sharing. |
1769 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1773 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
1770 EXPECT_FALSE(vp8_settings.frameDroppingOn); | 1774 EXPECT_FALSE(vp8_settings.frameDroppingOn); |
1771 | 1775 |
1772 stream = SetDenoisingOption(parameters, &capturer, true); | 1776 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
1773 | 1777 |
1774 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1778 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
1775 EXPECT_FALSE(vp8_settings.denoisingOn); | 1779 EXPECT_FALSE(vp8_settings.denoisingOn); |
1776 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1780 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
1777 EXPECT_FALSE(vp8_settings.frameDroppingOn); | 1781 EXPECT_FALSE(vp8_settings.frameDroppingOn); |
1778 | 1782 |
1779 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1783 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
1780 } | 1784 } |
1781 | 1785 |
1782 class Vp9SettingsTest : public WebRtcVideoChannel2Test { | 1786 class Vp9SettingsTest : public WebRtcVideoChannel2Test { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1819 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1816 channel_->SetSend(true); | 1820 channel_->SetSend(true); |
1817 | 1821 |
1818 EXPECT_TRUE(capturer.CaptureFrame()); | 1822 EXPECT_TRUE(capturer.CaptureFrame()); |
1819 | 1823 |
1820 webrtc::VideoCodecVP9 vp9_settings; | 1824 webrtc::VideoCodecVP9 vp9_settings; |
1821 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1825 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
1822 EXPECT_FALSE(vp9_settings.denoisingOn) | 1826 EXPECT_FALSE(vp9_settings.denoisingOn) |
1823 << "VP9 denoising should be off by default."; | 1827 << "VP9 denoising should be off by default."; |
1824 | 1828 |
1825 stream = SetDenoisingOption(parameters, &capturer, false); | 1829 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
1826 | 1830 |
1827 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1831 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
1828 EXPECT_FALSE(vp9_settings.denoisingOn); | 1832 EXPECT_FALSE(vp9_settings.denoisingOn); |
1829 // Frame dropping always on for real time video. | 1833 // Frame dropping always on for real time video. |
1830 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1834 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
1831 | 1835 |
1832 stream = SetDenoisingOption(parameters, &capturer, true); | 1836 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
1833 | 1837 |
1834 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1838 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
1835 EXPECT_TRUE(vp9_settings.denoisingOn); | 1839 EXPECT_TRUE(vp9_settings.denoisingOn); |
1836 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1840 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
1837 | 1841 |
1838 // In screen-share mode, denoising is forced off. | 1842 // In screen-share mode, denoising is forced off. |
1839 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1843 VideoOptions options; |
1840 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1844 options.is_screencast = rtc::Optional<bool>(true); |
| 1845 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
1841 | 1846 |
1842 stream = SetDenoisingOption(parameters, &capturer, false); | 1847 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
1843 | 1848 |
1844 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1849 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
1845 EXPECT_FALSE(vp9_settings.denoisingOn); | 1850 EXPECT_FALSE(vp9_settings.denoisingOn); |
1846 // Frame dropping always off for screen sharing. | 1851 // Frame dropping always off for screen sharing. |
1847 EXPECT_FALSE(vp9_settings.frameDroppingOn); | 1852 EXPECT_FALSE(vp9_settings.frameDroppingOn); |
1848 | 1853 |
1849 stream = SetDenoisingOption(parameters, &capturer, false); | 1854 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
1850 | 1855 |
1851 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1856 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
1852 EXPECT_FALSE(vp9_settings.denoisingOn); | 1857 EXPECT_FALSE(vp9_settings.denoisingOn); |
1853 EXPECT_FALSE(vp9_settings.frameDroppingOn); | 1858 EXPECT_FALSE(vp9_settings.frameDroppingOn); |
1854 | 1859 |
1855 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1860 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
1856 } | 1861 } |
1857 | 1862 |
1858 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { | 1863 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { |
1859 TestCpuAdaptation(true, false); | 1864 TestCpuAdaptation(true, false); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1939 cricket::VideoSendParameters parameters; | 1944 cricket::VideoSendParameters parameters; |
1940 parameters.codecs.push_back(codec); | 1945 parameters.codecs.push_back(codec); |
1941 | 1946 |
1942 MediaConfig media_config = MediaConfig(); | 1947 MediaConfig media_config = MediaConfig(); |
1943 if (!enable_overuse) { | 1948 if (!enable_overuse) { |
1944 media_config.video.enable_cpu_overuse_detection = false; | 1949 media_config.video.enable_cpu_overuse_detection = false; |
1945 } | 1950 } |
1946 channel_.reset( | 1951 channel_.reset( |
1947 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); | 1952 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); |
1948 | 1953 |
1949 parameters.options.is_screencast = rtc::Optional<bool>(is_screenshare); | |
1950 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1954 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
1951 | 1955 |
1952 AddSendStream(); | 1956 AddSendStream(); |
1953 | 1957 |
| 1958 VideoOptions options; |
| 1959 options.is_screencast = rtc::Optional<bool>(is_screenshare); |
| 1960 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
| 1961 |
1954 cricket::FakeVideoCapturer capturer; | 1962 cricket::FakeVideoCapturer capturer; |
1955 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1963 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
1956 EXPECT_EQ(cricket::CS_RUNNING, | 1964 EXPECT_EQ(cricket::CS_RUNNING, |
1957 capturer.Start(capturer.GetSupportedFormats()->front())); | 1965 capturer.Start(capturer.GetSupportedFormats()->front())); |
1958 | 1966 |
1959 EXPECT_TRUE(channel_->SetSend(true)); | 1967 EXPECT_TRUE(channel_->SetSend(true)); |
1960 | 1968 |
1961 // Trigger overuse. | 1969 // Trigger overuse. |
1962 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1970 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
1963 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1971 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3292 } | 3300 } |
3293 | 3301 |
3294 // Test that we normalize send codec format size in simulcast. | 3302 // Test that we normalize send codec format size in simulcast. |
3295 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3303 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
3296 cricket::VideoCodec codec(kVp8Codec270p); | 3304 cricket::VideoCodec codec(kVp8Codec270p); |
3297 codec.width += 1; | 3305 codec.width += 1; |
3298 codec.height += 1; | 3306 codec.height += 1; |
3299 VerifySimulcastSettings(codec, 2, 2); | 3307 VerifySimulcastSettings(codec, 2, 2); |
3300 } | 3308 } |
3301 } // namespace cricket | 3309 } // namespace cricket |
3302 | |
OLD | NEW |