Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index 942d2eb852d304615435612c4b3376408deee82c..99a484c69b261161085f60825dd8ef06f92b2e9f 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -477,20 +477,7 @@ void SendStatisticsProxy::OnSendEncodedImage( |
uma_container_->key_frame_counter_.Add(encoded_image._frameType == |
kVideoFrameKey); |
- stats_.bw_limited_resolution = |
- encoded_image.adapt_reason_.quality_resolution_downscales > 0 || |
- 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); |
- } |
- } |
- if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) { |
+ if (stats_.bw_limited_resolution) { |
bool bw_limited = encoded_image.adapt_reason_.bw_resolutions_disabled > 0; |
uma_container_->bw_limited_frame_counter_.Add(bw_limited); |
if (bw_limited) { |
@@ -540,20 +527,19 @@ int SendStatisticsProxy::GetSendFrameRate() const { |
return stats_.encode_frame_rate; |
} |
-void SendStatisticsProxy::OnIncomingFrame(int width, |
- int height, |
- bool is_cpu_restricted) { |
+void SendStatisticsProxy::OnIncomingFrame(int width, int height) { |
rtc::CritScope lock(&crit_); |
uma_container_->input_frame_rate_tracker_.AddSamples(1); |
uma_container_->input_width_counter_.Add(width); |
uma_container_->input_height_counter_.Add(height); |
- uma_container_->cpu_limited_frame_counter_.Add(is_cpu_restricted); |
+ uma_container_->cpu_limited_frame_counter_.Add(stats_.cpu_limited_resolution); |
} |
-void SendStatisticsProxy::SetCpuRestrictedResolution( |
- bool cpu_restricted_resolution) { |
+void SendStatisticsProxy::SetResolutionRestrictionStats(bool bandwidth, |
+ bool cpu) { |
rtc::CritScope lock(&crit_); |
- stats_.cpu_limited_resolution = cpu_restricted_resolution; |
+ stats_.bw_limited_resolution = bandwidth; |
+ stats_.cpu_limited_resolution = cpu; |
} |
void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( |
@@ -563,6 +549,13 @@ void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( |
++stats_.number_of_cpu_adapt_changes; |
} |
+void SendStatisticsProxy::OnQualityRestrictedResolutionChanged( |
+ bool restricted) { |
+ rtc::CritScope lock(&crit_); |
+ uma_container_->quality_downscales_counter_.Add(restricted); |
+ stats_.bw_limited_resolution = restricted; |
+} |
+ |
void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( |
uint32_t ssrc, |
const RtcpPacketTypeCounter& packet_counter) { |