| 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 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 send_stream->GetEncoderConfig().Copy(); | 1550 send_stream->GetEncoderConfig().Copy(); |
| 1551 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, | 1551 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kRealtimeVideo, |
| 1552 encoder_config.content_type); | 1552 encoder_config.content_type); |
| 1553 std::vector<webrtc::VideoStream> streams = send_stream->GetVideoStreams(); | 1553 std::vector<webrtc::VideoStream> streams = send_stream->GetVideoStreams(); |
| 1554 EXPECT_EQ(capture_format_hd.width, streams.front().width); | 1554 EXPECT_EQ(capture_format_hd.width, streams.front().width); |
| 1555 EXPECT_EQ(capture_format_hd.height, streams.front().height); | 1555 EXPECT_EQ(capture_format_hd.height, streams.front().height); |
| 1556 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) | 1556 EXPECT_EQ(0, encoder_config.min_transmit_bitrate_bps) |
| 1557 << "Non-screenshare shouldn't use min-transmit bitrate."; | 1557 << "Non-screenshare shouldn't use min-transmit bitrate."; |
| 1558 | 1558 |
| 1559 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); | 1559 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); |
| 1560 // Removing a capturer triggers a black frame to be sent. | 1560 EXPECT_EQ(1, send_stream->GetNumberOfSwappedFrames()); |
| 1561 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); | |
| 1562 VideoOptions screencast_options; | 1561 VideoOptions screencast_options; |
| 1563 screencast_options.is_screencast = rtc::Optional<bool>(true); | 1562 screencast_options.is_screencast = rtc::Optional<bool>(true); |
| 1564 EXPECT_TRUE( | 1563 EXPECT_TRUE( |
| 1565 channel_->SetVideoSend(last_ssrc_, true, &screencast_options, &capturer)); | 1564 channel_->SetVideoSend(last_ssrc_, true, &screencast_options, &capturer)); |
| 1566 EXPECT_TRUE(capturer.CaptureFrame()); | 1565 EXPECT_TRUE(capturer.CaptureFrame()); |
| 1567 // Send stream not recreated after option change. | 1566 // Send stream not recreated after option change. |
| 1568 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); | 1567 ASSERT_EQ(send_stream, fake_call_->GetVideoSendStreams().front()); |
| 1569 EXPECT_EQ(3, send_stream->GetNumberOfSwappedFrames()); | 1568 EXPECT_EQ(2, send_stream->GetNumberOfSwappedFrames()); |
| 1570 | 1569 |
| 1571 // Verify screencast settings. | 1570 // Verify screencast settings. |
| 1572 encoder_config = send_stream->GetEncoderConfig().Copy(); | 1571 encoder_config = send_stream->GetEncoderConfig().Copy(); |
| 1573 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, | 1572 EXPECT_EQ(webrtc::VideoEncoderConfig::ContentType::kScreen, |
| 1574 encoder_config.content_type); | 1573 encoder_config.content_type); |
| 1575 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, | 1574 EXPECT_EQ(kScreenshareMinBitrateKbps * 1000, |
| 1576 encoder_config.min_transmit_bitrate_bps); | 1575 encoder_config.min_transmit_bitrate_bps); |
| 1577 | 1576 |
| 1578 streams = send_stream->GetVideoStreams(); | 1577 streams = send_stream->GetVideoStreams(); |
| 1579 EXPECT_EQ(capture_format_hd.width, streams.front().width); | 1578 EXPECT_EQ(capture_format_hd.width, streams.front().width); |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3743 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { | 3742 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { |
| 3744 VerifySimulcastSettings(kVp8Codec, 1280, 720, 3, 3); | 3743 VerifySimulcastSettings(kVp8Codec, 1280, 720, 3, 3); |
| 3745 } | 3744 } |
| 3746 | 3745 |
| 3747 // Test that we normalize send codec format size in simulcast. | 3746 // Test that we normalize send codec format size in simulcast. |
| 3748 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3747 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3749 cricket::VideoCodec codec(kVp8Codec); | 3748 cricket::VideoCodec codec(kVp8Codec); |
| 3750 VerifySimulcastSettings(codec, 541, 271, 2, 2); | 3749 VerifySimulcastSettings(codec, 541, 271, 2, 2); |
| 3751 } | 3750 } |
| 3752 } // namespace cricket | 3751 } // namespace cricket |
| OLD | NEW |