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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms); 127 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms);
128 } 128 }
129 AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats(); 129 AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats();
130 if (freq_offset_stats.num_samples > 0) { 130 if (freq_offset_stats.num_samples > 0) {
131 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz", 131 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz",
132 freq_offset_stats.average); 132 freq_offset_stats.average);
133 LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, " 133 LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, "
134 << freq_offset_stats.ToString(); 134 << freq_offset_stats.ToString();
135 } 135 }
136 136
137 if (stats_.frame_counts.key_frames > 0 || 137 int num_total_frames =
138 stats_.frame_counts.delta_frames > 0) { 138 stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames;
139 float num_key_frames = stats_.frame_counts.key_frames; 139 if (num_total_frames >= kMinRequiredSamples) {
140 float num_total_frames = 140 int num_key_frames = stats_.frame_counts.key_frames;
141 stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames;
142 int key_frames_permille = 141 int key_frames_permille =
143 (num_key_frames * 1000.0f / num_total_frames + 0.5f); 142 (num_key_frames * 1000 + num_total_frames / 2) / num_total_frames;
144 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille", 143 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille",
145 key_frames_permille); 144 key_frames_permille);
146 } 145 }
147 146
148 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); 147 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples);
149 if (qp != -1) 148 if (qp != -1)
150 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); 149 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp);
151 150
152 int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples); 151 int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples);
153 if (decode_ms != -1) 152 if (decode_ms != -1)
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 sum = 0; 586 sum = 0;
588 } 587 }
589 588
590 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, 589 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms,
591 int64_t max_rtt_ms) { 590 int64_t max_rtt_ms) {
592 rtc::CritScope lock(&crit_); 591 rtc::CritScope lock(&crit_);
593 avg_rtt_ms_ = avg_rtt_ms; 592 avg_rtt_ms_ = avg_rtt_ms;
594 } 593 }
595 594
596 } // namespace webrtc 595 } // namespace webrtc
OLDNEW
« 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