Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 2911913002: Recreate FlexfecReceiveStream separately from VideoReceiveStream. (Closed)
Patch Set: perkj comments 1. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2503 fake_call_->GetFlexfecReceiveStreams(); 2503 fake_call_->GetFlexfecReceiveStreams();
2504 ASSERT_EQ(1U, streams.size()); 2504 ASSERT_EQ(1U, streams.size());
2505 const FakeFlexfecReceiveStream* stream = streams.front(); 2505 const FakeFlexfecReceiveStream* stream = streams.front();
2506 const webrtc::FlexfecReceiveStream::Config& config = stream->GetConfig(); 2506 const webrtc::FlexfecReceiveStream::Config& config = stream->GetConfig();
2507 EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.payload_type); 2507 EXPECT_EQ(GetEngineCodec("flexfec-03").id, config.payload_type);
2508 EXPECT_EQ(kFlexfecSsrc, config.remote_ssrc); 2508 EXPECT_EQ(kFlexfecSsrc, config.remote_ssrc);
2509 ASSERT_EQ(1U, config.protected_media_ssrcs.size()); 2509 ASSERT_EQ(1U, config.protected_media_ssrcs.size());
2510 EXPECT_EQ(kSsrcs1[0], config.protected_media_ssrcs[0]); 2510 EXPECT_EQ(kSsrcs1[0], config.protected_media_ssrcs[0]);
2511 } 2511 }
2512 2512
2513 TEST_F(WebRtcVideoChannel2FlexfecRecvTest,
2514 EnablingFlexfecDoesNotRecreateVideoReceiveStream) {
2515 cricket::VideoRecvParameters recv_parameters;
2516 recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
2517 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2518
2519 AddRecvStream(
2520 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
2521 EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams());
2522 EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size());
2523
2524 // Enable FlexFEC.
2525 recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
2526 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2527 EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams())
2528 << "Enabling FlexFEC should create FlexfecReceiveStream.";
2529 EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size())
2530 << "Enabling FlexFEC should not create VideoReceiveStream.";
2531 EXPECT_EQ(1U, fake_call_->GetFlexfecReceiveStreams().size())
2532 << "Enabling FlexFEC should create a single FlexfecReceiveStream.";
2533 }
2534
2535 TEST_F(WebRtcVideoChannel2FlexfecRecvTest,
2536 DisablingFlexfecDoesNotRecreateVideoReceiveStream) {
2537 cricket::VideoRecvParameters recv_parameters;
2538 recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
2539 recv_parameters.codecs.push_back(GetEngineCodec("flexfec-03"));
2540 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2541
2542 AddRecvStream(
2543 CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc));
2544 EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams());
2545 EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size());
2546 EXPECT_EQ(1U, fake_call_->GetFlexfecReceiveStreams().size());
2547
2548 // Disable FlexFEC.
2549 recv_parameters.codecs.clear();
2550 recv_parameters.codecs.push_back(GetEngineCodec("VP8"));
2551 ASSERT_TRUE(channel_->SetRecvParameters(recv_parameters));
2552 EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams())
2553 << "Disabling FlexFEC should not recreate VideoReceiveStream.";
2554 EXPECT_EQ(1U, fake_call_->GetVideoReceiveStreams().size())
2555 << "Disabling FlexFEC should not destroy VideoReceiveStream.";
2556 EXPECT_TRUE(fake_call_->GetFlexfecReceiveStreams().empty())
2557 << "Disabling FlexFEC should destroy FlexfecReceiveStream.";
2558 }
2559
2513 // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all 2560 // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all
2514 // tests that use this test fixture into the corresponding "non-field trial" 2561 // tests that use this test fixture into the corresponding "non-field trial"
2515 // tests. 2562 // tests.
2516 class WebRtcVideoChannel2FlexfecSendRecvTest : public WebRtcVideoChannel2Test { 2563 class WebRtcVideoChannel2FlexfecSendRecvTest : public WebRtcVideoChannel2Test {
2517 public: 2564 public:
2518 WebRtcVideoChannel2FlexfecSendRecvTest() 2565 WebRtcVideoChannel2FlexfecSendRecvTest()
2519 : WebRtcVideoChannel2Test( 2566 : WebRtcVideoChannel2Test(
2520 "WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/") { 2567 "WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/") {
2521 } 2568 }
2522 }; 2569 };
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after
4528 4575
4529 TEST_F(WebRtcVideoChannel2SimulcastTest, 4576 TEST_F(WebRtcVideoChannel2SimulcastTest,
4530 NoSimulcastScreenshareWithoutConference) { 4577 NoSimulcastScreenshareWithoutConference) {
4531 webrtc::test::ScopedFieldTrials override_field_trials_( 4578 webrtc::test::ScopedFieldTrials override_field_trials_(
4532 "WebRTC-SimulcastScreenshare/Enabled/"); 4579 "WebRTC-SimulcastScreenshare/Enabled/");
4533 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, 4580 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true,
4534 false); 4581 false);
4535 } 4582 }
4536 4583
4537 } // namespace cricket 4584 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698