OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2008 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 EXPECT_FALSE(channel_->SetSendParameters(parameters)); | 282 EXPECT_FALSE(channel_->SetSendParameters(parameters)); |
283 } | 283 } |
284 EXPECT_EQ(expected_bitrate, GetCodecBitrate(kSsrc1)); | 284 EXPECT_EQ(expected_bitrate, GetCodecBitrate(kSsrc1)); |
285 } | 285 } |
286 | 286 |
287 // Sets the per-stream maximum bitrate limit for the specified SSRC. | 287 // Sets the per-stream maximum bitrate limit for the specified SSRC. |
288 bool SetMaxBitrateForStream(int32_t ssrc, int bitrate) { | 288 bool SetMaxBitrateForStream(int32_t ssrc, int bitrate) { |
289 webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(ssrc); | 289 webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(ssrc); |
290 EXPECT_EQ(1UL, parameters.encodings.size()); | 290 EXPECT_EQ(1UL, parameters.encodings.size()); |
291 | 291 |
292 parameters.encodings[0].max_bitrate_bps = bitrate; | 292 parameters.encodings[0].max_bitrate_bps = rtc::Optional<int>(bitrate); |
293 return channel_->SetRtpSendParameters(ssrc, parameters); | 293 return channel_->SetRtpSendParameters(ssrc, parameters); |
294 } | 294 } |
295 | 295 |
296 void SetGlobalMaxBitrate(const cricket::AudioCodec& codec, int bitrate) { | 296 void SetGlobalMaxBitrate(const cricket::AudioCodec& codec, int bitrate) { |
297 cricket::AudioSendParameters send_parameters; | 297 cricket::AudioSendParameters send_parameters; |
298 send_parameters.codecs.push_back(codec); | 298 send_parameters.codecs.push_back(codec); |
299 send_parameters.max_bandwidth_bps = bitrate; | 299 send_parameters.max_bandwidth_bps = bitrate; |
300 SetSendParameters(send_parameters); | 300 SetSendParameters(send_parameters); |
301 } | 301 } |
302 | 302 |
(...skipping 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3673 nullptr, webrtc::CreateBuiltinAudioDecoderFactory(), nullptr); | 3673 nullptr, webrtc::CreateBuiltinAudioDecoderFactory(), nullptr); |
3674 webrtc::RtcEventLogNullImpl event_log; | 3674 webrtc::RtcEventLogNullImpl event_log; |
3675 std::unique_ptr<webrtc::Call> call( | 3675 std::unique_ptr<webrtc::Call> call( |
3676 webrtc::Call::Create(webrtc::Call::Config(&event_log))); | 3676 webrtc::Call::Create(webrtc::Call::Config(&event_log))); |
3677 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), | 3677 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), |
3678 cricket::AudioOptions(), call.get()); | 3678 cricket::AudioOptions(), call.get()); |
3679 cricket::AudioRecvParameters parameters; | 3679 cricket::AudioRecvParameters parameters; |
3680 parameters.codecs = engine.recv_codecs(); | 3680 parameters.codecs = engine.recv_codecs(); |
3681 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3681 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
3682 } | 3682 } |
OLD | NEW |