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 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2339 EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]); | 2339 EXPECT_EQ(kRtxSsrcs1[0], config.rtp.rtx.ssrcs[0]); |
2340 VerifySendStreamHasRtxTypes(config, default_apt_rtx_types_); | 2340 VerifySendStreamHasRtxTypes(config, default_apt_rtx_types_); |
2341 // TODO(juberti): Check RTCP, PLI, TMMBR. | 2341 // TODO(juberti): Check RTCP, PLI, TMMBR. |
2342 } | 2342 } |
2343 | 2343 |
2344 // TODO(brandtr): Remove when FlexFEC _is_ exposed by default. | 2344 // TODO(brandtr): Remove when FlexFEC _is_ exposed by default. |
2345 TEST_F(WebRtcVideoChannel2Test, FlexfecCodecWithoutSsrcNotExposedByDefault) { | 2345 TEST_F(WebRtcVideoChannel2Test, FlexfecCodecWithoutSsrcNotExposedByDefault) { |
2346 FakeVideoSendStream* stream = AddSendStream(); | 2346 FakeVideoSendStream* stream = AddSendStream(); |
2347 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2347 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2348 | 2348 |
2349 EXPECT_EQ(-1, config.rtp.flexfec.flexfec_payload_type); | 2349 EXPECT_EQ(-1, config.rtp.flexfec.payload_type); |
2350 } | 2350 } |
2351 | 2351 |
2352 // TODO(brandtr): Remove when FlexFEC _is_ exposed by default. | 2352 // TODO(brandtr): Remove when FlexFEC _is_ exposed by default. |
2353 TEST_F(WebRtcVideoChannel2Test, FlexfecCodecWithSsrcNotExposedByDefault) { | 2353 TEST_F(WebRtcVideoChannel2Test, FlexfecCodecWithSsrcNotExposedByDefault) { |
2354 FakeVideoSendStream* stream = AddSendStream( | 2354 FakeVideoSendStream* stream = AddSendStream( |
2355 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); | 2355 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); |
2356 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2356 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2357 | 2357 |
2358 EXPECT_EQ(-1, config.rtp.flexfec.flexfec_payload_type); | 2358 EXPECT_EQ(-1, config.rtp.flexfec.payload_type); |
2359 } | 2359 } |
2360 | 2360 |
2361 // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all | 2361 // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all |
2362 // tests that use this test fixture into the corresponding "non-field trial" | 2362 // tests that use this test fixture into the corresponding "non-field trial" |
2363 // tests. | 2363 // tests. |
2364 class WebRtcVideoChannel2FlexfecTest : public WebRtcVideoChannel2Test { | 2364 class WebRtcVideoChannel2FlexfecTest : public WebRtcVideoChannel2Test { |
2365 public: | 2365 public: |
2366 WebRtcVideoChannel2FlexfecTest() | 2366 WebRtcVideoChannel2FlexfecTest() |
2367 : WebRtcVideoChannel2Test("WebRTC-FlexFEC-03/Enabled/") {} | 2367 : WebRtcVideoChannel2Test("WebRTC-FlexFEC-03/Enabled/") {} |
2368 }; | 2368 }; |
2369 | 2369 |
2370 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2370 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
2371 // by default. | 2371 // by default. |
2372 TEST_F(WebRtcVideoChannel2FlexfecTest, | 2372 TEST_F(WebRtcVideoChannel2FlexfecTest, |
2373 DefaultFlexfecCodecHasTransportCcAndRembFeedbackParam) { | 2373 DefaultFlexfecCodecHasTransportCcAndRembFeedbackParam) { |
2374 EXPECT_TRUE(cricket::HasTransportCc(GetEngineCodec("flexfec-03"))); | 2374 EXPECT_TRUE(cricket::HasTransportCc(GetEngineCodec("flexfec-03"))); |
2375 EXPECT_TRUE(cricket::HasRemb(GetEngineCodec("flexfec-03"))); | 2375 EXPECT_TRUE(cricket::HasRemb(GetEngineCodec("flexfec-03"))); |
2376 } | 2376 } |
2377 | 2377 |
2378 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2378 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
2379 // by default. | 2379 // by default. |
2380 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithoutSsrc) { | 2380 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithoutSsrc) { |
2381 FakeVideoSendStream* stream = AddSendStream(); | 2381 FakeVideoSendStream* stream = AddSendStream(); |
2382 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2382 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2383 | 2383 |
2384 EXPECT_EQ(GetEngineCodec("flexfec-03").id, | 2384 EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type); |
2385 config.rtp.flexfec.flexfec_payload_type); | 2385 EXPECT_EQ(0U, config.rtp.flexfec.ssrc); |
2386 EXPECT_FALSE(config.rtp.flexfec.IsCompleteAndEnabled()); | 2386 EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); |
2387 } | 2387 } |
2388 | 2388 |
2389 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2389 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
2390 // by default. | 2390 // by default. |
2391 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithSsrc) { | 2391 TEST_F(WebRtcVideoChannel2FlexfecTest, SetDefaultSendCodecsWithSsrc) { |
2392 FakeVideoSendStream* stream = AddSendStream( | 2392 FakeVideoSendStream* stream = AddSendStream( |
2393 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); | 2393 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); |
2394 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2394 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2395 | 2395 |
2396 EXPECT_EQ(GetEngineCodec("flexfec-03").id, | 2396 EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type); |
2397 config.rtp.flexfec.flexfec_payload_type); | 2397 EXPECT_EQ(kFlexfecSsrc, config.rtp.flexfec.ssrc); |
2398 EXPECT_TRUE(config.rtp.flexfec.IsCompleteAndEnabled()); | 2398 ASSERT_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size()); |
| 2399 EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]); |
2399 } | 2400 } |
2400 | 2401 |
2401 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { | 2402 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { |
2402 cricket::VideoSendParameters parameters; | 2403 cricket::VideoSendParameters parameters; |
2403 parameters.codecs.push_back(GetEngineCodec("VP8")); | 2404 parameters.codecs.push_back(GetEngineCodec("VP8")); |
2404 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2405 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2405 | 2406 |
2406 FakeVideoSendStream* stream = AddSendStream(); | 2407 FakeVideoSendStream* stream = AddSendStream(); |
2407 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2408 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2408 | 2409 |
2409 EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type); | 2410 EXPECT_EQ(-1, config.rtp.ulpfec.ulpfec_payload_type); |
2410 EXPECT_EQ(-1, config.rtp.ulpfec.red_payload_type); | 2411 EXPECT_EQ(-1, config.rtp.ulpfec.red_payload_type); |
2411 } | 2412 } |
2412 | 2413 |
2413 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled | 2414 // TODO(brandtr): Merge into "non-field trial" test when FlexFEC is enabled |
2414 // by default. | 2415 // by default. |
2415 TEST_F(WebRtcVideoChannel2FlexfecTest, SetSendCodecsWithoutFec) { | 2416 TEST_F(WebRtcVideoChannel2FlexfecTest, SetSendCodecsWithoutFec) { |
2416 cricket::VideoSendParameters parameters; | 2417 cricket::VideoSendParameters parameters; |
2417 parameters.codecs.push_back(GetEngineCodec("VP8")); | 2418 parameters.codecs.push_back(GetEngineCodec("VP8")); |
2418 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2419 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2419 | 2420 |
2420 FakeVideoSendStream* stream = AddSendStream(); | 2421 FakeVideoSendStream* stream = AddSendStream(); |
2421 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2422 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2422 | 2423 |
2423 EXPECT_EQ(-1, config.rtp.flexfec.flexfec_payload_type); | 2424 EXPECT_EQ(-1, config.rtp.flexfec.payload_type); |
2424 } | 2425 } |
2425 | 2426 |
2426 TEST_F(WebRtcVideoChannel2Test, | 2427 TEST_F(WebRtcVideoChannel2Test, |
2427 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { | 2428 SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { |
2428 const int kUnusedPayloadType = 127; | 2429 const int kUnusedPayloadType = 127; |
2429 EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType)); | 2430 EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType)); |
2430 | 2431 |
2431 cricket::VideoSendParameters parameters; | 2432 cricket::VideoSendParameters parameters; |
2432 cricket::VideoCodec rtx_codec(kUnusedPayloadType, "rtx"); | 2433 cricket::VideoCodec rtx_codec(kUnusedPayloadType, "rtx"); |
2433 parameters.codecs.push_back(rtx_codec); | 2434 parameters.codecs.push_back(rtx_codec); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2485 TEST_F(WebRtcVideoChannel2FlexfecTest, SetSendCodecsWithoutFecDisablesFec) { | 2486 TEST_F(WebRtcVideoChannel2FlexfecTest, SetSendCodecsWithoutFecDisablesFec) { |
2486 cricket::VideoSendParameters parameters; | 2487 cricket::VideoSendParameters parameters; |
2487 parameters.codecs.push_back(GetEngineCodec("VP8")); | 2488 parameters.codecs.push_back(GetEngineCodec("VP8")); |
2488 parameters.codecs.push_back(GetEngineCodec("flexfec-03")); | 2489 parameters.codecs.push_back(GetEngineCodec("flexfec-03")); |
2489 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2490 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2490 | 2491 |
2491 FakeVideoSendStream* stream = AddSendStream( | 2492 FakeVideoSendStream* stream = AddSendStream( |
2492 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); | 2493 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); |
2493 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); | 2494 webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); |
2494 | 2495 |
2495 EXPECT_EQ(GetEngineCodec("flexfec-03").id, | 2496 EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.rtp.flexfec.payload_type); |
2496 config.rtp.flexfec.flexfec_payload_type); | 2497 EXPECT_EQ(kFlexfecSsrc, config.rtp.flexfec.ssrc); |
2497 EXPECT_EQ(kFlexfecSsrc, config.rtp.flexfec.flexfec_ssrc); | |
2498 ASSERT_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size()); | 2498 ASSERT_EQ(1U, config.rtp.flexfec.protected_media_ssrcs.size()); |
2499 EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]); | 2499 EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]); |
2500 | 2500 |
2501 parameters.codecs.pop_back(); | 2501 parameters.codecs.pop_back(); |
2502 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2502 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
2503 stream = fake_call_->GetVideoSendStreams()[0]; | 2503 stream = fake_call_->GetVideoSendStreams()[0]; |
2504 ASSERT_TRUE(stream != nullptr); | 2504 ASSERT_TRUE(stream != nullptr); |
2505 config = stream->GetConfig().Copy(); | 2505 config = stream->GetConfig().Copy(); |
2506 EXPECT_EQ(-1, config.rtp.flexfec.flexfec_payload_type) | 2506 EXPECT_EQ(-1, config.rtp.flexfec.payload_type) |
2507 << "SetSendCodec without FlexFEC should disable current FlexFEC."; | 2507 << "SetSendCodec without FlexFEC should disable current FlexFEC."; |
2508 } | 2508 } |
2509 | 2509 |
2510 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { | 2510 TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { |
2511 cricket::VideoSendParameters parameters; | 2511 cricket::VideoSendParameters parameters; |
2512 cricket::VideoCodec codec(100, "VP8"); | 2512 cricket::VideoCodec codec(100, "VP8"); |
2513 codec.SetParam(kCodecParamMaxQuantization, kDefaultQpMax); | 2513 codec.SetParam(kCodecParamMaxQuantization, kDefaultQpMax); |
2514 parameters.codecs.push_back(codec); | 2514 parameters.codecs.push_back(codec); |
2515 | 2515 |
2516 ASSERT_TRUE(channel_->SetSendParameters(parameters)); | 2516 ASSERT_TRUE(channel_->SetSendParameters(parameters)); |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4065 | 4065 |
4066 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { | 4066 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { |
4067 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); | 4067 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); |
4068 } | 4068 } |
4069 | 4069 |
4070 // Test that we normalize send codec format size in simulcast. | 4070 // Test that we normalize send codec format size in simulcast. |
4071 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 4071 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
4072 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); | 4072 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); |
4073 } | 4073 } |
4074 } // namespace cricket | 4074 } // namespace cricket |
OLD | NEW |