OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 Call::Call(const Call::Config& config) | 142 Call::Call(const Call::Config& config) |
143 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), | 143 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), |
144 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), | 144 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), |
145 call_stats_(new CallStats()), | 145 call_stats_(new CallStats()), |
146 congestion_controller_(new CongestionController( | 146 congestion_controller_(new CongestionController( |
147 module_process_thread_.get(), call_stats_.get())), | 147 module_process_thread_.get(), call_stats_.get())), |
148 config_(config), | 148 config_(config), |
149 network_enabled_(true), | 149 network_enabled_(true), |
150 receive_crit_(RWLockWrapper::CreateRWLock()), | 150 receive_crit_(RWLockWrapper::CreateRWLock()), |
151 send_crit_(RWLockWrapper::CreateRWLock()) { | 151 send_crit_(RWLockWrapper::CreateRWLock()) { |
152 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | |
153 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); | 152 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
154 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, | 153 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, |
155 config.bitrate_config.min_bitrate_bps); | 154 config.bitrate_config.min_bitrate_bps); |
156 if (config.bitrate_config.max_bitrate_bps != -1) { | 155 if (config.bitrate_config.max_bitrate_bps != -1) { |
157 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, | 156 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
158 config.bitrate_config.start_bitrate_bps); | 157 config.bitrate_config.start_bitrate_bps); |
159 } | 158 } |
160 if (config.voice_engine) { | 159 if (config.voice_engine) { |
161 // Keep a reference to VoECodec, so we're sure the VoiceEngine lives for the | 160 // Keep a reference to VoECodec, so we're sure the VoiceEngine lives for the |
162 // duration of the call. | 161 // duration of the call. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 195 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
197 // thread. Re-enable once that is fixed. | 196 // thread. Re-enable once that is fixed. |
198 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 197 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
199 return this; | 198 return this; |
200 } | 199 } |
201 | 200 |
202 webrtc::AudioSendStream* Call::CreateAudioSendStream( | 201 webrtc::AudioSendStream* Call::CreateAudioSendStream( |
203 const webrtc::AudioSendStream::Config& config) { | 202 const webrtc::AudioSendStream::Config& config) { |
204 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); | 203 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); |
205 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 204 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
206 AudioSendStream* send_stream = new AudioSendStream(config); | 205 AudioSendStream* send_stream = |
| 206 new AudioSendStream(config, config_.voice_engine); |
207 { | 207 { |
208 rtc::CritScope lock(&network_enabled_crit_); | 208 rtc::CritScope lock(&network_enabled_crit_); |
209 WriteLockScoped write_lock(*send_crit_); | 209 WriteLockScoped write_lock(*send_crit_); |
210 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == | 210 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == |
211 audio_send_ssrcs_.end()); | 211 audio_send_ssrcs_.end()); |
212 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; | 212 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; |
213 | 213 |
214 if (!network_enabled_) | 214 if (!network_enabled_) |
215 send_stream->SignalNetworkState(kNetworkDown); | 215 send_stream->SignalNetworkState(kNetworkDown); |
216 } | 216 } |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // thread. Then this check can be enabled. | 606 // thread. Then this check can be enabled. |
607 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 607 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
608 if (RtpHeaderParser::IsRtcp(packet, length)) | 608 if (RtpHeaderParser::IsRtcp(packet, length)) |
609 return DeliverRtcp(media_type, packet, length); | 609 return DeliverRtcp(media_type, packet, length); |
610 | 610 |
611 return DeliverRtp(media_type, packet, length, packet_time); | 611 return DeliverRtp(media_type, packet, length, packet_time); |
612 } | 612 } |
613 | 613 |
614 } // namespace internal | 614 } // namespace internal |
615 } // namespace webrtc | 615 } // namespace webrtc |
OLD | NEW |