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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 time_last_decrease_ms_(0), | 60 time_last_decrease_ms_(0), |
61 first_report_time_ms_(-1), | 61 first_report_time_ms_(-1), |
62 initially_lost_packets_(0), | 62 initially_lost_packets_(0), |
63 bitrate_at_2_seconds_kbps_(0), | 63 bitrate_at_2_seconds_kbps_(0), |
64 uma_update_state_(kNoUpdate), | 64 uma_update_state_(kNoUpdate), |
65 rampup_uma_stats_updated_(kNumUmaRampupMetrics, false), | 65 rampup_uma_stats_updated_(kNumUmaRampupMetrics, false), |
66 event_log_(nullptr) {} | 66 event_log_(nullptr) {} |
67 | 67 |
68 SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {} | 68 SendSideBandwidthEstimation::~SendSideBandwidthEstimation() {} |
69 | 69 |
| 70 void SendSideBandwidthEstimation::SetBitrates(int send_bitrate, |
| 71 int min_bitrate, |
| 72 int max_bitrate) { |
| 73 if (send_bitrate > 0) |
| 74 SetSendBitrate(send_bitrate); |
| 75 SetMinMaxBitrate(min_bitrate, max_bitrate); |
| 76 } |
| 77 |
70 void SendSideBandwidthEstimation::SetSendBitrate(int bitrate) { | 78 void SendSideBandwidthEstimation::SetSendBitrate(int bitrate) { |
71 RTC_DCHECK_GT(bitrate, 0); | 79 RTC_DCHECK_GT(bitrate, 0); |
72 bitrate_ = bitrate; | 80 bitrate_ = bitrate; |
73 | 81 |
74 // Clear last sent bitrate history so the new value can be used directly | 82 // Clear last sent bitrate history so the new value can be used directly |
75 // and not capped. | 83 // and not capped. |
76 min_bitrate_history_.clear(); | 84 min_bitrate_history_.clear(); |
77 } | 85 } |
78 | 86 |
79 void SendSideBandwidthEstimation::SetMinMaxBitrate(int min_bitrate, | 87 void SendSideBandwidthEstimation::SetMinMaxBitrate(int min_bitrate, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 bitrate = min_bitrate_configured_; | 307 bitrate = min_bitrate_configured_; |
300 } | 308 } |
301 return bitrate; | 309 return bitrate; |
302 } | 310 } |
303 | 311 |
304 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { | 312 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { |
305 event_log_ = event_log; | 313 event_log_ = event_log; |
306 } | 314 } |
307 | 315 |
308 } // namespace webrtc | 316 } // namespace webrtc |
OLD | NEW |