| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 "urn:ietf:params:rtp-hdrext:unsupported"; | 68 "urn:ietf:params:rtp-hdrext:unsupported"; |
| 69 | 69 |
| 70 void VerifyCodecHasDefaultFeedbackParams(const cricket::VideoCodec& codec) { | 70 void VerifyCodecHasDefaultFeedbackParams(const cricket::VideoCodec& codec) { |
| 71 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 71 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
| 72 cricket::kRtcpFbParamNack, cricket::kParamValueEmpty))); | 72 cricket::kRtcpFbParamNack, cricket::kParamValueEmpty))); |
| 73 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 73 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
| 74 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); | 74 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); |
| 75 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 75 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
| 76 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); | 76 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); |
| 77 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 77 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
| 78 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); |
| 79 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
| 78 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); | 80 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); |
| 79 } | 81 } |
| 80 | 82 |
| 81 static void CreateBlackFrame(webrtc::VideoFrame* video_frame, | 83 static void CreateBlackFrame(webrtc::VideoFrame* video_frame, |
| 82 int width, | 84 int width, |
| 83 int height) { | 85 int height) { |
| 84 video_frame->CreateEmptyFrame( | 86 video_frame->CreateEmptyFrame( |
| 85 width, height, width, (width + 1) / 2, (width + 1) / 2); | 87 width, height, width, (width + 1) / 2, (width + 1) / 2); |
| 86 memset(video_frame->buffer(webrtc::kYPlane), 16, | 88 memset(video_frame->buffer(webrtc::kYPlane), 16, |
| 87 video_frame->allocated_size(webrtc::kYPlane)); | 89 video_frame->allocated_size(webrtc::kYPlane)); |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) { | 1446 TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) { |
| 1445 FakeVideoReceiveStream* stream = AddRecvStream(); | 1447 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 1446 EXPECT_EQ(webrtc::RtcpMode::kCompound, stream->GetConfig().rtp.rtcp_mode); | 1448 EXPECT_EQ(webrtc::RtcpMode::kCompound, stream->GetConfig().rtp.rtcp_mode); |
| 1447 } | 1449 } |
| 1448 | 1450 |
| 1449 TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) { | 1451 TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) { |
| 1450 FakeVideoReceiveStream* stream = AddRecvStream(); | 1452 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 1451 EXPECT_TRUE(stream->GetConfig().rtp.remb); | 1453 EXPECT_TRUE(stream->GetConfig().rtp.remb); |
| 1452 } | 1454 } |
| 1453 | 1455 |
| 1456 TEST_F(WebRtcVideoChannel2Test, TransportCcIsEnabledByDefault) { |
| 1457 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 1458 EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); |
| 1459 } |
| 1460 |
| 1454 TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) { | 1461 TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) { |
| 1455 FakeVideoReceiveStream* stream = AddRecvStream(); | 1462 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 1456 EXPECT_TRUE(stream->GetConfig().rtp.remb); | 1463 EXPECT_TRUE(stream->GetConfig().rtp.remb); |
| 1457 | 1464 |
| 1458 // Verify that REMB is turned off when send(!) codecs without REMB are set. | 1465 // Verify that REMB is turned off when send(!) codecs without REMB are set. |
| 1459 cricket::VideoSendParameters parameters; | 1466 cricket::VideoSendParameters parameters; |
| 1460 parameters.codecs.push_back(kVp8Codec); | 1467 parameters.codecs.push_back(kVp8Codec); |
| 1461 EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty()); | 1468 EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty()); |
| 1462 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1469 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1463 stream = fake_call_->GetVideoReceiveStreams()[0]; | 1470 stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 1464 EXPECT_FALSE(stream->GetConfig().rtp.remb); | 1471 EXPECT_FALSE(stream->GetConfig().rtp.remb); |
| 1465 | 1472 |
| 1466 // Verify that REMB is turned on when setting default codecs since the | 1473 // Verify that REMB is turned on when setting default codecs since the |
| 1467 // default codecs have REMB enabled. | 1474 // default codecs have REMB enabled. |
| 1468 parameters.codecs = engine_.codecs(); | 1475 parameters.codecs = engine_.codecs(); |
| 1469 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1476 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1470 stream = fake_call_->GetVideoReceiveStreams()[0]; | 1477 stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 1471 EXPECT_TRUE(stream->GetConfig().rtp.remb); | 1478 EXPECT_TRUE(stream->GetConfig().rtp.remb); |
| 1472 } | 1479 } |
| 1473 | 1480 |
| 1481 TEST_F(WebRtcVideoChannel2Test, TransportCcCanBeEnabledAndDisabled) { |
| 1482 FakeVideoReceiveStream* stream = AddRecvStream(); |
| 1483 EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); |
| 1484 |
| 1485 // Verify that transport cc feedback is turned off when send(!) codecs without |
| 1486 // transport cc feedback are set. |
| 1487 cricket::VideoSendParameters parameters; |
| 1488 parameters.codecs.push_back(kVp8Codec); |
| 1489 EXPECT_TRUE(parameters.codecs[0].feedback_params.params().empty()); |
| 1490 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1491 stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 1492 EXPECT_FALSE(stream->GetConfig().rtp.transport_cc); |
| 1493 |
| 1494 // Verify that transport cc feedback is turned on when setting default codecs |
| 1495 // since the default codecs have transport cc feedback enabled. |
| 1496 parameters.codecs = engine_.codecs(); |
| 1497 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1498 stream = fake_call_->GetVideoReceiveStreams()[0]; |
| 1499 EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); |
| 1500 } |
| 1501 |
| 1474 TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { | 1502 TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { |
| 1475 VerifyCodecHasDefaultFeedbackParams(default_codec_); | 1503 VerifyCodecHasDefaultFeedbackParams(default_codec_); |
| 1476 | 1504 |
| 1477 cricket::VideoSendParameters parameters; | 1505 cricket::VideoSendParameters parameters; |
| 1478 parameters.codecs = engine_.codecs(); | 1506 parameters.codecs = engine_.codecs(); |
| 1479 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1507 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
| 1480 EXPECT_TRUE(channel_->SetSend(true)); | 1508 EXPECT_TRUE(channel_->SetSend(true)); |
| 1481 | 1509 |
| 1482 // Send side. | 1510 // Send side. |
| 1483 FakeVideoSendStream* send_stream = | 1511 FakeVideoSendStream* send_stream = |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3274 // Ensures that the correct settings are applied to the codec when two temporal | 3302 // Ensures that the correct settings are applied to the codec when two temporal |
| 3275 // layer screencasting is enabled, and that the correct simulcast settings are | 3303 // layer screencasting is enabled, and that the correct simulcast settings are |
| 3276 // reapplied when disabling screencasting. | 3304 // reapplied when disabling screencasting. |
| 3277 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3305 TEST_F(WebRtcVideoChannel2SimulcastTest, |
| 3278 DISABLED_TwoTemporalLayerScreencastSettings) { | 3306 DISABLED_TwoTemporalLayerScreencastSettings) { |
| 3279 // TODO(pbos): Implement. | 3307 // TODO(pbos): Implement. |
| 3280 FAIL() << "Not implemented."; | 3308 FAIL() << "Not implemented."; |
| 3281 } | 3309 } |
| 3282 | 3310 |
| 3283 } // namespace cricket | 3311 } // namespace cricket |
| OLD | NEW |