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