Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 1311533012: Add histogram for percentage of sent frames that are limited in resolution due to bandwidth. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « webrtc/video/send_statistics_proxy.h ('k') | webrtc/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698