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 |
11 #include <string.h> | 11 #include <string.h> |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/audio/audio_receive_stream.h" | 16 #include "webrtc/audio/audio_receive_stream.h" |
17 #include "webrtc/audio/audio_send_stream.h" | 17 #include "webrtc/audio/audio_send_stream.h" |
18 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/scoped_ptr.h" | 19 #include "webrtc/base/scoped_ptr.h" |
20 #include "webrtc/base/thread_annotations.h" | 20 #include "webrtc/base/thread_annotations.h" |
21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
22 #include "webrtc/base/trace_event.h" | 22 #include "webrtc/base/trace_event.h" |
23 #include "webrtc/call.h" | 23 #include "webrtc/call.h" |
| 24 #include "webrtc/call/congestion_controller.h" |
24 #include "webrtc/call/rtc_event_log.h" | 25 #include "webrtc/call/rtc_event_log.h" |
25 #include "webrtc/common.h" | 26 #include "webrtc/common.h" |
26 #include "webrtc/config.h" | 27 #include "webrtc/config.h" |
27 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" | 28 #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" |
28 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 29 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
29 #include "webrtc/modules/utility/interface/process_thread.h" | 30 #include "webrtc/modules/utility/interface/process_thread.h" |
30 #include "webrtc/system_wrappers/interface/cpu_info.h" | 31 #include "webrtc/system_wrappers/interface/cpu_info.h" |
31 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" | 32 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" |
32 #include "webrtc/system_wrappers/interface/logging.h" | 33 #include "webrtc/system_wrappers/interface/logging.h" |
33 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" | 34 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 const uint8_t* packet, | 90 const uint8_t* packet, |
90 size_t length, | 91 size_t length, |
91 const PacketTime& packet_time); | 92 const PacketTime& packet_time); |
92 | 93 |
93 void ConfigureSync(const std::string& sync_group) | 94 void ConfigureSync(const std::string& sync_group) |
94 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); | 95 EXCLUSIVE_LOCKS_REQUIRED(receive_crit_); |
95 | 96 |
96 const int num_cpu_cores_; | 97 const int num_cpu_cores_; |
97 const rtc::scoped_ptr<ProcessThread> module_process_thread_; | 98 const rtc::scoped_ptr<ProcessThread> module_process_thread_; |
98 const rtc::scoped_ptr<CallStats> call_stats_; | 99 const rtc::scoped_ptr<CallStats> call_stats_; |
99 const rtc::scoped_ptr<ChannelGroup> channel_group_; | 100 const rtc::scoped_ptr<CongestionController> congestion_controller_; |
100 Call::Config config_; | 101 Call::Config config_; |
101 rtc::ThreadChecker configuration_thread_checker_; | 102 rtc::ThreadChecker configuration_thread_checker_; |
102 | 103 |
103 // Needs to be held while write-locking |receive_crit_| or |send_crit_|. This | 104 // Needs to be held while write-locking |receive_crit_| or |send_crit_|. This |
104 // ensures that we have a consistent network state signalled to all senders | 105 // ensures that we have a consistent network state signalled to all senders |
105 // and receivers. | 106 // and receivers. |
106 rtc::CriticalSection network_enabled_crit_; | 107 rtc::CriticalSection network_enabled_crit_; |
107 bool network_enabled_ GUARDED_BY(network_enabled_crit_); | 108 bool network_enabled_ GUARDED_BY(network_enabled_crit_); |
108 | 109 |
109 rtc::scoped_ptr<RWLockWrapper> receive_crit_; | 110 rtc::scoped_ptr<RWLockWrapper> receive_crit_; |
(...skipping 24 matching lines...) Expand all Loading... |
134 Call* Call::Create(const Call::Config& config) { | 135 Call* Call::Create(const Call::Config& config) { |
135 return new internal::Call(config); | 136 return new internal::Call(config); |
136 } | 137 } |
137 | 138 |
138 namespace internal { | 139 namespace internal { |
139 | 140 |
140 Call::Call(const Call::Config& config) | 141 Call::Call(const Call::Config& config) |
141 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), | 142 : num_cpu_cores_(CpuInfo::DetectNumberOfCores()), |
142 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), | 143 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), |
143 call_stats_(new CallStats()), | 144 call_stats_(new CallStats()), |
144 channel_group_(new ChannelGroup(module_process_thread_.get(), | 145 congestion_controller_(new CongestionController( |
145 call_stats_.get())), | 146 module_process_thread_.get(), call_stats_.get())), |
146 config_(config), | 147 config_(config), |
147 network_enabled_(true), | 148 network_enabled_(true), |
148 receive_crit_(RWLockWrapper::CreateRWLock()), | 149 receive_crit_(RWLockWrapper::CreateRWLock()), |
149 send_crit_(RWLockWrapper::CreateRWLock()), | 150 send_crit_(RWLockWrapper::CreateRWLock()), |
150 event_log_(nullptr) { | 151 event_log_(nullptr) { |
151 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 152 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
152 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); | 153 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
153 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, | 154 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, |
154 config.bitrate_config.min_bitrate_bps); | 155 config.bitrate_config.min_bitrate_bps); |
155 if (config.bitrate_config.max_bitrate_bps != -1) { | 156 if (config.bitrate_config.max_bitrate_bps != -1) { |
156 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, | 157 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
157 config.bitrate_config.start_bitrate_bps); | 158 config.bitrate_config.start_bitrate_bps); |
158 } | 159 } |
159 if (config.voice_engine) { | 160 if (config.voice_engine) { |
160 VoECodec* voe_codec = VoECodec::GetInterface(config.voice_engine); | 161 VoECodec* voe_codec = VoECodec::GetInterface(config.voice_engine); |
161 if (voe_codec) { | 162 if (voe_codec) { |
162 event_log_ = voe_codec->GetEventLog(); | 163 event_log_ = voe_codec->GetEventLog(); |
163 voe_codec->Release(); | 164 voe_codec->Release(); |
164 } | 165 } |
165 } | 166 } |
166 | 167 |
167 Trace::CreateTrace(); | 168 Trace::CreateTrace(); |
168 module_process_thread_->Start(); | 169 module_process_thread_->Start(); |
169 module_process_thread_->RegisterModule(call_stats_.get()); | 170 module_process_thread_->RegisterModule(call_stats_.get()); |
170 | 171 |
171 channel_group_->SetBweBitrates(config_.bitrate_config.min_bitrate_bps, | 172 congestion_controller_->SetBweBitrates( |
172 config_.bitrate_config.start_bitrate_bps, | 173 config_.bitrate_config.min_bitrate_bps, |
173 config_.bitrate_config.max_bitrate_bps); | 174 config_.bitrate_config.start_bitrate_bps, |
| 175 config_.bitrate_config.max_bitrate_bps); |
174 } | 176 } |
175 | 177 |
176 Call::~Call() { | 178 Call::~Call() { |
177 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 179 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
178 RTC_CHECK(audio_send_ssrcs_.empty()); | 180 RTC_CHECK(audio_send_ssrcs_.empty()); |
179 RTC_CHECK(video_send_ssrcs_.empty()); | 181 RTC_CHECK(video_send_ssrcs_.empty()); |
180 RTC_CHECK(video_send_streams_.empty()); | 182 RTC_CHECK(video_send_streams_.empty()); |
181 RTC_CHECK(audio_receive_ssrcs_.empty()); | 183 RTC_CHECK(audio_receive_ssrcs_.empty()); |
182 RTC_CHECK(video_receive_ssrcs_.empty()); | 184 RTC_CHECK(video_receive_ssrcs_.empty()); |
183 RTC_CHECK(video_receive_streams_.empty()); | 185 RTC_CHECK(video_receive_streams_.empty()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 RTC_DCHECK(num_deleted == 1); | 230 RTC_DCHECK(num_deleted == 1); |
229 } | 231 } |
230 delete audio_send_stream; | 232 delete audio_send_stream; |
231 } | 233 } |
232 | 234 |
233 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( | 235 webrtc::AudioReceiveStream* Call::CreateAudioReceiveStream( |
234 const webrtc::AudioReceiveStream::Config& config) { | 236 const webrtc::AudioReceiveStream::Config& config) { |
235 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); | 237 TRACE_EVENT0("webrtc", "Call::CreateAudioReceiveStream"); |
236 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 238 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
237 AudioReceiveStream* receive_stream = new AudioReceiveStream( | 239 AudioReceiveStream* receive_stream = new AudioReceiveStream( |
238 channel_group_->GetRemoteBitrateEstimator(false), config); | 240 congestion_controller_->GetRemoteBitrateEstimator(false), config); |
239 { | 241 { |
240 WriteLockScoped write_lock(*receive_crit_); | 242 WriteLockScoped write_lock(*receive_crit_); |
241 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == | 243 RTC_DCHECK(audio_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
242 audio_receive_ssrcs_.end()); | 244 audio_receive_ssrcs_.end()); |
243 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; | 245 audio_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; |
244 ConfigureSync(config.sync_group); | 246 ConfigureSync(config.sync_group); |
245 } | 247 } |
246 return receive_stream; | 248 return receive_stream; |
247 } | 249 } |
248 | 250 |
(...skipping 21 matching lines...) Expand all Loading... |
270 } | 272 } |
271 | 273 |
272 webrtc::VideoSendStream* Call::CreateVideoSendStream( | 274 webrtc::VideoSendStream* Call::CreateVideoSendStream( |
273 const webrtc::VideoSendStream::Config& config, | 275 const webrtc::VideoSendStream::Config& config, |
274 const VideoEncoderConfig& encoder_config) { | 276 const VideoEncoderConfig& encoder_config) { |
275 TRACE_EVENT0("webrtc", "Call::CreateVideoSendStream"); | 277 TRACE_EVENT0("webrtc", "Call::CreateVideoSendStream"); |
276 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 278 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
277 | 279 |
278 // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if | 280 // TODO(mflodman): Base the start bitrate on a current bandwidth estimate, if |
279 // the call has already started. | 281 // the call has already started. |
280 VideoSendStream* send_stream = new VideoSendStream(num_cpu_cores_, | 282 VideoSendStream* send_stream = new VideoSendStream( |
281 module_process_thread_.get(), call_stats_.get(), channel_group_.get(), | 283 num_cpu_cores_, module_process_thread_.get(), call_stats_.get(), |
282 config, encoder_config, suspended_video_send_ssrcs_); | 284 congestion_controller_.get(), config, encoder_config, |
| 285 suspended_video_send_ssrcs_); |
283 | 286 |
284 // This needs to be taken before send_crit_ as both locks need to be held | 287 // This needs to be taken before send_crit_ as both locks need to be held |
285 // while changing network state. | 288 // while changing network state. |
286 rtc::CritScope lock(&network_enabled_crit_); | 289 rtc::CritScope lock(&network_enabled_crit_); |
287 WriteLockScoped write_lock(*send_crit_); | 290 WriteLockScoped write_lock(*send_crit_); |
288 for (uint32_t ssrc : config.rtp.ssrcs) { | 291 for (uint32_t ssrc : config.rtp.ssrcs) { |
289 RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end()); | 292 RTC_DCHECK(video_send_ssrcs_.find(ssrc) == video_send_ssrcs_.end()); |
290 video_send_ssrcs_[ssrc] = send_stream; | 293 video_send_ssrcs_[ssrc] = send_stream; |
291 } | 294 } |
292 video_send_streams_.insert(send_stream); | 295 video_send_streams_.insert(send_stream); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 334 } |
332 | 335 |
333 delete send_stream_impl; | 336 delete send_stream_impl; |
334 } | 337 } |
335 | 338 |
336 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( | 339 webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( |
337 const webrtc::VideoReceiveStream::Config& config) { | 340 const webrtc::VideoReceiveStream::Config& config) { |
338 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); | 341 TRACE_EVENT0("webrtc", "Call::CreateVideoReceiveStream"); |
339 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 342 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
340 VideoReceiveStream* receive_stream = new VideoReceiveStream( | 343 VideoReceiveStream* receive_stream = new VideoReceiveStream( |
341 num_cpu_cores_, channel_group_.get(), config, config_.voice_engine, | 344 num_cpu_cores_, congestion_controller_.get(), config, |
342 module_process_thread_.get(), call_stats_.get()); | 345 config_.voice_engine, module_process_thread_.get(), call_stats_.get()); |
343 | 346 |
344 // This needs to be taken before receive_crit_ as both locks need to be held | 347 // This needs to be taken before receive_crit_ as both locks need to be held |
345 // while changing network state. | 348 // while changing network state. |
346 rtc::CritScope lock(&network_enabled_crit_); | 349 rtc::CritScope lock(&network_enabled_crit_); |
347 WriteLockScoped write_lock(*receive_crit_); | 350 WriteLockScoped write_lock(*receive_crit_); |
348 RTC_DCHECK(video_receive_ssrcs_.find(config.rtp.remote_ssrc) == | 351 RTC_DCHECK(video_receive_ssrcs_.find(config.rtp.remote_ssrc) == |
349 video_receive_ssrcs_.end()); | 352 video_receive_ssrcs_.end()); |
350 video_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; | 353 video_receive_ssrcs_[config.rtp.remote_ssrc] = receive_stream; |
351 // TODO(pbos): Configure different RTX payloads per receive payload. | 354 // TODO(pbos): Configure different RTX payloads per receive payload. |
352 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = | 355 VideoReceiveStream::Config::Rtp::RtxMap::const_iterator it = |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 delete receive_stream_impl; | 397 delete receive_stream_impl; |
395 } | 398 } |
396 | 399 |
397 Call::Stats Call::GetStats() const { | 400 Call::Stats Call::GetStats() const { |
398 // TODO(solenberg): Some test cases in EndToEndTest use this from a different | 401 // TODO(solenberg): Some test cases in EndToEndTest use this from a different |
399 // thread. Re-enable once that is fixed. | 402 // thread. Re-enable once that is fixed. |
400 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 403 // RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
401 Stats stats; | 404 Stats stats; |
402 // Fetch available send/receive bitrates. | 405 // Fetch available send/receive bitrates. |
403 uint32_t send_bandwidth = 0; | 406 uint32_t send_bandwidth = 0; |
404 channel_group_->GetBitrateController()->AvailableBandwidth(&send_bandwidth); | 407 congestion_controller_->GetBitrateController()->AvailableBandwidth( |
| 408 &send_bandwidth); |
405 std::vector<unsigned int> ssrcs; | 409 std::vector<unsigned int> ssrcs; |
406 uint32_t recv_bandwidth = 0; | 410 uint32_t recv_bandwidth = 0; |
407 channel_group_->GetRemoteBitrateEstimator(false)->LatestEstimate( | 411 congestion_controller_->GetRemoteBitrateEstimator(false)->LatestEstimate( |
408 &ssrcs, &recv_bandwidth); | 412 &ssrcs, &recv_bandwidth); |
409 stats.send_bandwidth_bps = send_bandwidth; | 413 stats.send_bandwidth_bps = send_bandwidth; |
410 stats.recv_bandwidth_bps = recv_bandwidth; | 414 stats.recv_bandwidth_bps = recv_bandwidth; |
411 stats.pacer_delay_ms = channel_group_->GetPacerQueuingDelayMs(); | 415 stats.pacer_delay_ms = congestion_controller_->GetPacerQueuingDelayMs(); |
412 { | 416 { |
413 ReadLockScoped read_lock(*send_crit_); | 417 ReadLockScoped read_lock(*send_crit_); |
414 // TODO(solenberg): Add audio send streams. | 418 // TODO(solenberg): Add audio send streams. |
415 for (const auto& kv : video_send_ssrcs_) { | 419 for (const auto& kv : video_send_ssrcs_) { |
416 int rtt_ms = kv.second->GetRtt(); | 420 int rtt_ms = kv.second->GetRtt(); |
417 if (rtt_ms > 0) | 421 if (rtt_ms > 0) |
418 stats.rtt_ms = rtt_ms; | 422 stats.rtt_ms = rtt_ms; |
419 } | 423 } |
420 } | 424 } |
421 return stats; | 425 return stats; |
(...skipping 10 matching lines...) Expand all Loading... |
432 bitrate_config.min_bitrate_bps && | 436 bitrate_config.min_bitrate_bps && |
433 (bitrate_config.start_bitrate_bps <= 0 || | 437 (bitrate_config.start_bitrate_bps <= 0 || |
434 config_.bitrate_config.start_bitrate_bps == | 438 config_.bitrate_config.start_bitrate_bps == |
435 bitrate_config.start_bitrate_bps) && | 439 bitrate_config.start_bitrate_bps) && |
436 config_.bitrate_config.max_bitrate_bps == | 440 config_.bitrate_config.max_bitrate_bps == |
437 bitrate_config.max_bitrate_bps) { | 441 bitrate_config.max_bitrate_bps) { |
438 // Nothing new to set, early abort to avoid encoder reconfigurations. | 442 // Nothing new to set, early abort to avoid encoder reconfigurations. |
439 return; | 443 return; |
440 } | 444 } |
441 config_.bitrate_config = bitrate_config; | 445 config_.bitrate_config = bitrate_config; |
442 channel_group_->SetBweBitrates(bitrate_config.min_bitrate_bps, | 446 congestion_controller_->SetBweBitrates(bitrate_config.min_bitrate_bps, |
443 bitrate_config.start_bitrate_bps, | 447 bitrate_config.start_bitrate_bps, |
444 bitrate_config.max_bitrate_bps); | 448 bitrate_config.max_bitrate_bps); |
445 } | 449 } |
446 | 450 |
447 void Call::SignalNetworkState(NetworkState state) { | 451 void Call::SignalNetworkState(NetworkState state) { |
448 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 452 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
449 // Take crit for entire function, it needs to be held while updating streams | 453 // Take crit for entire function, it needs to be held while updating streams |
450 // to guarantee a consistent state across streams. | 454 // to guarantee a consistent state across streams. |
451 rtc::CritScope lock(&network_enabled_crit_); | 455 rtc::CritScope lock(&network_enabled_crit_); |
452 network_enabled_ = state == kNetworkUp; | 456 network_enabled_ = state == kNetworkUp; |
453 channel_group_->SignalNetworkState(state); | 457 congestion_controller_->SignalNetworkState(state); |
454 { | 458 { |
455 ReadLockScoped write_lock(*send_crit_); | 459 ReadLockScoped write_lock(*send_crit_); |
456 for (auto& kv : audio_send_ssrcs_) { | 460 for (auto& kv : audio_send_ssrcs_) { |
457 kv.second->SignalNetworkState(state); | 461 kv.second->SignalNetworkState(state); |
458 } | 462 } |
459 for (auto& kv : video_send_ssrcs_) { | 463 for (auto& kv : video_send_ssrcs_) { |
460 kv.second->SignalNetworkState(state); | 464 kv.second->SignalNetworkState(state); |
461 } | 465 } |
462 } | 466 } |
463 { | 467 { |
464 ReadLockScoped write_lock(*receive_crit_); | 468 ReadLockScoped write_lock(*receive_crit_); |
465 for (auto& kv : video_receive_ssrcs_) { | 469 for (auto& kv : video_receive_ssrcs_) { |
466 kv.second->SignalNetworkState(state); | 470 kv.second->SignalNetworkState(state); |
467 } | 471 } |
468 } | 472 } |
469 } | 473 } |
470 | 474 |
471 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { | 475 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
472 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 476 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
473 channel_group_->OnSentPacket(sent_packet); | 477 congestion_controller_->OnSentPacket(sent_packet); |
474 } | 478 } |
475 | 479 |
476 void Call::ConfigureSync(const std::string& sync_group) { | 480 void Call::ConfigureSync(const std::string& sync_group) { |
477 // Set sync only if there was no previous one. | 481 // Set sync only if there was no previous one. |
478 if (config_.voice_engine == nullptr || sync_group.empty()) | 482 if (config_.voice_engine == nullptr || sync_group.empty()) |
479 return; | 483 return; |
480 | 484 |
481 AudioReceiveStream* sync_audio_stream = nullptr; | 485 AudioReceiveStream* sync_audio_stream = nullptr; |
482 // Find existing audio stream. | 486 // Find existing audio stream. |
483 const auto it = sync_stream_mapping_.find(sync_group); | 487 const auto it = sync_stream_mapping_.find(sync_group); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // thread. Then this check can be enabled. | 602 // thread. Then this check can be enabled. |
599 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 603 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
600 if (RtpHeaderParser::IsRtcp(packet, length)) | 604 if (RtpHeaderParser::IsRtcp(packet, length)) |
601 return DeliverRtcp(media_type, packet, length); | 605 return DeliverRtcp(media_type, packet, length); |
602 | 606 |
603 return DeliverRtp(media_type, packet, length, packet_time); | 607 return DeliverRtp(media_type, packet, length, packet_time); |
604 } | 608 } |
605 | 609 |
606 } // namespace internal | 610 } // namespace internal |
607 } // namespace webrtc | 611 } // namespace webrtc |
OLD | NEW |