OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 first_report_time_ms_(-1), | 81 first_report_time_ms_(-1), |
82 initially_lost_packets_(0), | 82 initially_lost_packets_(0), |
83 bitrate_at_2_seconds_kbps_(0), | 83 bitrate_at_2_seconds_kbps_(0), |
84 uma_update_state_(kNoUpdate), | 84 uma_update_state_(kNoUpdate), |
85 rampup_uma_stats_updated_(kNumUmaRampupMetrics, false) { | 85 rampup_uma_stats_updated_(kNumUmaRampupMetrics, false) { |
86 } | 86 } |
87 | 87 |
88 SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {} | 88 SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {} |
89 | 89 |
90 void SendSideBandwidthEstimation::SetSendBitrate(int bitrate) { | 90 void SendSideBandwidthEstimation::SetSendBitrate(int bitrate) { |
91 DCHECK_GT(bitrate, 0); | 91 RTC_DCHECK_GT(bitrate, 0); |
92 bitrate_ = bitrate; | 92 bitrate_ = bitrate; |
93 | 93 |
94 // Clear last sent bitrate history so the new value can be used directly | 94 // Clear last sent bitrate history so the new value can be used directly |
95 // and not capped. | 95 // and not capped. |
96 min_bitrate_history_.clear(); | 96 min_bitrate_history_.clear(); |
97 } | 97 } |
98 | 98 |
99 void SendSideBandwidthEstimation::SetMinMaxBitrate(int min_bitrate, | 99 void SendSideBandwidthEstimation::SetMinMaxBitrate(int min_bitrate, |
100 int max_bitrate) { | 100 int max_bitrate) { |
101 DCHECK_GE(min_bitrate, 0); | 101 RTC_DCHECK_GE(min_bitrate, 0); |
102 min_bitrate_configured_ = std::max(min_bitrate, kDefaultMinBitrateBps); | 102 min_bitrate_configured_ = std::max(min_bitrate, kDefaultMinBitrateBps); |
103 if (max_bitrate > 0) { | 103 if (max_bitrate > 0) { |
104 max_bitrate_configured_ = | 104 max_bitrate_configured_ = |
105 std::max<uint32_t>(min_bitrate_configured_, max_bitrate); | 105 std::max<uint32_t>(min_bitrate_configured_, max_bitrate); |
106 } else { | 106 } else { |
107 max_bitrate_configured_ = kDefaultMaxBitrateBps; | 107 max_bitrate_configured_ = kDefaultMaxBitrateBps; |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 int SendSideBandwidthEstimation::GetMinBitrate() const { | 111 int SendSideBandwidthEstimation::GetMinBitrate() const { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 LOG(LS_WARNING) << "Estimated available bandwidth " << bitrate / 1000 | 296 LOG(LS_WARNING) << "Estimated available bandwidth " << bitrate / 1000 |
297 << " kbps is below configured min bitrate " | 297 << " kbps is below configured min bitrate " |
298 << min_bitrate_configured_ / 1000 << " kbps."; | 298 << min_bitrate_configured_ / 1000 << " kbps."; |
299 last_low_bitrate_log_ms_ = now_ms; | 299 last_low_bitrate_log_ms_ = now_ms; |
300 } | 300 } |
301 bitrate = min_bitrate_configured_; | 301 bitrate = min_bitrate_configured_; |
302 } | 302 } |
303 return bitrate; | 303 return bitrate; |
304 } | 304 } |
305 } // namespace webrtc | 305 } // namespace webrtc |
OLD | NEW |