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

Side by Side Diff: webrtc/modules/congestion_controller/delay_based_bwe.cc

Issue 2867713003: Remove hardcoded kValueSizeBytes values from variable-length header extensions. (Closed)
Patch Set: use RaceChecker instead of ThreadChecker in a few places. Created 3 years, 6 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 uma_recorded_(false), 67 uma_recorded_(false),
68 probe_bitrate_estimator_(event_log), 68 probe_bitrate_estimator_(event_log),
69 trendline_window_size_(kDefaultTrendlineWindowSize), 69 trendline_window_size_(kDefaultTrendlineWindowSize),
70 trendline_smoothing_coeff_(kDefaultTrendlineSmoothingCoeff), 70 trendline_smoothing_coeff_(kDefaultTrendlineSmoothingCoeff),
71 trendline_threshold_gain_(kDefaultTrendlineThresholdGain), 71 trendline_threshold_gain_(kDefaultTrendlineThresholdGain),
72 consecutive_delayed_feedbacks_(0), 72 consecutive_delayed_feedbacks_(0),
73 last_logged_bitrate_(0), 73 last_logged_bitrate_(0),
74 last_logged_state_(BandwidthUsage::kBwNormal), 74 last_logged_state_(BandwidthUsage::kBwNormal),
75 in_sparse_update_experiment_(BweSparseUpdateExperimentIsEnabled()) { 75 in_sparse_update_experiment_(BweSparseUpdateExperimentIsEnabled()) {
76 LOG(LS_INFO) << "Using Trendline filter for delay change estimation."; 76 LOG(LS_INFO) << "Using Trendline filter for delay change estimation.";
77 network_thread_.DetachFromThread();
78 } 77 }
79 78
80 DelayBasedBwe::~DelayBasedBwe() {} 79 DelayBasedBwe::~DelayBasedBwe() {}
81 80
82 DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector( 81 DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector(
83 const std::vector<PacketFeedback>& packet_feedback_vector, 82 const std::vector<PacketFeedback>& packet_feedback_vector,
84 rtc::Optional<uint32_t> acked_bitrate_bps) { 83 rtc::Optional<uint32_t> acked_bitrate_bps) {
85 RTC_DCHECK(std::is_sorted(packet_feedback_vector.begin(), 84 RTC_DCHECK(std::is_sorted(packet_feedback_vector.begin(),
86 packet_feedback_vector.end(), 85 packet_feedback_vector.end(),
87 PacketFeedbackComparator())); 86 PacketFeedbackComparator()));
88 RTC_DCHECK(network_thread_.CalledOnValidThread()); 87 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_);
89 88
90 // TOOD(holmer): An empty feedback vector here likely means that 89 // TOOD(holmer): An empty feedback vector here likely means that
91 // all acks were too late and that the send time history had 90 // all acks were too late and that the send time history had
92 // timed out. We should reduce the rate when this occurs. 91 // timed out. We should reduce the rate when this occurs.
93 if (packet_feedback_vector.empty()) { 92 if (packet_feedback_vector.empty()) {
94 LOG(LS_WARNING) << "Very late feedback received."; 93 LOG(LS_WARNING) << "Very late feedback received.";
95 return DelayBasedBwe::Result(); 94 return DelayBasedBwe::Result();
96 } 95 }
97 96
98 if (!uma_recorded_) { 97 if (!uma_recorded_) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { 265 void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) {
267 // Called from both the configuration thread and the network thread. Shouldn't 266 // Called from both the configuration thread and the network thread. Shouldn't
268 // be called from the network thread in the future. 267 // be called from the network thread in the future.
269 rate_control_.SetMinBitrate(min_bitrate_bps); 268 rate_control_.SetMinBitrate(min_bitrate_bps);
270 } 269 }
271 270
272 int64_t DelayBasedBwe::GetExpectedBwePeriodMs() const { 271 int64_t DelayBasedBwe::GetExpectedBwePeriodMs() const {
273 return rate_control_.GetExpectedBandwidthPeriodMs(); 272 return rate_control_.GetExpectedBandwidthPeriodMs();
274 } 273 }
275 } // namespace webrtc 274 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698