| 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 EXPECT_EQ(expected_extension, | 1034 EXPECT_EQ(expected_extension, |
| 1035 send_stream->GetConfig().rtp.extensions[0].name); | 1035 send_stream->GetConfig().rtp.extensions[0].name); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); | 1038 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); |
| 1039 void TestReceiverLocalSsrcConfiguration(bool receiver_first); | 1039 void TestReceiverLocalSsrcConfiguration(bool receiver_first); |
| 1040 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, | 1040 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, |
| 1041 bool expect_created_receive_stream); | 1041 bool expect_created_receive_stream); |
| 1042 | 1042 |
| 1043 FakeVideoSendStream* SetDenoisingOption( | 1043 FakeVideoSendStream* SetDenoisingOption( |
| 1044 const cricket::VideoSendParameters& parameters, | 1044 uint32_t ssrc, |
| 1045 cricket::FakeVideoCapturer* capturer, | 1045 cricket::FakeVideoCapturer* capturer, |
| 1046 bool enabled) { | 1046 bool enabled) { |
| 1047 cricket::VideoSendParameters params = parameters; | 1047 cricket::VideoOptions options; |
| 1048 params.options.video_noise_reduction = rtc::Optional<bool>(enabled); | 1048 options.video_noise_reduction = rtc::Optional<bool>(enabled); |
| 1049 // TODO(nisse): Switch to using SetOptions? | 1049 channel_->SetVideoSend(ssrc, true, &options); |
| 1050 channel_->SetSendParameters(params); | |
| 1051 // Options only take effect on the next frame. | 1050 // Options only take effect on the next frame. |
| 1052 EXPECT_TRUE(capturer->CaptureFrame()); | 1051 EXPECT_TRUE(capturer->CaptureFrame()); |
| 1053 | 1052 |
| 1054 return fake_call_->GetVideoSendStreams().back(); | 1053 return fake_call_->GetVideoSendStreams().back(); |
| 1055 } | 1054 } |
| 1056 | 1055 |
| 1057 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { | 1056 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { |
| 1058 const int kRtxSsrcOffset = 0xDEADBEEF; | 1057 const int kRtxSsrcOffset = 0xDEADBEEF; |
| 1059 last_ssrc_ += 3; | 1058 last_ssrc_ += 3; |
| 1060 std::vector<uint32_t> ssrcs; | 1059 std::vector<uint32_t> ssrcs; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1481 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1483 send_stream = fake_call_->GetVideoSendStreams()[0]; | 1482 send_stream = fake_call_->GetVideoSendStreams()[0]; |
| 1484 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1483 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1485 } | 1484 } |
| 1486 | 1485 |
| 1487 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { | 1486 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { |
| 1488 static const int kScreenshareMinBitrateKbps = 800; | 1487 static const int kScreenshareMinBitrateKbps = 800; |
| 1489 cricket::VideoCodec codec = kVp8Codec360p; | 1488 cricket::VideoCodec codec = kVp8Codec360p; |
| 1490 cricket::VideoSendParameters parameters; | 1489 cricket::VideoSendParameters parameters; |
| 1491 parameters.codecs.push_back(codec); | 1490 parameters.codecs.push_back(codec); |
| 1492 parameters.options.screencast_min_bitrate_kbps = | 1491 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1492 AddSendStream(); |
| 1493 |
| 1494 VideoOptions mbr_options; |
| 1495 mbr_options.screencast_min_bitrate_kbps = |
| 1493 rtc::Optional<int>(kScreenshareMinBitrateKbps); | 1496 rtc::Optional<int>(kScreenshareMinBitrateKbps); |
| 1494 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1497 channel_->SetVideoSend(last_ssrc_, true, &mbr_options); |
| 1495 | |
| 1496 AddSendStream(); | |
| 1497 | 1498 |
| 1498 cricket::FakeVideoCapturer capturer; | 1499 cricket::FakeVideoCapturer capturer; |
| 1499 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1500 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1500 cricket::VideoFormat capture_format_hd = | 1501 cricket::VideoFormat capture_format_hd = |
| 1501 capturer.GetSupportedFormats()->front(); | 1502 capturer.GetSupportedFormats()->front(); |
| 1502 EXPECT_EQ(1280, capture_format_hd.width); | 1503 EXPECT_EQ(1280, capture_format_hd.width); |
| 1503 EXPECT_EQ(720, capture_format_hd.height); | 1504 EXPECT_EQ(720, capture_format_hd.height); |
| 1504 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1505 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| 1505 | 1506 |
| 1506 EXPECT_TRUE(channel_->SetSend(true)); | 1507 EXPECT_TRUE(channel_->SetSend(true)); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1517 encoder_config.content_type); | 1518 encoder_config.content_type); |
| 1518 EXPECT_EQ(codec.width, encoder_config.streams.front().width); | 1519 EXPECT_EQ(codec.width, encoder_config.streams.front().width); |
| 1519 EXPECT_EQ(codec.height, encoder_config.streams.front().height); | 1520 EXPECT_EQ(codec.height, encoder_config.streams.front().height); |
| 1520 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) | 1521 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) |
| 1521 << "Non-screenshare shouldn't use min-transmit bitrate."; | 1522 << "Non-screenshare shouldn't use min-transmit bitrate."; |
| 1522 | 1523 |
| 1523 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); | 1524 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, nullptr)); |
| 1524 // Removing a capturer triggers a black frame to be sent. | 1525 // Removing a capturer triggers a black frame to be sent. |
| 1525 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); | 1526 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); |
| 1526 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1527 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1527 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1528 VideoOptions screencast_options; |
| 1528 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1529 screencast_options.is_screencast = rtc::Optional<bool>(true); |
| 1530 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &screencast_options)); |
| 1529 EXPECT_TRUE(capturer.CaptureFrame()); | 1531 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1530 // Send stream not recreated after option change. | 1532 // Send stream not recreated after option change. |
| 1531 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); | 1533 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); |
| 1532 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); | 1534 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); |
| 1533 | 1535 |
| 1534 // Verify screencast settings. | 1536 // Verify screencast settings. |
| 1535 encoder_config = send_stream->GetEncoderConfig(); | 1537 encoder_config = send_stream->GetEncoderConfig(); |
| 1536 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1538 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
| 1537 encoder_config.content_type); | 1539 encoder_config.content_type); |
| 1538 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, | 1540 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 encoder_config.content_type); | 1596 encoder_config.content_type); |
| 1595 | 1597 |
| 1596 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); | 1598 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); |
| 1597 } | 1599 } |
| 1598 | 1600 |
| 1599 TEST_F(WebRtcVideoChannel2Test, | 1601 TEST_F(WebRtcVideoChannel2Test, |
| 1600 ConferenceModeScreencastConfiguresTemporalLayer) { | 1602 ConferenceModeScreencastConfiguresTemporalLayer) { |
| 1601 static const int kConferenceScreencastTemporalBitrateBps = | 1603 static const int kConferenceScreencastTemporalBitrateBps = |
| 1602 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; | 1604 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; |
| 1603 send_parameters_.conference_mode = true; | 1605 send_parameters_.conference_mode = true; |
| 1604 send_parameters_.options.is_screencast = rtc::Optional<bool>(true); | |
| 1605 channel_->SetSendParameters(send_parameters_); | 1606 channel_->SetSendParameters(send_parameters_); |
| 1606 | 1607 |
| 1607 AddSendStream(); | 1608 AddSendStream(); |
| 1608 | 1609 VideoOptions options; |
| 1610 options.is_screencast = rtc::Optional<bool>(true); |
| 1611 channel_->SetVideoSend(last_ssrc_, true, &options); |
| 1609 cricket::FakeVideoCapturer capturer; | 1612 cricket::FakeVideoCapturer capturer; |
| 1610 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1613 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1611 cricket::VideoFormat capture_format_hd = | 1614 cricket::VideoFormat capture_format_hd = |
| 1612 capturer.GetSupportedFormats()->front(); | 1615 capturer.GetSupportedFormats()->front(); |
| 1613 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1616 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| 1614 | 1617 |
| 1615 EXPECT_TRUE(channel_->SetSend(true)); | 1618 EXPECT_TRUE(channel_->SetSend(true)); |
| 1616 | 1619 |
| 1617 EXPECT_TRUE(capturer.CaptureFrame()); | 1620 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1618 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1621 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1682 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1685 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1683 channel_->SetSend(true); | 1686 channel_->SetSend(true); |
| 1684 | 1687 |
| 1685 EXPECT_TRUE(capturer.CaptureFrame()); | 1688 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1686 | 1689 |
| 1687 webrtc::VideoCodecVP8 vp8_settings; | 1690 webrtc::VideoCodecVP8 vp8_settings; |
| 1688 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1691 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1689 EXPECT_TRUE(vp8_settings.denoisingOn) | 1692 EXPECT_TRUE(vp8_settings.denoisingOn) |
| 1690 << "VP8 denoising should be on by default."; | 1693 << "VP8 denoising should be on by default."; |
| 1691 | 1694 |
| 1692 stream = SetDenoisingOption(parameters, &capturer, false); | 1695 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
| 1693 | 1696 |
| 1694 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1697 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1695 EXPECT_FALSE(vp8_settings.denoisingOn); | 1698 EXPECT_FALSE(vp8_settings.denoisingOn); |
| 1696 EXPECT_TRUE(vp8_settings.automaticResizeOn); | 1699 EXPECT_TRUE(vp8_settings.automaticResizeOn); |
| 1697 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1700 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
| 1698 | 1701 |
| 1699 stream = SetDenoisingOption(parameters, &capturer, true); | 1702 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
| 1700 | 1703 |
| 1701 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1704 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1702 EXPECT_TRUE(vp8_settings.denoisingOn); | 1705 EXPECT_TRUE(vp8_settings.denoisingOn); |
| 1703 EXPECT_TRUE(vp8_settings.automaticResizeOn); | 1706 EXPECT_TRUE(vp8_settings.automaticResizeOn); |
| 1704 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1707 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
| 1705 | 1708 |
| 1706 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1709 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1707 stream = SetUpSimulcast(true, false); | 1710 stream = SetUpSimulcast(true, false); |
| 1708 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1711 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1709 channel_->SetSend(true); | 1712 channel_->SetSend(true); |
| 1710 EXPECT_TRUE(capturer.CaptureFrame()); | 1713 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1711 | 1714 |
| 1712 EXPECT_EQ(3, stream->GetVideoStreams().size()); | 1715 EXPECT_EQ(3, stream->GetVideoStreams().size()); |
| 1713 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1716 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1714 // Autmatic resize off when using simulcast. | 1717 // Autmatic resize off when using simulcast. |
| 1715 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1718 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
| 1716 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1719 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
| 1717 | 1720 |
| 1718 // In screen-share mode, denoising is forced off and simulcast disabled. | 1721 // In screen-share mode, denoising is forced off and simulcast disabled. |
| 1719 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1722 VideoOptions options; |
| 1720 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1723 options.is_screencast = rtc::Optional<bool>(true); |
| 1724 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
| 1721 | 1725 |
| 1722 stream = SetDenoisingOption(parameters, &capturer, false); | 1726 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
| 1723 | 1727 |
| 1724 EXPECT_EQ(1, stream->GetVideoStreams().size()); | 1728 EXPECT_EQ(1, stream->GetVideoStreams().size()); |
| 1725 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1729 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1726 EXPECT_FALSE(vp8_settings.denoisingOn); | 1730 EXPECT_FALSE(vp8_settings.denoisingOn); |
| 1727 // Resizing and frame dropping always off for screen sharing. | 1731 // Resizing and frame dropping always off for screen sharing. |
| 1728 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1732 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
| 1729 EXPECT_FALSE(vp8_settings.frameDroppingOn); | 1733 EXPECT_FALSE(vp8_settings.frameDroppingOn); |
| 1730 | 1734 |
| 1731 stream = SetDenoisingOption(parameters, &capturer, true); | 1735 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
| 1732 | 1736 |
| 1733 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1737 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1734 EXPECT_FALSE(vp8_settings.denoisingOn); | 1738 EXPECT_FALSE(vp8_settings.denoisingOn); |
| 1735 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1739 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
| 1736 EXPECT_FALSE(vp8_settings.frameDroppingOn); | 1740 EXPECT_FALSE(vp8_settings.frameDroppingOn); |
| 1737 | 1741 |
| 1738 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1742 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1739 } | 1743 } |
| 1740 | 1744 |
| 1741 class Vp9SettingsTest : public WebRtcVideoChannel2Test { | 1745 class Vp9SettingsTest : public WebRtcVideoChannel2Test { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1778 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1775 channel_->SetSend(true); | 1779 channel_->SetSend(true); |
| 1776 | 1780 |
| 1777 EXPECT_TRUE(capturer.CaptureFrame()); | 1781 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1778 | 1782 |
| 1779 webrtc::VideoCodecVP9 vp9_settings; | 1783 webrtc::VideoCodecVP9 vp9_settings; |
| 1780 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1784 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1781 EXPECT_FALSE(vp9_settings.denoisingOn) | 1785 EXPECT_FALSE(vp9_settings.denoisingOn) |
| 1782 << "VP9 denoising should be off by default."; | 1786 << "VP9 denoising should be off by default."; |
| 1783 | 1787 |
| 1784 stream = SetDenoisingOption(parameters, &capturer, false); | 1788 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
| 1785 | 1789 |
| 1786 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1790 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1787 EXPECT_FALSE(vp9_settings.denoisingOn); | 1791 EXPECT_FALSE(vp9_settings.denoisingOn); |
| 1788 // Frame dropping always on for real time video. | 1792 // Frame dropping always on for real time video. |
| 1789 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1793 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
| 1790 | 1794 |
| 1791 stream = SetDenoisingOption(parameters, &capturer, true); | 1795 stream = SetDenoisingOption(last_ssrc_, &capturer, true); |
| 1792 | 1796 |
| 1793 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1797 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1794 EXPECT_TRUE(vp9_settings.denoisingOn); | 1798 EXPECT_TRUE(vp9_settings.denoisingOn); |
| 1795 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1799 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
| 1796 | 1800 |
| 1797 // In screen-share mode, denoising is forced off. | 1801 // In screen-share mode, denoising is forced off. |
| 1798 parameters.options.is_screencast = rtc::Optional<bool>(true); | 1802 VideoOptions options; |
| 1799 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1803 options.is_screencast = rtc::Optional<bool>(true); |
| 1804 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
| 1800 | 1805 |
| 1801 stream = SetDenoisingOption(parameters, &capturer, false); | 1806 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
| 1802 | 1807 |
| 1803 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1808 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1804 EXPECT_FALSE(vp9_settings.denoisingOn); | 1809 EXPECT_FALSE(vp9_settings.denoisingOn); |
| 1805 // Frame dropping always off for screen sharing. | 1810 // Frame dropping always off for screen sharing. |
| 1806 EXPECT_FALSE(vp9_settings.frameDroppingOn); | 1811 EXPECT_FALSE(vp9_settings.frameDroppingOn); |
| 1807 | 1812 |
| 1808 stream = SetDenoisingOption(parameters, &capturer, false); | 1813 stream = SetDenoisingOption(last_ssrc_, &capturer, false); |
| 1809 | 1814 |
| 1810 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1815 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1811 EXPECT_FALSE(vp9_settings.denoisingOn); | 1816 EXPECT_FALSE(vp9_settings.denoisingOn); |
| 1812 EXPECT_FALSE(vp9_settings.frameDroppingOn); | 1817 EXPECT_FALSE(vp9_settings.frameDroppingOn); |
| 1813 | 1818 |
| 1814 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1819 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1815 } | 1820 } |
| 1816 | 1821 |
| 1817 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { | 1822 TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { |
| 1818 TestCpuAdaptation(true, false); | 1823 TestCpuAdaptation(true, false); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 cricket::VideoSendParameters parameters; | 1903 cricket::VideoSendParameters parameters; |
| 1899 parameters.codecs.push_back(codec); | 1904 parameters.codecs.push_back(codec); |
| 1900 | 1905 |
| 1901 MediaConfig media_config = MediaConfig(); | 1906 MediaConfig media_config = MediaConfig(); |
| 1902 if (!enable_overuse) { | 1907 if (!enable_overuse) { |
| 1903 media_config.video.enable_cpu_overuse_detection = false; | 1908 media_config.video.enable_cpu_overuse_detection = false; |
| 1904 } | 1909 } |
| 1905 channel_.reset( | 1910 channel_.reset( |
| 1906 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); | 1911 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); |
| 1907 | 1912 |
| 1908 parameters.options.is_screencast = rtc::Optional<bool>(is_screenshare); | |
| 1909 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1913 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1910 | 1914 |
| 1911 AddSendStream(); | 1915 AddSendStream(); |
| 1912 | 1916 |
| 1917 VideoOptions options; |
| 1918 options.is_screencast = rtc::Optional<bool>(is_screenshare); |
| 1919 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, &options)); |
| 1920 |
| 1913 cricket::FakeVideoCapturer capturer; | 1921 cricket::FakeVideoCapturer capturer; |
| 1914 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1922 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1915 EXPECT_EQ(cricket::CS_RUNNING, | 1923 EXPECT_EQ(cricket::CS_RUNNING, |
| 1916 capturer.Start(capturer.GetSupportedFormats()->front())); | 1924 capturer.Start(capturer.GetSupportedFormats()->front())); |
| 1917 | 1925 |
| 1918 EXPECT_TRUE(channel_->SetSend(true)); | 1926 EXPECT_TRUE(channel_->SetSend(true)); |
| 1919 | 1927 |
| 1920 // Trigger overuse. | 1928 // Trigger overuse. |
| 1921 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1929 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| 1922 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1930 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 } | 3259 } |
| 3252 | 3260 |
| 3253 // Test that we normalize send codec format size in simulcast. | 3261 // Test that we normalize send codec format size in simulcast. |
| 3254 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3262 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3255 cricket::VideoCodec codec(kVp8Codec270p); | 3263 cricket::VideoCodec codec(kVp8Codec270p); |
| 3256 codec.width += 1; | 3264 codec.width += 1; |
| 3257 codec.height += 1; | 3265 codec.height += 1; |
| 3258 VerifySimulcastSettings(codec, 2, 2); | 3266 VerifySimulcastSettings(codec, 2, 2); |
| 3259 } | 3267 } |
| 3260 } // namespace cricket | 3268 } // namespace cricket |
| 3261 | |
| OLD | NEW |