OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 stream_config_.rtp.ssrc = kSsrc; | 98 stream_config_.rtp.ssrc = kSsrc; |
99 stream_config_.rtp.nack.rtp_history_ms = 200; | 99 stream_config_.rtp.nack.rtp_history_ms = 200; |
100 stream_config_.rtp.c_name = kCName; | 100 stream_config_.rtp.c_name = kCName; |
101 stream_config_.rtp.extensions.push_back( | 101 stream_config_.rtp.extensions.push_back( |
102 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); | 102 RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId)); |
103 stream_config_.rtp.extensions.push_back(RtpExtension( | 103 stream_config_.rtp.extensions.push_back(RtpExtension( |
104 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); | 104 RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId)); |
105 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_| | 105 // Use ISAC as default codec so as to prevent unnecessary |voice_engine_| |
106 // calls from the default ctor behavior. | 106 // calls from the default ctor behavior. |
107 stream_config_.send_codec_spec.codec_inst = kIsacCodec; | 107 stream_config_.send_codec_spec.codec_inst = kIsacCodec; |
108 stream_config_.min_bitrate_bps = 10000; | |
109 stream_config_.max_bitrate_bps = 65000; | |
110 } | 108 } |
111 | 109 |
112 AudioSendStream::Config& config() { return stream_config_; } | 110 AudioSendStream::Config& config() { return stream_config_; } |
113 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } | 111 rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; } |
114 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } | 112 MockVoEChannelProxy* channel_proxy() { return channel_proxy_; } |
115 CongestionController* congestion_controller() { | 113 CongestionController* congestion_controller() { |
116 return &congestion_controller_; | 114 return &congestion_controller_; |
117 } | 115 } |
118 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; } | 116 BitrateAllocator* bitrate_allocator() { return &bitrate_allocator_; } |
119 rtc::TaskQueue* worker_queue() { return &worker_queue_; } | 117 rtc::TaskQueue* worker_queue() { return &worker_queue_; } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 stream_config.send_codec_spec.cng_plfreq = 8000; | 393 stream_config.send_codec_spec.cng_plfreq = 8000; |
396 stream_config.send_codec_spec.cng_payload_type = 105; | 394 stream_config.send_codec_spec.cng_payload_type = 105; |
397 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _)) | 395 EXPECT_CALL(*helper.voice_engine(), SetVADStatus(kChannelId, true, _, _)) |
398 .WillOnce(Return(0)); | 396 .WillOnce(Return(0)); |
399 internal::AudioSendStream send_stream( | 397 internal::AudioSendStream send_stream( |
400 stream_config, helper.audio_state(), helper.worker_queue(), | 398 stream_config, helper.audio_state(), helper.worker_queue(), |
401 helper.congestion_controller(), helper.bitrate_allocator(), | 399 helper.congestion_controller(), helper.bitrate_allocator(), |
402 helper.event_log()); | 400 helper.event_log()); |
403 } | 401 } |
404 | 402 |
405 TEST(AudioSendStreamTest, DoesNotPassHigherBitrateThanMaxBitrate) { | |
406 ConfigHelper helper; | |
407 internal::AudioSendStream send_stream( | |
408 helper.config(), helper.audio_state(), helper.worker_queue(), | |
409 helper.congestion_controller(), helper.bitrate_allocator(), | |
410 helper.event_log()); | |
411 EXPECT_CALL(*helper.channel_proxy(), | |
412 SetBitrate(helper.config().max_bitrate_bps, _)); | |
413 send_stream.OnBitrateUpdated(helper.config().max_bitrate_bps + 5000, 0.0, 50, | |
414 6000); | |
415 } | |
416 | |
417 TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) { | |
418 ConfigHelper helper; | |
419 internal::AudioSendStream send_stream( | |
420 helper.config(), helper.audio_state(), helper.worker_queue(), | |
421 helper.congestion_controller(), helper.bitrate_allocator(), | |
422 helper.event_log()); | |
423 EXPECT_CALL(*helper.channel_proxy(), SetBitrate(_, 5000)); | |
424 send_stream.OnBitrateUpdated(50000, 0.0, 50, 5000); | |
425 } | |
426 | |
427 } // namespace test | 403 } // namespace test |
428 } // namespace webrtc | 404 } // namespace webrtc |
OLD | NEW |