| Index: webrtc/video/send_statistics_proxy.cc
|
| diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
|
| index 82d7f0dc7593bf2cd694aa69d55d8b6e91572915..6c249f70a97629eec33192ace3e11432449f0322 100644
|
| --- a/webrtc/video/send_statistics_proxy.cc
|
| +++ b/webrtc/video/send_statistics_proxy.cc
|
| @@ -506,17 +506,13 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
| uma_container_->key_frame_counter_.Add(encoded_image._frameType ==
|
| kVideoFrameKey);
|
| stats_.bw_limited_resolution =
|
| - stats_.bw_limited_resolution ||
|
| - encoded_image.adapt_reason_.bw_resolutions_disabled > 0;
|
| -
|
| - if (encoded_image.adapt_reason_.quality_resolution_downscales != -1) {
|
| - bool downscaled =
|
| - encoded_image.adapt_reason_.quality_resolution_downscales > 0;
|
| - uma_container_->quality_limited_frame_counter_.Add(downscaled);
|
| - if (downscaled) {
|
| - uma_container_->quality_downscales_counter_.Add(
|
| - encoded_image.adapt_reason_.quality_resolution_downscales);
|
| - }
|
| + encoded_image.adapt_reason_.bw_resolutions_disabled > 0 ||
|
| + quality_downscales_ > 0;
|
| +
|
| + if (quality_downscales_ != -1) {
|
| + uma_container_->quality_limited_frame_counter_.Add(quality_downscales_ > 0);
|
| + if (quality_downscales_ > 0)
|
| + uma_container_->quality_downscales_counter_.Add(quality_downscales_);
|
| }
|
| if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) {
|
| bool bw_limited = encoded_image.adapt_reason_.bw_resolutions_disabled > 0;
|
| @@ -587,11 +583,20 @@ void SendStatisticsProxy::OnIncomingFrame(int width, int height) {
|
| uma_container_->cpu_limited_frame_counter_.Add(stats_.cpu_limited_resolution);
|
| }
|
|
|
| -void SendStatisticsProxy::SetResolutionRestrictionStats(bool bandwidth,
|
| - bool cpu) {
|
| +void SendStatisticsProxy::SetResolutionRestrictionStats(
|
| + bool scaling_enabled,
|
| + bool cpu_restricted,
|
| + int num_quality_downscales) {
|
| rtc::CritScope lock(&crit_);
|
| - stats_.bw_limited_resolution = bandwidth;
|
| - stats_.cpu_limited_resolution = cpu;
|
| + if (scaling_enabled) {
|
| + quality_downscales_ = num_quality_downscales;
|
| + stats_.bw_limited_resolution = quality_downscales_ > 0;
|
| + stats_.cpu_limited_resolution = cpu_restricted;
|
| + } else {
|
| + stats_.bw_limited_resolution = false;
|
| + stats_.cpu_limited_resolution = false;
|
| + quality_downscales_ = -1;
|
| + }
|
| }
|
|
|
| void SendStatisticsProxy::OnCpuRestrictedResolutionChanged(
|
| @@ -602,10 +607,10 @@ void SendStatisticsProxy::OnCpuRestrictedResolutionChanged(
|
| }
|
|
|
| void SendStatisticsProxy::OnQualityRestrictedResolutionChanged(
|
| - bool restricted) {
|
| + int num_quality_downscales) {
|
| rtc::CritScope lock(&crit_);
|
| - uma_container_->quality_downscales_counter_.Add(restricted);
|
| - stats_.bw_limited_resolution = restricted;
|
| + quality_downscales_ = num_quality_downscales;
|
| + stats_.bw_limited_resolution = quality_downscales_ > 0;
|
| }
|
|
|
| void SendStatisticsProxy::RtcpPacketTypesCounterUpdated(
|
|
|