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

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

Issue 2740783006: Support removing b=AS bandwidth constraints. (Closed)
Patch Set: update comment Created 3 years, 9 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 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after
2721 << "Setting max bitrate should keep previous min bitrate."; 2721 << "Setting max bitrate should keep previous min bitrate.";
2722 EXPECT_EQ(-1, fake_call_->GetConfig().bitrate_config.start_bitrate_bps) 2722 EXPECT_EQ(-1, fake_call_->GetConfig().bitrate_config.start_bitrate_bps)
2723 << "Setting max bitrate should not reset start bitrate."; 2723 << "Setting max bitrate should not reset start bitrate.";
2724 EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps); 2724 EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps);
2725 } 2725 }
2726 2726
2727 TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthShouldBeRemovable) { 2727 TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthShouldBeRemovable) {
2728 send_parameters_.max_bandwidth_bps = 300000; 2728 send_parameters_.max_bandwidth_bps = 300000;
2729 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2729 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2730 EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps); 2730 EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps);
2731 // <= 0 means disable (infinite) max bitrate. 2731 // -1 means to disable max bitrate (set infinite).
2732 send_parameters_.max_bandwidth_bps = 0; 2732 send_parameters_.max_bandwidth_bps = -1;
2733 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); 2733 EXPECT_TRUE(channel_->SetSendParameters(send_parameters_));
2734 EXPECT_EQ(-1, fake_call_->GetConfig().bitrate_config.max_bitrate_bps) 2734 EXPECT_EQ(-1, fake_call_->GetConfig().bitrate_config.max_bitrate_bps)
2735 << "Setting zero max bitrate did not reset start bitrate."; 2735 << "Setting zero max bitrate did not reset start bitrate.";
2736 } 2736 }
2737 2737
2738 TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthAndAddSendStream) { 2738 TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthAndAddSendStream) {
2739 send_parameters_.max_bandwidth_bps = 99999; 2739 send_parameters_.max_bandwidth_bps = 99999;
2740 FakeVideoSendStream* stream = AddSendStream(); 2740 FakeVideoSendStream* stream = AddSendStream();
2741 ASSERT_TRUE(channel_->SetSendParameters(send_parameters_)); 2741 ASSERT_TRUE(channel_->SetSendParameters(send_parameters_));
2742 EXPECT_EQ(send_parameters_.max_bandwidth_bps, 2742 EXPECT_EQ(send_parameters_.max_bandwidth_bps,
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 capturer.CaptureFrame(); 3860 capturer.CaptureFrame();
3861 3861
3862 int default_encoder_bitrate = GetMaxEncoderBitrate(); 3862 int default_encoder_bitrate = GetMaxEncoderBitrate();
3863 EXPECT_GT(default_encoder_bitrate, 1000); 3863 EXPECT_GT(default_encoder_bitrate, 1000);
3864 3864
3865 // TODO(skvlad): Resolve the inconsistency between the interpretation 3865 // TODO(skvlad): Resolve the inconsistency between the interpretation
3866 // of the global bitrate limit for audio and video: 3866 // of the global bitrate limit for audio and video:
3867 // - Audio: max_bandwidth_bps = 0 - fail the operation, 3867 // - Audio: max_bandwidth_bps = 0 - fail the operation,
3868 // max_bandwidth_bps = -1 - remove the bandwidth limit 3868 // max_bandwidth_bps = -1 - remove the bandwidth limit
3869 // - Video: max_bandwidth_bps = 0 - remove the bandwidth limit, 3869 // - Video: max_bandwidth_bps = 0 - remove the bandwidth limit,
3870 // max_bandwidth_bps = -1 - do not change the previously set 3870 // max_bandwidth_bps = -1 - remove the bandwidth limit
3871 // limit.
3872 3871
3873 SetAndExpectMaxBitrate(1000, 0, 1000); 3872 SetAndExpectMaxBitrate(1000, 0, 1000);
3874 SetAndExpectMaxBitrate(1000, 800, 800); 3873 SetAndExpectMaxBitrate(1000, 800, 800);
3875 SetAndExpectMaxBitrate(600, 800, 600); 3874 SetAndExpectMaxBitrate(600, 800, 600);
3876 SetAndExpectMaxBitrate(0, 800, 800); 3875 SetAndExpectMaxBitrate(0, 800, 800);
3877 SetAndExpectMaxBitrate(0, 0, default_encoder_bitrate); 3876 SetAndExpectMaxBitrate(0, 0, default_encoder_bitrate);
3878 3877
3879 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); 3878 EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr));
3880 } 3879 }
3881 3880
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
4355 } 4354 }
4356 4355
4357 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { 4356 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) {
4358 webrtc::test::ScopedFieldTrials override_field_trials_( 4357 webrtc::test::ScopedFieldTrials override_field_trials_(
4359 "WebRTC-SimulcastScreenshare/Enabled/"); 4358 "WebRTC-SimulcastScreenshare/Enabled/");
4360 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, 4359 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true,
4361 true); 4360 true);
4362 } 4361 }
4363 4362
4364 } // namespace cricket 4363 } // 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