| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { | 186 void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) { |
| 187 // TODO(pbos): When adding AudioSendStream, add both TRACE_EVENT0 and config | 187 // TODO(pbos): When adding AudioSendStream, add both TRACE_EVENT0 and config |
| 188 // logging to AudioSendStream destructor. | 188 // logging to AudioSendStream destructor. |
| 189 } | 189 } |
| 190 | 190 |
| 191 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( | 191 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
| 192 const webrtc::AudioReceiveStream::Config& config) { | 192 const webrtc::AudioReceiveStream::Config& config) { |
| 193 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); | 193 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); |
| 194 AudioReceiveStream* receive_stream = new AudioReceiveStream( | 194 AudioReceiveStream* receive_stream = new AudioReceiveStream( |
| 195 channel_group_->GetRemoteBitrateEstimator(), config); | 195 channel_group_->GetRemoteBitrateEstimator(false), config); |
| 196 { | 196 { |
| 197 WriteLockScoped write_lock(*receive_crit_); | 197 WriteLockScoped write_lock(*receive_crit_); |
| 198 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == | 198 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
| 199 audio_receive_ssrcs_.end()); | 199 audio_receive_ssrcs_.end()); |
| 200 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; | 200 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; |
| 201 ConfigureSync(config.sync_group); | 201 ConfigureSync(config.sync_group); |
| 202 } | 202 } |
| 203 return receive_stream; | 203 return receive_stream; |
| 204 } | 204 } |
| 205 | 205 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 delete send_stream_impl; | 288 delete send_stream_impl; |
| 289 } | 289 } |
| 290 | 290 |
| 291 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( | 291 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
| 292 const webrtc::VideoReceiveStream::Config& config) { | 292 const webrtc::VideoReceiveStream::Config& config) { |
| 293 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); | 293 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); |
| 294 VideoReceiveStream* receive_stream = new VideoReceiveStream( | 294 VideoReceiveStream* receive_stream = new VideoReceiveStream( |
| 295 num_cpu_cores_, channel_group_.get(), | 295 num_cpu_cores_, channel_group_.get(), |
| 296 rtc::AtomicOps::Increment(&next_channel_id_), config, | 296 rtc::AtomicOps::Increment(&next_channel_id_), config, |
| 297 config_.voice_engine); | 297 config_.voice_engine, module_process_thread_.get()); |
| 298 | 298 |
| 299 // This needs to be taken before receive_crit_ as both locks need to be held | 299 // This needs to be taken before receive_crit_ as both locks need to be held |
| 300 // while changing network state. | 300 // while changing network state. |
| 301 rtc::CritScope lock(&network_enabled_crit_); | 301 rtc::CritScope lock(&network_enabled_crit_); |
| 302 WriteLockScoped write_lock(*receive_crit_); | 302 WriteLockScoped write_lock(*receive_crit_); |
| 303 RTC_DCHECK(video_receive_ssrcs_.find(config.rtp.remote_ssrc) == | 303 RTC_DCHECK(video_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
| 304 video_receive_ssrcs_.end()); | 304 video_receive_ssrcs_.end()); |
| 305 video_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; | 305 video_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; |
| 306 // TODO(pbos): Configure different RTX payloads per receive payload. | 306 // TODO(pbos): Configure different RTX payloads per receive payload. |
| 307 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = | 307 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 delete receive_stream_impl; | 348 delete receive_stream_impl; |
| 349 } | 349 } |
| 350 | 350 |
| 351 Call::Stats Call::GetStats() const { | 351 Call::Stats Call::GetStats() const { |
| 352 Stats stats; | 352 Stats stats; |
| 353 // Fetch available send/receive bitrates. | 353 // Fetch available send/receive bitrates. |
| 354 uint32_t send_bandwidth = 0; | 354 uint32_t send_bandwidth = 0; |
| 355 channel_group_->GetBitrateController()->AvailableBandwidth(&send_bandwidth); | 355 channel_group_->GetBitrateController()->AvailableBandwidth(&send_bandwidth); |
| 356 std::vector<unsigned int> ssrcs; | 356 std::vector<unsigned int> ssrcs; |
| 357 uint32_t recv_bandwidth = 0; | 357 uint32_t recv_bandwidth = 0; |
| 358 channel_group_->GetRemoteBitrateEstimator()->LatestEstimate(&ssrcs, | 358 channel_group_->GetRemoteBitrateEstimator(false)->LatestEstimate( |
| 359 &recv_bandwidth); | 359 &ssrcs, &recv_bandwidth); |
| 360 stats.send_bandwidth_bps = send_bandwidth; | 360 stats.send_bandwidth_bps = send_bandwidth; |
| 361 stats.recv_bandwidth_bps = recv_bandwidth; | 361 stats.recv_bandwidth_bps = recv_bandwidth; |
| 362 stats.pacer_delay_ms = channel_group_->GetPacerQueuingDelayMs(); | 362 stats.pacer_delay_ms = channel_group_->GetPacerQueuingDelayMs(); |
| 363 { | 363 { |
| 364 ReadLockScoped read_lock(*send_crit_); | 364 ReadLockScoped read_lock(*send_crit_); |
| 365 for (const auto& kv : video_send_ssrcs_) { | 365 for (const auto& kv : video_send_ssrcs_) { |
| 366 int rtt_ms = kv.second->GetRtt(); | 366 int rtt_ms = kv.second->GetRtt(); |
| 367 if (rtt_ms > 0) | 367 if (rtt_ms > 0) |
| 368 stats.rtt_ms = rtt_ms; | 368 stats.rtt_ms = rtt_ms; |
| 369 } | 369 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 size_t length, | 538 size_t length, |
| 539 const PacketTime& packet_time) { | 539 const PacketTime& packet_time) { |
| 540 if (RtpHeaderParser::IsRtcp(packet, length)) | 540 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 541 return DeliverRtcp(media_type, packet, length); | 541 return DeliverRtcp(media_type, packet, length); |
| 542 | 542 |
| 543 return DeliverRtp(media_type, packet, length, packet_time); | 543 return DeliverRtp(media_type, packet, length, packet_time); |
| 544 } | 544 } |
| 545 | 545 |
| 546 } // namespace internal | 546 } // namespace internal |
| 547 } // namespace webrtc | 547 } // namespace webrtc |
| OLD | NEW |