OLD | NEW |
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if (stats == nullptr) | 251 if (stats == nullptr) |
252 return; | 252 return; |
253 | 253 |
254 stats->width = encoded_image._encodedWidth; | 254 stats->width = encoded_image._encodedWidth; |
255 stats->height = encoded_image._encodedHeight; | 255 stats->height = encoded_image._encodedHeight; |
256 update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds(); | 256 update_times_[ssrc].resolution_update_ms = clock_->TimeInMilliseconds(); |
257 | 257 |
258 uma_container_->key_frame_counter_.Add(encoded_image._frameType == | 258 uma_container_->key_frame_counter_.Add(encoded_image._frameType == |
259 kVideoFrameKey); | 259 kVideoFrameKey); |
260 | 260 |
| 261 stats_.bw_limited_resolution = |
| 262 encoded_image.adapt_reason_.quality_resolution_downscales > 0 || |
| 263 encoded_image.adapt_reason_.bw_resolutions_disabled > 0; |
| 264 |
261 if (encoded_image.adapt_reason_.quality_resolution_downscales != -1) { | 265 if (encoded_image.adapt_reason_.quality_resolution_downscales != -1) { |
262 bool downscaled = | 266 bool downscaled = |
263 encoded_image.adapt_reason_.quality_resolution_downscales > 0; | 267 encoded_image.adapt_reason_.quality_resolution_downscales > 0; |
264 uma_container_->quality_limited_frame_counter_.Add(downscaled); | 268 uma_container_->quality_limited_frame_counter_.Add(downscaled); |
265 if (downscaled) { | 269 if (downscaled) { |
266 uma_container_->quality_downscales_counter_.Add( | 270 uma_container_->quality_downscales_counter_.Add( |
267 encoded_image.adapt_reason_.quality_resolution_downscales); | 271 encoded_image.adapt_reason_.quality_resolution_downscales); |
268 } | 272 } |
269 } | 273 } |
270 if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) { | 274 if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 return Fraction(min_required_samples, 1000.0f); | 414 return Fraction(min_required_samples, 1000.0f); |
411 } | 415 } |
412 | 416 |
413 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 417 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
414 int min_required_samples, float multiplier) const { | 418 int min_required_samples, float multiplier) const { |
415 if (num_samples < min_required_samples || num_samples == 0) | 419 if (num_samples < min_required_samples || num_samples == 0) |
416 return -1; | 420 return -1; |
417 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 421 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
418 } | 422 } |
419 } // namespace webrtc | 423 } // namespace webrtc |
OLD | NEW |