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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 | 1168 |
1169 void SetAndExpectMaxBitrate(int global_max, | 1169 void SetAndExpectMaxBitrate(int global_max, |
1170 int stream_max, | 1170 int stream_max, |
1171 int expected_encoder_bitrate) { | 1171 int expected_encoder_bitrate) { |
1172 VideoSendParameters limited_send_params = send_parameters_; | 1172 VideoSendParameters limited_send_params = send_parameters_; |
1173 limited_send_params.max_bandwidth_bps = global_max; | 1173 limited_send_params.max_bandwidth_bps = global_max; |
1174 EXPECT_TRUE(channel_->SetSendParameters(limited_send_params)); | 1174 EXPECT_TRUE(channel_->SetSendParameters(limited_send_params)); |
1175 webrtc::RtpParameters parameters = | 1175 webrtc::RtpParameters parameters = |
1176 channel_->GetRtpSendParameters(last_ssrc_); | 1176 channel_->GetRtpSendParameters(last_ssrc_); |
1177 EXPECT_EQ(1UL, parameters.encodings.size()); | 1177 EXPECT_EQ(1UL, parameters.encodings.size()); |
1178 parameters.encodings[0].max_bitrate_bps = stream_max; | 1178 parameters.encodings[0].max_bitrate_bps = rtc::Optional<int>(stream_max); |
1179 EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters)); | 1179 EXPECT_TRUE(channel_->SetRtpSendParameters(last_ssrc_, parameters)); |
1180 // Read back the parameteres and verify they have the correct value | 1180 // Read back the parameteres and verify they have the correct value |
1181 parameters = channel_->GetRtpSendParameters(last_ssrc_); | 1181 parameters = channel_->GetRtpSendParameters(last_ssrc_); |
1182 EXPECT_EQ(1UL, parameters.encodings.size()); | 1182 EXPECT_EQ(1UL, parameters.encodings.size()); |
1183 EXPECT_EQ(stream_max, parameters.encodings[0].max_bitrate_bps); | 1183 EXPECT_EQ(rtc::Optional<int>(stream_max), |
| 1184 parameters.encodings[0].max_bitrate_bps); |
1184 // Verify that the new value propagated down to the encoder | 1185 // Verify that the new value propagated down to the encoder |
1185 EXPECT_EQ(expected_encoder_bitrate, GetMaxEncoderBitrate()); | 1186 EXPECT_EQ(expected_encoder_bitrate, GetMaxEncoderBitrate()); |
1186 } | 1187 } |
1187 | 1188 |
1188 std::unique_ptr<FakeCall> fake_call_; | 1189 std::unique_ptr<FakeCall> fake_call_; |
1189 std::unique_ptr<VideoMediaChannel> channel_; | 1190 std::unique_ptr<VideoMediaChannel> channel_; |
1190 cricket::VideoSendParameters send_parameters_; | 1191 cricket::VideoSendParameters send_parameters_; |
1191 cricket::VideoRecvParameters recv_parameters_; | 1192 cricket::VideoRecvParameters recv_parameters_; |
1192 uint32_t last_ssrc_; | 1193 uint32_t last_ssrc_; |
1193 }; | 1194 }; |
(...skipping 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4091 | 4092 |
4092 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { | 4093 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { |
4093 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); | 4094 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3); |
4094 } | 4095 } |
4095 | 4096 |
4096 // Test that we normalize send codec format size in simulcast. | 4097 // Test that we normalize send codec format size in simulcast. |
4097 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { | 4098 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { |
4098 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); | 4099 VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2); |
4099 } | 4100 } |
4100 } // namespace cricket | 4101 } // namespace cricket |
OLD | NEW |