| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Call::Call(const Call::Config& config) | 138 Call::Call(const Call::Config& config) |
| 139 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), | 139 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), |
| 140 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), | 140 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), |
| 141 call_stats_(new CallStats()), | 141 call_stats_(new CallStats()), |
| 142 congestion_controller_(new CongestionController( | 142 congestion_controller_(new CongestionController( |
| 143 module_process_thread_.get(), call_stats_.get())), | 143 module_process_thread_.get(), call_stats_.get())), |
| 144 config_(config), | 144 config_(config), |
| 145 network_enabled_(true), | 145 network_enabled_(true), |
| 146 receive_crit_(RWLockWrapper::CreateRWLock()), | 146 receive_crit_(RWLockWrapper::CreateRWLock()), |
| 147 send_crit_(RWLockWrapper::CreateRWLock()) { | 147 send_crit_(RWLockWrapper::CreateRWLock()) { |
| 148 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | |
| 149 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); | 148 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
| 150 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, | 149 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, |
| 151 config.bitrate_config.min_bitrate_bps); | 150 config.bitrate_config.min_bitrate_bps); |
| 152 if (config.bitrate_config.max_bitrate_bps != -1) { | 151 if (config.bitrate_config.max_bitrate_bps != -1) { |
| 153 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, | 152 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
| 154 config.bitrate_config.start_bitrate_bps); | 153 config.bitrate_config.start_bitrate_bps); |
| 155 } | 154 } |
| 156 if (config.voice_engine) { | 155 if (config.voice_engine) { |
| 157 // Keep a reference to VoECodec, so we're sure the VoiceEngine lives for the | 156 // Keep a reference to VoECodec, so we're sure the VoiceEngine lives for the |
| 158 // duration of the call. | 157 // duration of the call. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 191 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
| 193 // thread. Re-enable once that is fixed. | 192 // thread. Re-enable once that is fixed. |
| 194 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 193 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 195 return this; | 194 return this; |
| 196 } | 195 } |
| 197 | 196 |
| 198 webrtc::AudioSendStream* Call::CreateAudioSendStream( | 197 webrtc::AudioSendStream* Call::CreateAudioSendStream( |
| 199 const webrtc::AudioSendStream::Config& config) { | 198 const webrtc::AudioSendStream::Config& config) { |
| 200 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); | 199 TRACE_EVENT0("webrtc", "Call::CreateAudioSendStream"); |
| 201 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 200 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
| 202 AudioSendStream* send_stream = new AudioSendStream(config); | 201 AudioSendStream* send_stream = |
| 202 new AudioSendStream(config, config_.voice_engine); |
| 203 if (!network_enabled_) | 203 if (!network_enabled_) |
| 204 send_stream->SignalNetworkState(kNetworkDown); | 204 send_stream->SignalNetworkState(kNetworkDown); |
| 205 { | 205 { |
| 206 WriteLockScoped write_lock(*send_crit_); | 206 WriteLockScoped write_lock(*send_crit_); |
| 207 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == | 207 RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) == |
| 208 audio_send_ssrcs_.end()); | 208 audio_send_ssrcs_.end()); |
| 209 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; | 209 audio_send_ssrcs_[config.rtp.ssrc] = send_stream; |
| 210 } | 210 } |
| 211 return send_stream; | 211 return send_stream; |
| 212 } | 212 } |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 // thread. Then this check can be enabled. | 592 // thread. Then this check can be enabled. |
| 593 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 593 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 594 if (RtpHeaderParser::IsRtcp(packet, length)) | 594 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 595 return DeliverRtcp(media_type, packet, length); | 595 return DeliverRtcp(media_type, packet, length); |
| 596 | 596 |
| 597 return DeliverRtp(media_type, packet, length, packet_time); | 597 return DeliverRtp(media_type, packet, length, packet_time); |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace internal | 600 } // namespace internal |
| 601 } // namespace webrtc | 601 } // namespace webrtc |
| OLD | NEW |