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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 } | 1011 } |
| 1012 | 1012 |
| 1013 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); | 1013 void TestCpuAdaptation(bool enable_overuse, bool is_screenshare); |
| 1014 void TestReceiverLocalSsrcConfiguration(bool receiver_first); | 1014 void TestReceiverLocalSsrcConfiguration(bool receiver_first); |
| 1015 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, | 1015 void TestReceiveUnsignalledSsrcPacket(uint8_t payload_type, |
| 1016 bool expect_created_receive_stream); | 1016 bool expect_created_receive_stream); |
| 1017 | 1017 |
| 1018 FakeVideoSendStream* SetDenoisingOption( | 1018 FakeVideoSendStream* SetDenoisingOption( |
| 1019 const cricket::VideoSendParameters& parameters, bool enabled) { | 1019 const cricket::VideoSendParameters& parameters, bool enabled) { |
| 1020 cricket::VideoSendParameters params = parameters; | 1020 cricket::VideoSendParameters params = parameters; |
| 1021 #if 0 | |
| 1022 // TODO(nisse): How to pass this? | |
| 1021 params.options.video_noise_reduction = rtc::Optional<bool>(enabled); | 1023 params.options.video_noise_reduction = rtc::Optional<bool>(enabled); |
|
pthatcher1
2016/02/12 20:45:38
Probably with channel_->SetOptions or channel_->Se
| |
| 1024 #endif | |
| 1022 channel_->SetSendParameters(params); | 1025 channel_->SetSendParameters(params); |
| 1023 return fake_call_->GetVideoSendStreams().back(); | 1026 return fake_call_->GetVideoSendStreams().back(); |
| 1024 } | 1027 } |
| 1025 | 1028 |
| 1026 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { | 1029 FakeVideoSendStream* SetUpSimulcast(bool enabled, bool with_rtx) { |
| 1027 const int kRtxSsrcOffset = 0xDEADBEEF; | 1030 const int kRtxSsrcOffset = 0xDEADBEEF; |
| 1028 last_ssrc_ += 3; | 1031 last_ssrc_ += 3; |
| 1029 std::vector<uint32_t> ssrcs; | 1032 std::vector<uint32_t> ssrcs; |
| 1030 std::vector<uint32_t> rtx_ssrcs; | 1033 std::vector<uint32_t> rtx_ssrcs; |
| 1031 uint32_t num_streams = enabled ? 3 : 1; | 1034 uint32_t num_streams = enabled ? 3 : 1; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 1062 EXPECT_EQ(kSyncLabel, | 1065 EXPECT_EQ(kSyncLabel, |
| 1063 fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group) | 1066 fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group) |
| 1064 << "SyncGroup should be set based on sync_label"; | 1067 << "SyncGroup should be set based on sync_label"; |
| 1065 } | 1068 } |
| 1066 | 1069 |
| 1067 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { | 1070 TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { |
| 1068 cricket::VideoSendParameters parameters; | 1071 cricket::VideoSendParameters parameters; |
| 1069 parameters.codecs = engine_.codecs(); | 1072 parameters.codecs = engine_.codecs(); |
| 1070 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1073 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1071 EXPECT_TRUE(channel_->SetSend(true)); | 1074 EXPECT_TRUE(channel_->SetSend(true)); |
| 1075 #if 0 | |
| 1076 // TODO(nisse): How to pass this? | |
| 1072 parameters.options.conference_mode = rtc::Optional<bool>(true); | 1077 parameters.options.conference_mode = rtc::Optional<bool>(true); |
| 1078 #endif | |
| 1073 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1079 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1074 | 1080 |
| 1075 // Send side. | 1081 // Send side. |
| 1076 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); | 1082 const std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs1); |
| 1077 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); | 1083 const std::vector<uint32_t> rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); |
| 1078 FakeVideoSendStream* send_stream = AddSendStream( | 1084 FakeVideoSendStream* send_stream = AddSendStream( |
| 1079 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); | 1085 cricket::CreateSimWithRtxStreamParams("cname", ssrcs, rtx_ssrcs)); |
| 1080 | 1086 |
| 1081 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size()); | 1087 ASSERT_EQ(rtx_ssrcs.size(), send_stream->GetConfig().rtp.rtx.ssrcs.size()); |
| 1082 for (size_t i = 0; i < rtx_ssrcs.size(); ++i) | 1088 for (size_t i = 0; i < rtx_ssrcs.size(); ++i) |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1451 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1457 EXPECT_GT(recv_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1452 send_stream = fake_call_->GetVideoSendStreams()[0]; | 1458 send_stream = fake_call_->GetVideoSendStreams()[0]; |
| 1453 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1459 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
| 1454 } | 1460 } |
| 1455 | 1461 |
| 1456 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { | 1462 TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { |
| 1457 static const int kScreenshareMinBitrateKbps = 800; | 1463 static const int kScreenshareMinBitrateKbps = 800; |
| 1458 cricket::VideoCodec codec = kVp8Codec360p; | 1464 cricket::VideoCodec codec = kVp8Codec360p; |
| 1459 cricket::VideoSendParameters parameters; | 1465 cricket::VideoSendParameters parameters; |
| 1460 parameters.codecs.push_back(codec); | 1466 parameters.codecs.push_back(codec); |
| 1467 #if 0 | |
| 1468 // TODO(nisse): How to pass this? | |
| 1461 parameters.options.screencast_min_bitrate_kbps = | 1469 parameters.options.screencast_min_bitrate_kbps = |
| 1462 rtc::Optional<int>(kScreenshareMinBitrateKbps); | 1470 rtc::Optional<int>(kScreenshareMinBitrateKbps); |
|
pthatcher1
2016/02/12 20:45:38
Again, could go on VideoParameters directly.
| |
| 1471 #endif | |
| 1463 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1472 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1464 | 1473 |
| 1465 AddSendStream(); | 1474 AddSendStream(); |
| 1466 | 1475 |
| 1467 cricket::FakeVideoCapturer capturer; | 1476 cricket::FakeVideoCapturer capturer; |
| 1468 capturer.SetScreencast(false); | 1477 capturer.SetScreencast(false); |
| 1469 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1478 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1470 cricket::VideoFormat capture_format_hd = | 1479 cricket::VideoFormat capture_format_hd = |
| 1471 capturer.GetSupportedFormats()->front(); | 1480 capturer.GetSupportedFormats()->front(); |
| 1472 EXPECT_EQ(1280, capture_format_hd.width); | 1481 EXPECT_EQ(1280, capture_format_hd.width); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1506 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); | 1515 EXPECT_EQ(capture_format_hd.height, encoder_config.streams.front().height); |
| 1507 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); | 1516 EXPECT_TRUE(encoder_config.streams[0].temporal_layer_thresholds_bps.empty()); |
| 1508 | 1517 |
| 1509 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1518 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1510 } | 1519 } |
| 1511 | 1520 |
| 1512 TEST_F(WebRtcVideoChannel2Test, | 1521 TEST_F(WebRtcVideoChannel2Test, |
| 1513 ConferenceModeScreencastConfiguresTemporalLayer) { | 1522 ConferenceModeScreencastConfiguresTemporalLayer) { |
| 1514 static const int kConferenceScreencastTemporalBitrateBps = | 1523 static const int kConferenceScreencastTemporalBitrateBps = |
| 1515 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; | 1524 ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; |
| 1525 #if 0 | |
| 1526 // TODO(nisse): How to pass this? | |
| 1516 send_parameters_.options.conference_mode = rtc::Optional<bool>(true); | 1527 send_parameters_.options.conference_mode = rtc::Optional<bool>(true); |
| 1528 #endif | |
| 1517 channel_->SetSendParameters(send_parameters_); | 1529 channel_->SetSendParameters(send_parameters_); |
| 1518 | 1530 |
| 1519 AddSendStream(); | 1531 AddSendStream(); |
| 1520 | 1532 |
| 1521 cricket::FakeVideoCapturer capturer; | 1533 cricket::FakeVideoCapturer capturer; |
| 1522 capturer.SetScreencast(true); | 1534 capturer.SetScreencast(true); |
| 1523 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); | 1535 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, &capturer)); |
| 1524 cricket::VideoFormat capture_format_hd = | 1536 cricket::VideoFormat capture_format_hd = |
| 1525 capturer.GetSupportedFormats()->front(); | 1537 capturer.GetSupportedFormats()->front(); |
| 1526 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); | 1538 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(capture_format_hd)); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1544 | 1556 |
| 1545 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); | 1557 EXPECT_TRUE(channel_->SetCapturer(last_ssrc_, NULL)); |
| 1546 } | 1558 } |
| 1547 | 1559 |
| 1548 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) { | 1560 TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) { |
| 1549 FakeVideoSendStream* stream = AddSendStream(); | 1561 FakeVideoSendStream* stream = AddSendStream(); |
| 1550 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); | 1562 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); |
| 1551 } | 1563 } |
| 1552 | 1564 |
| 1553 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) { | 1565 TEST_F(WebRtcVideoChannel2Test, SetOptionsWithSuspendBelowMinBitrate) { |
| 1566 #if 0 | |
| 1567 // TODO(nisse): How to pass this? | |
| 1554 send_parameters_.options.suspend_below_min_bitrate = | 1568 send_parameters_.options.suspend_below_min_bitrate = |
| 1555 rtc::Optional<bool>(true); | 1569 rtc::Optional<bool>(true); |
| 1570 #endif | |
| 1556 channel_->SetSendParameters(send_parameters_); | 1571 channel_->SetSendParameters(send_parameters_); |
| 1557 | 1572 |
| 1558 FakeVideoSendStream* stream = AddSendStream(); | 1573 FakeVideoSendStream* stream = AddSendStream(); |
| 1559 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate); | 1574 EXPECT_TRUE(stream->GetConfig().suspend_below_min_bitrate); |
| 1560 | 1575 |
| 1576 #if 0 | |
| 1561 send_parameters_.options.suspend_below_min_bitrate = | 1577 send_parameters_.options.suspend_below_min_bitrate = |
| 1562 rtc::Optional<bool>(false); | 1578 rtc::Optional<bool>(false); |
| 1579 #endif | |
| 1563 channel_->SetSendParameters(send_parameters_); | 1580 channel_->SetSendParameters(send_parameters_); |
| 1564 | 1581 |
| 1565 stream = fake_call_->GetVideoSendStreams()[0]; | 1582 stream = fake_call_->GetVideoSendStreams()[0]; |
| 1566 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); | 1583 EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); |
| 1567 } | 1584 } |
| 1568 | 1585 |
| 1569 TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) { | 1586 TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) { |
| 1570 FakeVideoSendStream* stream = AddSendStream(); | 1587 FakeVideoSendStream* stream = AddSendStream(); |
| 1571 webrtc::VideoCodecVP8 vp8_settings; | 1588 webrtc::VideoCodecVP8 vp8_settings; |
| 1572 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; | 1589 ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; |
| (...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3078 // Test that we normalize send codec format size in simulcast. | 3095 // Test that we normalize send codec format size in simulcast. |
| 3079 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 3096 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
| 3080 cricket::VideoCodec codec(kVp8Codec270p); | 3097 cricket::VideoCodec codec(kVp8Codec270p); |
| 3081 codec.width += 1; | 3098 codec.width += 1; |
| 3082 codec.height += 1; | 3099 codec.height += 1; |
| 3083 VerifySimulcastSettings(codec, 2, 2); | 3100 VerifySimulcastSettings(codec, 2, 2); |
| 3084 } | 3101 } |
| 3085 } // namespace cricket | 3102 } // namespace cricket |
| 3086 | 3103 |
| 3087 #endif // HAVE_WEBRTC_VIDEO | 3104 #endif // HAVE_WEBRTC_VIDEO |
| OLD | NEW |