| Index: webrtc/video/send_statistics_proxy.cc
|
| diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc
|
| index 00edd065ced1afc3cd19db5bffed604c89f6a02f..32b79023c8495de9a06150197b80b135e1628239 100644
|
| --- a/webrtc/video/send_statistics_proxy.cc
|
| +++ b/webrtc/video/send_statistics_proxy.cc
|
| @@ -81,6 +81,16 @@ void SendStatisticsProxy::UpdateHistograms() {
|
| RTC_HISTOGRAM_ENUMERATION("WebRTC.Video.QualityLimitedResolutionDownscales",
|
| downscales, 20);
|
| }
|
| + int bw_limited = bw_limited_frame_counter_.Percent(kMinRequiredSamples);
|
| + if (bw_limited != -1) {
|
| + RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BandwidthLimitedResolutionInPercent",
|
| + bw_limited);
|
| + }
|
| + int num_disabled = bw_resolutions_disabled_counter_.Avg(kMinRequiredSamples);
|
| + if (num_disabled != -1) {
|
| + RTC_HISTOGRAM_ENUMERATION(
|
| + "WebRTC.Video.BandwidthLimitedResolutionsDisabled", num_disabled, 10);
|
| + }
|
| }
|
|
|
| void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) {
|
| @@ -190,6 +200,14 @@ void SendStatisticsProxy::OnSendEncodedImage(
|
| encoded_image.adapt_reason_.quality_resolution_downscales);
|
| }
|
| }
|
| + if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) {
|
| + bool bw_limited = encoded_image.adapt_reason_.bw_resolutions_disabled > 0;
|
| + bw_limited_frame_counter_.Add(bw_limited);
|
| + if (bw_limited) {
|
| + bw_resolutions_disabled_counter_.Add(
|
| + encoded_image.adapt_reason_.bw_resolutions_disabled);
|
| + }
|
| + }
|
|
|
| // TODO(asapersson): This is incorrect if simulcast layers are encoded on
|
| // different threads and there is no guarantee that one frame of all layers
|
| @@ -299,7 +317,7 @@ void SendStatisticsProxy::SampleCounter::Add(int sample) {
|
| int SendStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
|
| if (num_samples < min_required_samples || num_samples == 0)
|
| return -1;
|
| - return sum / num_samples;
|
| + return (sum + (num_samples / 2)) / num_samples;
|
| }
|
|
|
| void SendStatisticsProxy::BoolSampleCounter::Add(bool sample) {
|
|
|