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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 static const uint32_t kFlexfecSsrc = 5; | 43 static const uint32_t kFlexfecSsrc = 5; |
44 static const uint32_t kIncomingUnsignalledSsrc = 0xC0FFEE; | 44 static const uint32_t kIncomingUnsignalledSsrc = 0xC0FFEE; |
45 static const char kUnsupportedExtensionName[] = | 45 static const char kUnsupportedExtensionName[] = |
46 "urn:ietf:params:rtp-hdrext:unsupported"; | 46 "urn:ietf:params:rtp-hdrext:unsupported"; |
47 | 47 |
48 cricket::VideoCodec RemoveFeedbackParams(cricket::VideoCodec&& codec) { | 48 cricket::VideoCodec RemoveFeedbackParams(cricket::VideoCodec&& codec) { |
49 codec.feedback_params = cricket::FeedbackParams(); | 49 codec.feedback_params = cricket::FeedbackParams(); |
50 return codec; | 50 return codec; |
51 } | 51 } |
52 | 52 |
53 void VerifyCodecHasDefaultFeedbackParams(const cricket::VideoCodec& codec) { | 53 void VerifyCodecHasDefaultMediaFeedbackParams( |
| 54 const cricket::VideoCodec& codec) { |
54 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 55 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
55 cricket::kRtcpFbParamNack, cricket::kParamValueEmpty))); | 56 cricket::kRtcpFbParamNack, cricket::kParamValueEmpty))); |
56 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 57 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
57 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); | 58 cricket::kRtcpFbParamNack, cricket::kRtcpFbNackParamPli))); |
58 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 59 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
59 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); | 60 cricket::kRtcpFbParamRemb, cricket::kParamValueEmpty))); |
60 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 61 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
61 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); | 62 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); |
62 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( | 63 EXPECT_TRUE(codec.HasFeedbackParam(cricket::FeedbackParam( |
63 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); | 64 cricket::kRtcpFbParamCcm, cricket::kRtcpFbCcmParamFir))); |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 | 1527 |
1527 // Verify that transport cc feedback is turned on when setting default codecs | 1528 // Verify that transport cc feedback is turned on when setting default codecs |
1528 // since the default codecs have transport cc feedback enabled. | 1529 // since the default codecs have transport cc feedback enabled. |
1529 parameters.codecs = engine_.codecs(); | 1530 parameters.codecs = engine_.codecs(); |
1530 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1531 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
1531 stream = fake_call_->GetVideoReceiveStreams()[0]; | 1532 stream = fake_call_->GetVideoReceiveStreams()[0]; |
1532 EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); | 1533 EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); |
1533 } | 1534 } |
1534 | 1535 |
1535 TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { | 1536 TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { |
1536 VerifyCodecHasDefaultFeedbackParams(default_codec_); | 1537 VerifyCodecHasDefaultMediaFeedbackParams(default_codec_); |
1537 | 1538 |
1538 cricket::VideoSendParameters parameters; | 1539 cricket::VideoSendParameters parameters; |
1539 parameters.codecs = engine_.codecs(); | 1540 parameters.codecs = engine_.codecs(); |
1540 EXPECT_TRUE(channel_->SetSendParameters(parameters)); | 1541 EXPECT_TRUE(channel_->SetSendParameters(parameters)); |
1541 EXPECT_TRUE(channel_->SetSend(true)); | 1542 EXPECT_TRUE(channel_->SetSend(true)); |
1542 | 1543 |
1543 // Send side. | 1544 // Send side. |
1544 FakeVideoSendStream* send_stream = | 1545 FakeVideoSendStream* send_stream = |
1545 AddSendStream(cricket::StreamParams::CreateLegacy(1)); | 1546 AddSendStream(cricket::StreamParams::CreateLegacy(1)); |
1546 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); | 1547 EXPECT_GT(send_stream->GetConfig().rtp.nack.rtp_history_ms, 0); |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2363 // tests that use this test fixture into the corresponding "non-field trial" | 2364 // tests that use this test fixture into the corresponding "non-field trial" |
2364 // tests. | 2365 // tests. |
2365 class WebRtcVideoChannel2FlexfecTest : public WebRtcVideoChannel2Test { | 2366 class WebRtcVideoChannel2FlexfecTest : public WebRtcVideoChannel2Test { |
2366 public: | 2367 public: |
2367 WebRtcVideoChannel2FlexfecTest() | 2368 WebRtcVideoChannel2FlexfecTest() |
2368 : WebRtcVideoChannel2Test("WebRTC-FlexFEC-03/Enabled/") {} | 2369 : WebRtcVideoChannel2Test("WebRTC-FlexFEC-03/Enabled/") {} |
2369 }; | 2370 }; |
2370 | 2371 |
2371 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2372 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
2372 // by default. | 2373 // by default. |
| 2374 TEST_F(WebRtcVideoChannel2FlexfecTest, |
| 2375 DefaultFlexfecCodecHasTransportCcFeedbackParam) { |
| 2376 EXPECT_TRUE( |
| 2377 GetEngineCodec("flexfec-03") |
| 2378 .HasFeedbackParam(cricket::FeedbackParam( |
| 2379 cricket::kRtcpFbParamTransportCc, cricket::kParamValueEmpty))); |
| 2380 } |
| 2381 |
| 2382 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
| 2383 // by default. |
2373 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithoutSsrc) { | 2384 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithoutSsrc) { |
2374 FakeVideoSendStream* stream = AddSendStream(); | 2385 FakeVideoSendStream* stream = AddSendStream(); |
2375 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2386 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2376 | 2387 |
2377 EXPECT_EQ(GetEngineCodec("flexfec-03").id, | 2388 EXPECT_EQ(GetEngineCodec("flexfec-03").id, |
2378 config.rtp.flexfec.flexfec_payload_type); | 2389 config.rtp.flexfec.flexfec_payload_type); |
2379 EXPECT_FALSE(config.rtp.flexfec.IsCompleteAndEnabled()); | 2390 EXPECT_FALSE(config.rtp.flexfec.IsCompleteAndEnabled()); |
2380 } | 2391 } |
2381 | 2392 |
2382 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2393 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4058 | 4069 |
4059 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { | 4070 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { |
4060 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); | 4071 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); |
4061 } | 4072 } |
4062 | 4073 |
4063 // Test that we normalize send codec format size in simulcast. | 4074 // Test that we normalize send codec format size in simulcast. |
4064 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 4075 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
4065 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); | 4076 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); |
4066 } | 4077 } |
4067 } // namespace cricket | 4078 } // namespace cricket |
OLD | NEW |