Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: webrtc/call/call.cc

Issue 3000773002: Move PacedSender ownership to RtpTransportControllerSend. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 transport_send_->send_side_cc()->SetBweBitrates( 431 transport_send_->send_side_cc()->SetBweBitrates(
432 config_.bitrate_config.min_bitrate_bps, 432 config_.bitrate_config.min_bitrate_bps,
433 config_.bitrate_config.start_bitrate_bps, 433 config_.bitrate_config.start_bitrate_bps,
434 config_.bitrate_config.max_bitrate_bps); 434 config_.bitrate_config.max_bitrate_bps);
435 call_stats_->RegisterStatsObserver(&receive_side_cc_); 435 call_stats_->RegisterStatsObserver(&receive_side_cc_);
436 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc()); 436 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc());
437 437
438 // We have to attach the pacer to the pacer thread before starting the 438 // We have to attach the pacer to the pacer thread before starting the
439 // module process thread to avoid a race accessing the process thread 439 // module process thread to avoid a race accessing the process thread
440 // both from the process thread and the pacer thread. 440 // both from the process thread and the pacer thread.
441 pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(), 441 pacer_thread_->RegisterModule(transport_send_->pacer(), RTC_FROM_HERE);
442 RTC_FROM_HERE);
443 pacer_thread_->RegisterModule( 442 pacer_thread_->RegisterModule(
444 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE); 443 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
445 pacer_thread_->Start(); 444 pacer_thread_->Start();
446 445
447 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE); 446 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
448 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE); 447 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE);
449 module_process_thread_->RegisterModule(transport_send_->send_side_cc(), 448 module_process_thread_->RegisterModule(transport_send_->send_side_cc(),
450 RTC_FROM_HERE); 449 RTC_FROM_HERE);
451 module_process_thread_->Start(); 450 module_process_thread_->Start();
452 } 451 }
453 452
454 Call::~Call() { 453 Call::~Call() {
455 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); 454 RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
456 455
457 RTC_CHECK(audio_send_ssrcs_.empty()); 456 RTC_CHECK(audio_send_ssrcs_.empty());
458 RTC_CHECK(video_send_ssrcs_.empty()); 457 RTC_CHECK(video_send_ssrcs_.empty());
459 RTC_CHECK(video_send_streams_.empty()); 458 RTC_CHECK(video_send_streams_.empty());
460 RTC_CHECK(audio_receive_streams_.empty()); 459 RTC_CHECK(audio_receive_streams_.empty());
461 RTC_CHECK(video_receive_streams_.empty()); 460 RTC_CHECK(video_receive_streams_.empty());
462 461
463 // The send-side congestion controller must be de-registered prior to 462 // The send-side congestion controller must be de-registered prior to
464 // the pacer thread being stopped to avoid a race when accessing the 463 // the pacer thread being stopped to avoid a race when accessing the
465 // pacer thread object on the module process thread at the same time as 464 // pacer thread object on the module process thread at the same time as
466 // the pacer thread is stopped. 465 // the pacer thread is stopped.
467 module_process_thread_->DeRegisterModule(transport_send_->send_side_cc()); 466 module_process_thread_->DeRegisterModule(transport_send_->send_side_cc());
468 pacer_thread_->Stop(); 467 pacer_thread_->Stop();
469 pacer_thread_->DeRegisterModule(transport_send_->send_side_cc()->pacer()); 468 pacer_thread_->DeRegisterModule(transport_send_->pacer());
470 pacer_thread_->DeRegisterModule( 469 pacer_thread_->DeRegisterModule(
471 receive_side_cc_.GetRemoteBitrateEstimator(true)); 470 receive_side_cc_.GetRemoteBitrateEstimator(true));
472 module_process_thread_->DeRegisterModule(&receive_side_cc_); 471 module_process_thread_->DeRegisterModule(&receive_side_cc_);
473 module_process_thread_->DeRegisterModule(call_stats_.get()); 472 module_process_thread_->DeRegisterModule(call_stats_.get());
474 module_process_thread_->Stop(); 473 module_process_thread_->Stop();
475 call_stats_->DeregisterStatsObserver(&receive_side_cc_); 474 call_stats_->DeregisterStatsObserver(&receive_side_cc_);
476 call_stats_->DeregisterStatsObserver(transport_send_->send_side_cc()); 475 call_stats_->DeregisterStatsObserver(transport_send_->send_side_cc());
477 476
478 int64_t first_sent_packet_ms = 477 int64_t first_sent_packet_ms =
479 transport_send_->send_side_cc()->GetFirstPacketTimeMs(); 478 transport_send_->send_side_cc()->GetFirstPacketTimeMs();
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1422 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { 1421 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
1423 receive_side_cc_.OnReceivedPacket( 1422 receive_side_cc_.OnReceivedPacket(
1424 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), 1423 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
1425 header); 1424 header);
1426 } 1425 }
1427 } 1426 }
1428 1427
1429 } // namespace internal 1428 } // namespace internal
1430 1429
1431 } // namespace webrtc 1430 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698