| 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 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 cricket::VideoCodec codec = kVp8Codec360p; | 1458 cricket::VideoCodec codec = kVp8Codec360p; |
| 1459 cricket::VideoSendParameters parameters; | 1459 cricket::VideoSendParameters parameters; |
| 1460 parameters.codecs.push_back(codec); | 1460 parameters.codecs.push_back(codec); |
| 1461 parameters.options.screencast_min_bitrate_kbps = | 1461 parameters.options.screencast_min_bitrate_kbps = |
| 1462 rtc::Optional<int>(kScreenshareMinBitrateKbps); | 1462 rtc::Optional<int>(kScreenshareMinBitrateKbps); |
| 1463 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1463 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1464 | 1464 |
| 1465 AddSendStream(); | 1465 AddSendStream(); |
| 1466 | 1466 |
| 1467 cricket::FakeVideoCapturer capturer; | 1467 cricket::FakeVideoCapturer capturer; |
| 1468 capturer.SetScreencast(false); | |
| 1469 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1468 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1470 cricket::VideoFormat capture_format_hd = | 1469 cricket::VideoFormat capture_format_hd = |
| 1471 capturer.GetSupportedFormats()->front(); | 1470 capturer.GetSupportedFormats()->front(); |
| 1472 EXPECT_EQ(1280, capture_format_hd.width); | 1471 EXPECT_EQ(1280, capture_format_hd.width); |
| 1473 EXPECT_EQ(720, capture_format_hd.height); | 1472 EXPECT_EQ(720, capture_format_hd.height); |
| 1474 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1473 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| 1475 | 1474 |
| 1476 EXPECT_TRUE(channel_->SetSend(true)); | 1475 EXPECT_TRUE(channel_->SetSend(true)); |
| 1477 | 1476 |
| 1478 EXPECT_TRUE(capturer.CaptureFrame()); | 1477 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1479 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1478 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| 1480 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1479 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
| 1481 | 1480 |
| 1482 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); | 1481 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); |
| 1483 | 1482 |
| 1484 // Verify non-screencast settings. | 1483 // Verify non-screencast settings. |
| 1485 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig(); | 1484 webrtc::VideoEncoderConfig encoder_config = send_stream->GetEncoderConfig(); |
| 1486 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, | 1485 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
| 1487 encoder_config.content_type); | 1486 encoder_config.content_type); |
| 1488 EXPECT_EQ(codec.width, encoder_config.streams.front().width); | 1487 EXPECT_EQ(codec.width, encoder_config.streams.front().width); |
| 1489 EXPECT_EQ(codec.height, encoder_config.streams.front().height); | 1488 EXPECT_EQ(codec.height, encoder_config.streams.front().height); |
| 1490 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) | 1489 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) |
| 1491 << "Non-screenshare shouldn't use min-transmit bitrate."; | 1490 << "Non-screenshare shouldn't use min-transmit bitrate."; |
| 1492 | 1491 |
| 1493 capturer.SetScreencast(true); | 1492 FakeVideoCapturer screencast_capturer(true); |
| 1494 EXPECT_TRUE(capturer.CaptureFrame()); | 1493 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer)); |
| 1494 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start(capture_format_hd)); |
| 1495 parameters.options.is_screencast = rtc::Optional<bool>(true); |
| 1496 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1495 | 1497 |
| 1496 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); | 1498 // Send stream recreated after parameter change. |
| 1499 send_stream = fake_call_->GetVideoSendStreams().front(); |
| 1500 EXPECT_EQ(0, send_stream->GetNumberOfSwappedFrames()); |
| 1501 |
| 1502 EXPECT_TRUE(screencast_capturer.CaptureFrame()); |
| 1503 |
| 1504 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); |
| 1497 | 1505 |
| 1498 // Verify screencast settings. | 1506 // Verify screencast settings. |
| 1499 encoder_config = send_stream->GetEncoderConfig(); | 1507 encoder_config = send_stream->GetEncoderConfig(); |
| 1500 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1508 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
| 1501 encoder_config.content_type); | 1509 encoder_config.content_type); |
| 1502 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, | 1510 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, |
| 1503 encoder_config.min_transmit_bitrate_bps); | 1511 encoder_config.min_transmit_bitrate_bps); |
| 1504 | 1512 |
| 1505 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width); | 1513 EXPECT_EQ(capture_format_hd.width, encoder_config.streams.front().width); |
| 1506 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); | 1514 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); |
| 1507 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); | 1515 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); |
| 1508 | 1516 |
| 1509 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1517 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1510 } | 1518 } |
| 1511 | 1519 |
| 1520 TEST_F(WebRtcVideoChannel2Test, NoRecreateStreamForScreencast) { |
| 1521 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); |
| 1522 ASSERT_TRUE( |
| 1523 channel_->AddSendStream(cricket::StreamParams::CreateLegacy(kSsrc))); |
| 1524 EXPECT_TRUE(channel_->SetSend(true)); |
| 1525 |
| 1526 cricket::FakeVideoCapturer capturer; |
| 1527 EXPECT_TRUE(channel_->SetCapturer(kSsrc, &capturer)); |
| 1528 EXPECT_EQ(cricket::CS_RUNNING, |
| 1529 capturer.Start(capturer.GetSupportedFormats()->front())); |
| 1530 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1531 |
| 1532 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); |
| 1533 FakeVideoSendStream* stream1 = fake_call_->GetVideoSendStreams().front(); |
| 1534 webrtc::VideoEncoderConfig encoder_config = stream1->GetEncoderConfig(); |
| 1535 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
| 1536 encoder_config.content_type); |
| 1537 |
| 1538 EXPECT_EQ(1, stream1->GetNumberOfSwappedFrames()); |
| 1539 |
| 1540 /* Switch to screencast source. We expect a reconfigure of the |
| 1541 * encoder, but no change of the send stream. */ |
| 1542 struct VideoOptions video_options; |
| 1543 video_options.is_screencast = rtc::Optional<bool>(true); |
| 1544 channel_->SetVideoSend(kSsrc, true, &video_options); |
| 1545 |
| 1546 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1547 ASSERT_EQ(1, fake_call_->GetNumCreatedSendStreams()); |
| 1548 FakeVideoSendStream* stream2 = fake_call_->GetVideoSendStreams().front(); |
| 1549 EXPECT_EQ(stream1, stream2); |
| 1550 EXPECT_EQ(2, stream2->GetNumberOfSwappedFrames()); |
| 1551 |
| 1552 encoder_config = stream2->GetEncoderConfig(); |
| 1553 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
| 1554 encoder_config.content_type); |
| 1555 |
| 1556 EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); |
| 1557 } |
| 1558 |
| 1512 TEST_F(WebRtcVideoChannel2Test, | 1559 TEST_F(WebRtcVideoChannel2Test, |
| 1513 ConferenceModeScreencastConfiguresTemporalLayer) { | 1560 ConferenceModeScreencastConfiguresTemporalLayer) { |
| 1514 static const int kConferenceScreencastTemporalBitrateBps = | 1561 static const int kConferenceScreencastTemporalBitrateBps = |
| 1515 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; | 1562 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; |
| 1516 send_parameters_.conference_mode = true; | 1563 send_parameters_.conference_mode = true; |
| 1564 send_parameters_.options.is_screencast = rtc::Optional<bool>(true); |
| 1517 channel_->SetSendParameters(send_parameters_); | 1565 channel_->SetSendParameters(send_parameters_); |
| 1518 | 1566 |
| 1519 AddSendStream(); | 1567 AddSendStream(); |
| 1520 | 1568 |
| 1521 cricket::FakeVideoCapturer capturer; | 1569 cricket::FakeVideoCapturer capturer(true); |
| 1522 capturer.SetScreencast(true); | |
| 1523 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1570 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1524 cricket::VideoFormat capture_format_hd = | 1571 cricket::VideoFormat capture_format_hd = |
| 1525 capturer.GetSupportedFormats()->front(); | 1572 capturer.GetSupportedFormats()->front(); |
| 1526 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1573 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| 1527 | 1574 |
| 1528 EXPECT_TRUE(channel_->SetSend(true)); | 1575 EXPECT_TRUE(channel_->SetSend(true)); |
| 1529 | 1576 |
| 1530 EXPECT_TRUE(capturer.CaptureFrame()); | 1577 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1531 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1578 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| 1532 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1579 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) { | 1623 TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) { |
| 1577 cricket::VideoSendParameters parameters; | 1624 cricket::VideoSendParameters parameters; |
| 1578 parameters.codecs.push_back(kVp8Codec720p); | 1625 parameters.codecs.push_back(kVp8Codec720p); |
| 1579 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 1626 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
| 1580 | 1627 |
| 1581 // Single-stream settings should apply with RTX as well (verifies that we | 1628 // Single-stream settings should apply with RTX as well (verifies that we |
| 1582 // check number of regular SSRCs and not StreamParams::ssrcs which contains | 1629 // check number of regular SSRCs and not StreamParams::ssrcs which contains |
| 1583 // both RTX and regular SSRCs). | 1630 // both RTX and regular SSRCs). |
| 1584 FakeVideoSendStream* stream = SetUpSimulcast(false, true); | 1631 FakeVideoSendStream* stream = SetUpSimulcast(false, true); |
| 1585 | 1632 |
| 1586 cricket::FakeVideoCapturer capturer; | 1633 cricket::FakeVideoCapturer capturer(false); |
| 1587 capturer.SetScreencast(false); | |
| 1588 EXPECT_EQ(cricket::CS_RUNNING, | 1634 EXPECT_EQ(cricket::CS_RUNNING, |
| 1589 capturer.Start(capturer.GetSupportedFormats()->front())); | 1635 capturer.Start(capturer.GetSupportedFormats()->front())); |
| 1590 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1636 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1591 channel_->SetSend(true); | 1637 channel_->SetSend(true); |
| 1592 | 1638 |
| 1593 EXPECT_TRUE(capturer.CaptureFrame()); | 1639 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1594 | 1640 |
| 1595 webrtc::VideoCodecVP8 vp8_settings; | 1641 webrtc::VideoCodecVP8 vp8_settings; |
| 1596 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1642 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1597 EXPECT_TRUE(vp8_settings.denoisingOn) | 1643 EXPECT_TRUE(vp8_settings.denoisingOn) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1617 channel_->SetSend(true); | 1663 channel_->SetSend(true); |
| 1618 EXPECT_TRUE(capturer.CaptureFrame()); | 1664 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1619 | 1665 |
| 1620 EXPECT_EQ(3, stream->GetVideoStreams().size()); | 1666 EXPECT_EQ(3, stream->GetVideoStreams().size()); |
| 1621 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1667 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1622 // Autmatic resize off when using simulcast. | 1668 // Autmatic resize off when using simulcast. |
| 1623 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1669 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
| 1624 EXPECT_TRUE(vp8_settings.frameDroppingOn); | 1670 EXPECT_TRUE(vp8_settings.frameDroppingOn); |
| 1625 | 1671 |
| 1626 // In screen-share mode, denoising is forced off and simulcast disabled. | 1672 // In screen-share mode, denoising is forced off and simulcast disabled. |
| 1627 capturer.SetScreencast(true); | 1673 FakeVideoCapturer screencast_capturer(true); |
| 1628 EXPECT_TRUE(capturer.CaptureFrame()); | 1674 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer)); |
| 1675 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start( |
| 1676 screencast_capturer.GetSupportedFormats()->front())); |
| 1677 parameters.options.is_screencast = rtc::Optional<bool>(true); |
| 1678 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1679 |
| 1680 EXPECT_TRUE(screencast_capturer.CaptureFrame()); |
| 1629 stream = SetDenoisingOption(parameters, false); | 1681 stream = SetDenoisingOption(parameters, false); |
| 1630 | 1682 |
| 1631 EXPECT_EQ(1, stream->GetVideoStreams().size()); | 1683 EXPECT_EQ(1, stream->GetVideoStreams().size()); |
| 1632 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1684 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| 1633 EXPECT_FALSE(vp8_settings.denoisingOn); | 1685 EXPECT_FALSE(vp8_settings.denoisingOn); |
| 1634 // Resizing and frame dropping always off for screen sharing. | 1686 // Resizing and frame dropping always off for screen sharing. |
| 1635 EXPECT_FALSE(vp8_settings.automaticResizeOn); | 1687 EXPECT_FALSE(vp8_settings.automaticResizeOn); |
| 1636 EXPECT_FALSE(vp8_settings.frameDroppingOn); | 1688 EXPECT_FALSE(vp8_settings.frameDroppingOn); |
| 1637 | 1689 |
| 1638 stream = SetDenoisingOption(parameters, true); | 1690 stream = SetDenoisingOption(parameters, true); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1668 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_; | 1720 cricket::FakeWebRtcVideoEncoderFactory encoder_factory_; |
| 1669 }; | 1721 }; |
| 1670 | 1722 |
| 1671 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) { | 1723 TEST_F(Vp9SettingsTest, VerifyVp9SpecificSettings) { |
| 1672 cricket::VideoSendParameters parameters; | 1724 cricket::VideoSendParameters parameters; |
| 1673 parameters.codecs.push_back(kVp9Codec); | 1725 parameters.codecs.push_back(kVp9Codec); |
| 1674 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 1726 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
| 1675 | 1727 |
| 1676 FakeVideoSendStream* stream = SetUpSimulcast(false, false); | 1728 FakeVideoSendStream* stream = SetUpSimulcast(false, false); |
| 1677 | 1729 |
| 1678 cricket::FakeVideoCapturer capturer; | 1730 cricket::FakeVideoCapturer capturer(false); |
| 1679 capturer.SetScreencast(false); | |
| 1680 EXPECT_EQ(cricket::CS_RUNNING, | 1731 EXPECT_EQ(cricket::CS_RUNNING, |
| 1681 capturer.Start(capturer.GetSupportedFormats()->front())); | 1732 capturer.Start(capturer.GetSupportedFormats()->front())); |
| 1682 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1733 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1683 channel_->SetSend(true); | 1734 channel_->SetSend(true); |
| 1684 | 1735 |
| 1685 EXPECT_TRUE(capturer.CaptureFrame()); | 1736 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1686 | 1737 |
| 1687 webrtc::VideoCodecVP9 vp9_settings; | 1738 webrtc::VideoCodecVP9 vp9_settings; |
| 1688 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1739 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1689 EXPECT_FALSE(vp9_settings.denoisingOn) | 1740 EXPECT_FALSE(vp9_settings.denoisingOn) |
| 1690 << "VP9 denoising should be off by default."; | 1741 << "VP9 denoising should be off by default."; |
| 1691 | 1742 |
| 1692 stream = SetDenoisingOption(parameters, false); | 1743 stream = SetDenoisingOption(parameters, false); |
| 1693 | 1744 |
| 1694 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1745 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1695 EXPECT_FALSE(vp9_settings.denoisingOn); | 1746 EXPECT_FALSE(vp9_settings.denoisingOn); |
| 1696 // Frame dropping always on for real time video. | 1747 // Frame dropping always on for real time video. |
| 1697 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1748 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
| 1698 | 1749 |
| 1699 stream = SetDenoisingOption(parameters, true); | 1750 stream = SetDenoisingOption(parameters, true); |
| 1700 | 1751 |
| 1701 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1752 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1702 EXPECT_TRUE(vp9_settings.denoisingOn); | 1753 EXPECT_TRUE(vp9_settings.denoisingOn); |
| 1703 EXPECT_TRUE(vp9_settings.frameDroppingOn); | 1754 EXPECT_TRUE(vp9_settings.frameDroppingOn); |
| 1704 | 1755 |
| 1705 // In screen-share mode, denoising is forced off. | 1756 // In screen-share mode, denoising is forced off. |
| 1706 capturer.SetScreencast(true); | 1757 FakeVideoCapturer screencast_capturer(true); |
| 1707 EXPECT_TRUE(capturer.CaptureFrame()); | 1758 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &screencast_capturer)); |
| 1759 EXPECT_EQ(cricket::CS_RUNNING, screencast_capturer.Start( |
| 1760 screencast_capturer.GetSupportedFormats()->front())); |
| 1761 parameters.options.is_screencast = rtc::Optional<bool>(true); |
| 1762 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1763 |
| 1764 EXPECT_TRUE(screencast_capturer.CaptureFrame()); |
| 1708 stream = SetDenoisingOption(parameters, false); | 1765 stream = SetDenoisingOption(parameters, false); |
| 1709 | 1766 |
| 1710 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1767 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| 1711 EXPECT_FALSE(vp9_settings.denoisingOn); | 1768 EXPECT_FALSE(vp9_settings.denoisingOn); |
| 1712 // Frame dropping always off for screen sharing. | 1769 // Frame dropping always off for screen sharing. |
| 1713 EXPECT_FALSE(vp9_settings.frameDroppingOn); | 1770 EXPECT_FALSE(vp9_settings.frameDroppingOn); |
| 1714 | 1771 |
| 1715 stream = SetDenoisingOption(parameters, false); | 1772 stream = SetDenoisingOption(parameters, false); |
| 1716 | 1773 |
| 1717 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; | 1774 ASSERT_TRUE(stream->GetVp9Settings(&vp9_settings)) << "No VP9 config set."; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1743 if (!enable_overuse) { | 1800 if (!enable_overuse) { |
| 1744 media_config.enable_cpu_overuse_detection = false; | 1801 media_config.enable_cpu_overuse_detection = false; |
| 1745 } | 1802 } |
| 1746 channel_.reset( | 1803 channel_.reset( |
| 1747 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); | 1804 engine_.CreateChannel(fake_call_.get(), media_config, VideoOptions())); |
| 1748 | 1805 |
| 1749 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1806 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1750 | 1807 |
| 1751 AddSendStream(); | 1808 AddSendStream(); |
| 1752 | 1809 |
| 1753 cricket::FakeVideoCapturer capturer; | 1810 cricket::FakeVideoCapturer capturer(is_screenshare); |
| 1754 capturer.SetScreencast(is_screenshare); | |
| 1755 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1811 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1756 EXPECT_EQ(cricket::CS_RUNNING, | 1812 EXPECT_EQ(cricket::CS_RUNNING, |
| 1757 capturer.Start(capturer.GetSupportedFormats()->front())); | 1813 capturer.Start(capturer.GetSupportedFormats()->front())); |
| 1758 | 1814 |
| 1759 EXPECT_TRUE(channel_->SetSend(true)); | 1815 EXPECT_TRUE(channel_->SetSend(true)); |
| 1760 | 1816 |
| 1761 // Trigger overuse. | 1817 // Trigger overuse. |
| 1762 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); | 1818 ASSERT_EQ(1u, fake_call_->GetVideoSendStreams().size()); |
| 1763 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); | 1819 FakeVideoSendStream* send_stream = fake_call_->GetVideoSendStreams().front(); |
| 1764 webrtc::LoadObserver* overuse_callback = | 1820 webrtc::LoadObserver* overuse_callback = |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3078 // Test that we normalize send codec format size in simulcast. | 3134 // Test that we normalize send codec format size in simulcast. |
| 3079 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3135 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3080 cricket::VideoCodec codec(kVp8Codec270p); | 3136 cricket::VideoCodec codec(kVp8Codec270p); |
| 3081 codec.width += 1; | 3137 codec.width += 1; |
| 3082 codec.height += 1; | 3138 codec.height += 1; |
| 3083 VerifySimulcastSettings(codec, 2, 2); | 3139 VerifySimulcastSettings(codec, 2, 2); |
| 3084 } | 3140 } |
| 3085 } // namespace cricket | 3141 } // namespace cricket |
| 3086 | 3142 |
| 3087 #endif // HAVE_WEBRTC_VIDEO | 3143 #endif // HAVE_WEBRTC_VIDEO |
| OLD | NEW |