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

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

Issue 2918323002: Add functionality which limits the number of bytes on the network. (Closed)
Patch Set: . Created 3 years, 5 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 transport_send->send_side_cc()->RegisterNetworkObserver(this); 428 transport_send->send_side_cc()->RegisterNetworkObserver(this);
429 transport_send_ = std::move(transport_send); 429 transport_send_ = std::move(transport_send);
430 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown); 430 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown);
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 module_process_thread_->Start(); 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
440 // both from the process thread and the pacer thread.
441 pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(),
442 RTC_FROM_HERE);
443 pacer_thread_->RegisterModule(
444 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
445 pacer_thread_->Start();
446
439 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE); 447 module_process_thread_->RegisterModule(call_stats_.get(), RTC_FROM_HERE);
440 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE); 448 module_process_thread_->RegisterModule(&receive_side_cc_, RTC_FROM_HERE);
441 module_process_thread_->RegisterModule(transport_send_->send_side_cc(), 449 module_process_thread_->RegisterModule(transport_send_->send_side_cc(),
442 RTC_FROM_HERE); 450 RTC_FROM_HERE);
443 pacer_thread_->RegisterModule(transport_send_->send_side_cc()->pacer(), 451 module_process_thread_->Start();
444 RTC_FROM_HERE);
445 pacer_thread_->RegisterModule(
446 receive_side_cc_.GetRemoteBitrateEstimator(true), RTC_FROM_HERE);
447
448 pacer_thread_->Start();
449 } 452 }
450 453
451 Call::~Call() { 454 Call::~Call() {
452 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); 455 RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
453 456
454 RTC_CHECK(audio_send_ssrcs_.empty()); 457 RTC_CHECK(audio_send_ssrcs_.empty());
455 RTC_CHECK(video_send_ssrcs_.empty()); 458 RTC_CHECK(video_send_ssrcs_.empty());
456 RTC_CHECK(video_send_streams_.empty()); 459 RTC_CHECK(video_send_streams_.empty());
457 RTC_CHECK(audio_receive_streams_.empty()); 460 RTC_CHECK(audio_receive_streams_.empty());
458 RTC_CHECK(video_receive_streams_.empty()); 461 RTC_CHECK(video_receive_streams_.empty());
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { 1410 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
1408 receive_side_cc_.OnReceivedPacket( 1411 receive_side_cc_.OnReceivedPacket(
1409 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), 1412 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
1410 header); 1413 header);
1411 } 1414 }
1412 } 1415 }
1413 1416
1414 } // namespace internal 1417 } // namespace internal
1415 1418
1416 } // namespace webrtc 1419 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698