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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 transport_send->send_side_cc()->RegisterNetworkObserver(this); | 429 transport_send->send_side_cc()->RegisterNetworkObserver(this); |
430 transport_send_ = std::move(transport_send); | 430 transport_send_ = std::move(transport_send); |
431 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown); | 431 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown); |
432 transport_send_->send_side_cc()->SetBweBitrates( | 432 transport_send_->send_side_cc()->SetBweBitrates( |
433 config_.bitrate_config.min_bitrate_bps, | 433 config_.bitrate_config.min_bitrate_bps, |
434 config_.bitrate_config.start_bitrate_bps, | 434 config_.bitrate_config.start_bitrate_bps, |
435 config_.bitrate_config.max_bitrate_bps); | 435 config_.bitrate_config.max_bitrate_bps); |
436 call_stats_->RegisterStatsObserver(&receive_side_cc_); | 436 call_stats_->RegisterStatsObserver(&receive_side_cc_); |
437 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc()); | 437 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc()); |
438 | 438 |
439 module_process_thread_->Start(); | 439 // We have to attach the pacer to the pacer thread before starting the |
| 440 // module process thread to avoid a race accessing the process thread |
| 441 // both from the process thread and the pacer thread. |
| 442 pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(), |
| 443 RTC_FROM_HERE); |
| 444 pacer_thread_->RegisterModule( |
| 445 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE); |
| 446 pacer_thread_->Start(); |
| 447 |
440 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE); | 448 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE); |
441 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE); | 449 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE); |
442 module_process_thread_->RegisterModule(transport_send_->send_side_cc(), | 450 module_process_thread_->RegisterModule(transport_send_->send_side_cc(), |
443 RTC_FROM_HERE); | 451 RTC_FROM_HERE); |
444 pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(), | 452 module_process_thread_->Start(); |
445 RTC_FROM_HERE); | |
446 pacer_thread_->RegisterModule( | |
447 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE); | |
448 | |
449 pacer_thread_->Start(); | |
450 } | 453 } |
451 | 454 |
452 Call::~Call() { | 455 Call::~Call() { |
453 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); | 456 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); |
454 | 457 |
455 RTC_CHECK(audio_send_ssrcs_.empty()); | 458 RTC_CHECK(audio_send_ssrcs_.empty()); |
456 RTC_CHECK(video_send_ssrcs_.empty()); | 459 RTC_CHECK(video_send_ssrcs_.empty()); |
457 RTC_CHECK(video_send_streams_.empty()); | 460 RTC_CHECK(video_send_streams_.empty()); |
458 RTC_CHECK(audio_receive_streams_.empty()); | 461 RTC_CHECK(audio_receive_streams_.empty()); |
459 RTC_CHECK(video_receive_streams_.empty()); | 462 RTC_CHECK(video_receive_streams_.empty()); |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1420 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1418 receive_side_cc_.OnReceivedPacket( | 1421 receive_side_cc_.OnReceivedPacket( |
1419 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1422 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1420 header); | 1423 header); |
1421 } | 1424 } |
1422 } | 1425 } |
1423 | 1426 |
1424 } // namespace internal | 1427 } // namespace internal |
1425 | 1428 |
1426 } // namespace webrtc | 1429 } // namespace webrtc |
OLD | NEW |