Chromium Code Reviews| 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 // Verify that NACK is turned on when setting default codecs since the | 1477 // Verify that NACK is turned on when setting default codecs since the |
| 1478 // default codecs have NACK enabled. | 1478 // default codecs have NACK enabled. |
| 1479 parameters.codecs = engine_.codecs(); | 1479 parameters.codecs = engine_.codecs(); |
| 1480 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1480 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1481 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; | 1481 recv_stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 1482 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1482 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1483 send_stream = fake_call_->GetVideoSendStreams()[0]; | 1483 send_stream = fake_call_->GetVideoSendStreams()[0]; |
| 1484 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1484 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1485 } | 1485 } |
| 1486 | 1486 |
| 1487 TEST_F(WebRtcVideoChannel2Test, ReconfiguresEncodersWhenNotSending) { | |
|
Taylor Brandstetter
2016/03/11 21:33:29
nit: Even though the name is pretty clear, a comme
pbos-webrtc
2016/03/11 22:50:42
Done.
| |
| 1488 cricket::VideoSendParameters parameters; | |
| 1489 parameters.codecs.push_back(kVp8Codec720p); | |
| 1490 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | |
| 1491 channel_->SetSend(false); | |
| 1492 | |
| 1493 FakeVideoSendStream* stream = AddSendStream(); | |
| 1494 | |
| 1495 // No frames entered, using default dimensions. | |
| 1496 std::vector<webrtc::VideoStream> streams = stream->GetVideoStreams(); | |
| 1497 EXPECT_NE(kVp8Codec720p.width, streams[0].width); | |
| 1498 EXPECT_NE(kVp8Codec720p.height, streams[0].height); | |
| 1499 | |
| 1500 cricket::FakeVideoCapturer capturer; | |
| 1501 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | |
| 1502 EXPECT_EQ(cricket::CS_RUNNING, | |
| 1503 capturer.Start(capturer.GetSupportedFormats()->front())); | |
| 1504 EXPECT_TRUE(capturer.CaptureFrame()); | |
| 1505 | |
| 1506 // Frame entered, should be reconfigured to new dimensions. | |
| 1507 streams = stream->GetVideoStreams(); | |
| 1508 EXPECT_EQ(kVp8Codec720p.width, streams[0].width); | |
| 1509 EXPECT_EQ(kVp8Codec720p.height, streams[0].height); | |
| 1510 // No frames should have been actually put in there though. | |
| 1511 EXPECT_EQ(0, stream->GetNumberOfSwappedFrames()); | |
| 1512 | |
| 1513 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | |
| 1514 } | |
| 1515 | |
| 1487 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { | 1516 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { |
| 1488 static const int kScreenshareMinBitrateKbps = 800; | 1517 static const int kScreenshareMinBitrateKbps = 800; |
| 1489 cricket::VideoCodec codec = kVp8Codec360p; | 1518 cricket::VideoCodec codec = kVp8Codec360p; |
| 1490 cricket::VideoSendParameters parameters; | 1519 cricket::VideoSendParameters parameters; |
| 1491 parameters.codecs.push_back(codec); | 1520 parameters.codecs.push_back(codec); |
| 1492 parameters.options.screencast_min_bitrate_kbps = | 1521 parameters.options.screencast_min_bitrate_kbps = |
| 1493 rtc::Optional<int>(kScreenshareMinBitrateKbps); | 1522 rtc::Optional<int>(kScreenshareMinBitrateKbps); |
| 1494 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1523 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1495 | 1524 |
| 1496 AddSendStream(); | 1525 AddSendStream(); |
| (...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3252 | 3281 |
| 3253 // Test that we normalize send codec format size in simulcast. | 3282 // Test that we normalize send codec format size in simulcast. |
| 3254 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3283 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3255 cricket::VideoCodec codec(kVp8Codec270p); | 3284 cricket::VideoCodec codec(kVp8Codec270p); |
| 3256 codec.width += 1; | 3285 codec.width += 1; |
| 3257 codec.height += 1; | 3286 codec.height += 1; |
| 3258 VerifySimulcastSettings(codec, 2, 2); | 3287 VerifySimulcastSettings(codec, 2, 2); |
| 3259 } | 3288 } |
| 3260 } // namespace cricket | 3289 } // namespace cricket |
| 3261 | 3290 |
| OLD | NEW |