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 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 | 1169 |
1170 void SetAndExpectMaxBitrate(int global_max, | 1170 void SetAndExpectMaxBitrate(int global_max, |
1171 int stream_max, | 1171 int stream_max, |
1172 int expected_encoder_bitrate) { | 1172 int expected_encoder_bitrate) { |
1173 VideoSendParameters limited_send_params = send_parameters_; | 1173 VideoSendParameters limited_send_params = send_parameters_; |
1174 limited_send_params.max_bandwidth_bps = global_max; | 1174 limited_send_params.max_bandwidth_bps = global_max; |
1175 EXPECT_TRUE(channel_->SetSendParameters(limited_send_params)); | 1175 EXPECT_TRUE(channel_->SetSendParameters(limited_send_params)); |
1176 webrtc::RtpParameters parameters = | 1176 webrtc::RtpParameters parameters = |
1177 channel_->GetRtpSendParameters(last_ssrc_); | 1177 channel_->GetRtpSendParameters(last_ssrc_); |
1178 EXPECT_EQ(1UL, parameters.encodings.size()); | 1178 EXPECT_EQ(1UL, parameters.encodings.size()); |
1179 parameters.encodings[0].max_bitrate_bps = stream_max; | 1179 parameters.encodings[0].max_bitrate_bps = rtc::Optional<int>(stream_max); |
1180 EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters)); | 1180 EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters)); |
1181 // Read back the parameteres and verify they have the correct value | 1181 // Read back the parameteres and verify they have the correct value |
1182 parameters = channel_->GetRtpSendParameters(last_ssrc_); | 1182 parameters = channel_->GetRtpSendParameters(last_ssrc_); |
1183 EXPECT_EQ(1UL, parameters.encodings.size()); | 1183 EXPECT_EQ(1UL, parameters.encodings.size()); |
1184 EXPECT_EQ(stream_max, parameters.encodings[0].max_bitrate_bps); | 1184 EXPECT_EQ(rtc::Optional<int>(stream_max), |
| 1185 parameters.encodings[0].max_bitrate_bps); |
1185 // Verify that the new value propagated down to the encoder | 1186 // Verify that the new value propagated down to the encoder |
1186 EXPECT_EQ(expected_encoder_bitrate, GetMaxEncoderBitrate()); | 1187 EXPECT_EQ(expected_encoder_bitrate, GetMaxEncoderBitrate()); |
1187 } | 1188 } |
1188 | 1189 |
1189 std::unique_ptr<FakeCall> fake_call_; | 1190 std::unique_ptr<FakeCall> fake_call_; |
1190 std::unique_ptr<VideoMediaChannel> channel_; | 1191 std::unique_ptr<VideoMediaChannel> channel_; |
1191 cricket::VideoSendParameters send_parameters_; | 1192 cricket::VideoSendParameters send_parameters_; |
1192 cricket::VideoRecvParameters recv_parameters_; | 1193 cricket::VideoRecvParameters recv_parameters_; |
1193 uint32_t last_ssrc_; | 1194 uint32_t last_ssrc_; |
1194 }; | 1195 }; |
(...skipping 3025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4220 } | 4221 } |
4221 | 4222 |
4222 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { | 4223 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { |
4223 webrtc::test::ScopedFieldTrials override_field_trials_( | 4224 webrtc::test::ScopedFieldTrials override_field_trials_( |
4224 "WebRTC-SimulcastScreenshare/Enabled/"); | 4225 "WebRTC-SimulcastScreenshare/Enabled/"); |
4225 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, | 4226 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, |
4226 true); | 4227 true); |
4227 } | 4228 } |
4228 | 4229 |
4229 } // namespace cricket | 4230 } // namespace cricket |
OLD | NEW |