| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 RTC_HISTOGRAM_COUNTS_SPARSE_100000(kUmaRampupMetrics[i].metric_name, | 157 RTC_HISTOGRAM_COUNTS_SPARSE_100000(kUmaRampupMetrics[i].metric_name, |
| 158 now_ms - first_report_time_ms_); | 158 now_ms - first_report_time_ms_); |
| 159 rampup_uma_stats_updated_[i] = true; | 159 rampup_uma_stats_updated_[i] = true; |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 if (IsInStartPhase(now_ms)) { | 162 if (IsInStartPhase(now_ms)) { |
| 163 initially_lost_packets_ += lost_packets; | 163 initially_lost_packets_ += lost_packets; |
| 164 } else if (uma_update_state_ == kNoUpdate) { | 164 } else if (uma_update_state_ == kNoUpdate) { |
| 165 uma_update_state_ = kFirstDone; | 165 uma_update_state_ = kFirstDone; |
| 166 bitrate_at_2_seconds_kbps_ = bitrate_kbps; | 166 bitrate_at_2_seconds_kbps_ = bitrate_kbps; |
| 167 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitiallyLostPackets", | 167 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitiallyLostPackets", |
| 168 initially_lost_packets_, 0, 100, 50); | 168 initially_lost_packets_, 0, 100, 50); |
| 169 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialRtt", static_cast<int>(rtt), | 169 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialRtt", static_cast<int>(rtt), 0, |
| 170 0, 2000, 50); | 170 2000, 50); |
| 171 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialBandwidthEstimate", | 171 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialBandwidthEstimate", |
| 172 bitrate_at_2_seconds_kbps_, 0, 2000, 50); | 172 bitrate_at_2_seconds_kbps_, 0, 2000, 50); |
| 173 } else if (uma_update_state_ == kFirstDone && | 173 } else if (uma_update_state_ == kFirstDone && |
| 174 now_ms - first_report_time_ms_ >= kBweConverganceTimeMs) { | 174 now_ms - first_report_time_ms_ >= kBweConverganceTimeMs) { |
| 175 uma_update_state_ = kDone; | 175 uma_update_state_ = kDone; |
| 176 int bitrate_diff_kbps = | 176 int bitrate_diff_kbps = |
| 177 std::max(bitrate_at_2_seconds_kbps_ - bitrate_kbps, 0); | 177 std::max(bitrate_at_2_seconds_kbps_ - bitrate_kbps, 0); |
| 178 RTC_HISTOGRAM_COUNTS_SPARSE("WebRTC.BWE.InitialVsConvergedDiff", | 178 RTC_HISTOGRAM_COUNTS("WebRTC.BWE.InitialVsConvergedDiff", bitrate_diff_kbps, |
| 179 bitrate_diff_kbps, 0, 2000, 50); | 179 0, 2000, 50); |
| 180 } | 180 } |
| 181 } | 181 } |
| 182 | 182 |
| 183 void SendSideBandwidthEstimation::UpdateEstimate(int64_t now_ms) { | 183 void SendSideBandwidthEstimation::UpdateEstimate(int64_t now_ms) { |
| 184 // We trust the REMB during the first 2 seconds if we haven't had any | 184 // We trust the REMB during the first 2 seconds if we haven't had any |
| 185 // packet loss reported, to allow startup bitrate probing. | 185 // packet loss reported, to allow startup bitrate probing. |
| 186 if (last_fraction_loss_ == 0 && IsInStartPhase(now_ms) && | 186 if (last_fraction_loss_ == 0 && IsInStartPhase(now_ms) && |
| 187 bwe_incoming_ > bitrate_) { | 187 bwe_incoming_ > bitrate_) { |
| 188 bitrate_ = CapBitrateToThresholds(now_ms, bwe_incoming_); | 188 bitrate_ = CapBitrateToThresholds(now_ms, bwe_incoming_); |
| 189 min_bitrate_history_.clear(); | 189 min_bitrate_history_.clear(); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 bitrate = min_bitrate_configured_; | 293 bitrate = min_bitrate_configured_; |
| 294 } | 294 } |
| 295 return bitrate; | 295 return bitrate; |
| 296 } | 296 } |
| 297 | 297 |
| 298 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { | 298 void SendSideBandwidthEstimation::SetEventLog(RtcEventLog* event_log) { |
| 299 event_log_ = event_log; | 299 event_log_ = event_log; |
| 300 } | 300 } |
| 301 | 301 |
| 302 } // namespace webrtc | 302 } // namespace webrtc |
| OLD | NEW |