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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2649133005: Add QP sum stats for received streams. (Closed)
Patch Set: Changes according to hbos's comments. #1 Created 3 years, 11 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/receive_statistics_proxy.h ('k') | 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 68050ba6a8a440dcc3eb31a4edf22127d99949c0..b78ba66f95c61cb61bba12b42591f1f910aefb4d 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -395,11 +395,20 @@ void ReceiveStatisticsProxy::DataCountersUpdated(
}
}
-void ReceiveStatisticsProxy::OnDecodedFrame() {
+void ReceiveStatisticsProxy::OnDecodedFrame(int qp) {
uint64_t now = clock_->TimeInMilliseconds();
rtc::CritScope lock(&crit_);
++stats_.frames_decoded;
+ if (qp != -1) {
sprang_webrtc 2017/01/25 15:25:41 Maybe we should dcheck on the off chance qp < -1 ?
sakal 2017/01/25 15:34:45 Sure, I can add that once we decide whether to use
sakal 2017/01/26 09:33:31 Done.
+ if (!stats_.qp_sum) {
+ RTC_DCHECK_EQ(stats_.frames_decoded, 1);
+ stats_.qp_sum = rtc::Optional<uint64_t>(0);
+ }
+ *stats_.qp_sum += qp;
+ } else {
+ RTC_DCHECK(!stats_.qp_sum);
sprang_webrtc 2017/01/25 15:25:41 Any chance we could hit this if we change codec on
sakal 2017/01/25 15:34:45 Yes, I think that is possible if one supports prov
sprang_webrtc 2017/01/25 15:59:14 Yeah, logging a warning and resetting the stats so
sakal 2017/01/26 09:33:31 Done.
+ }
decode_fps_estimator_.Update(1, now);
stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0);
}
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698