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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2832643003: Only record received key frame histogram stats if a certain number of frames (kMinRequiredSamples) … (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index e40a7efd16b0103b8410c595ea30b6b9291579ea..c5fa7c004f112400e1b8e56c686cec510232e9d4 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -134,13 +134,12 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
<< freq_offset_stats.ToString();
}
- if (stats_.frame_counts.key_frames > 0 ||
- stats_.frame_counts.delta_frames > 0) {
- float num_key_frames = stats_.frame_counts.key_frames;
- float num_total_frames =
- stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames;
+ int num_total_frames =
+ stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames;
+ if (num_total_frames >= kMinRequiredSamples) {
+ int num_key_frames = stats_.frame_counts.key_frames;
int key_frames_permille =
- (num_key_frames * 1000.0f / num_total_frames + 0.5f);
+ (num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
key_frames_permille);
}
« no previous file with comments | « no previous file | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698