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..6fa87f191ee68aa0681b6dcc176789a3df4b8bd2 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -474,12 +474,14 @@ void SendStatisticsProxy::OnSendEncodedImage( |
const EncodedImage& encoded_image, |
const CodecSpecificInfo* codec_info) { |
size_t simulcast_idx = 0; |
+ bool report_quality_scales = true; |
rtc::CritScope lock(&crit_); |
++stats_.frames_encoded; |
if (codec_info) { |
if (codec_info->codecType == kVideoCodecVP8) { |
simulcast_idx = codec_info->codecSpecific.VP8.simulcastIdx; |
+ report_quality_scales = simulcast_idx == 0; |
åsapersson
2016/12/14 09:25:13
Scaling could be disabled for simulcast_idx == 0?
kthelgason
2016/12/15 10:33:54
Done.
|
} else if (codec_info->codecType == kVideoCodecGeneric) { |
simulcast_idx = codec_info->codecSpecific.generic.simulcast_idx; |
} |
@@ -506,16 +508,14 @@ 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); |
+ stats_.bw_limited_resolution || quality_downscales_ > 0; |
åsapersson
2016/12/14 09:25:13
Why remove encoded_image.adapt_reason_.bw_resoluti
kthelgason
2016/12/15 10:33:54
Sorry, that should not have been removed. Fixed!
|
+ |
+ if (report_quality_scales) { |
+ if (quality_downscales_ >= 0) { |
åsapersson
2016/12/14 09:25:13
always >= 0?
kthelgason
2016/12/15 10:33:54
Acknowledged.
|
+ 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) { |
@@ -602,10 +602,10 @@ void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( |
} |
void SendStatisticsProxy::OnQualityRestrictedResolutionChanged( |
- bool restricted) { |
+ int nr_of_downscales) { |
rtc::CritScope lock(&crit_); |
- uma_container_->quality_downscales_counter_.Add(restricted); |
- stats_.bw_limited_resolution = restricted; |
+ quality_downscales_ = nr_of_downscales; |
+ stats_.bw_limited_resolution = nr_of_downscales > 0; |
} |
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( |