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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: Implement Hbos@ comments Created 3 years, 6 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
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 61b2ad13987aae3afb41f7aed304480b07e9b81f..747e7eae475e6481760ed743958af022c9456599 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -371,6 +371,11 @@ VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
stats_.decode_frame_rate = decode_fps_estimator_.Rate(now_ms).value_or(0);
stats_.total_bitrate_bps =
static_cast<int>(total_byte_tracker_.ComputeRate() * 8);
+ stats_.timing_frame_info = timing_frame_info_;
+ // Reset reported value to empty, so it will be always
+ // overwritten in |OnTimingFrameInfoUpdated|, thus allowing to store new
+ // value instead of reported one.
+ timing_frame_info_.reset();
sprang_webrtc 2017/06/28 15:31:41 I think this is problematic, since the GetStats ca
ilnik 2017/06/29 08:39:56 I don't understand what do you mean. In the end, i
sprang_webrtc 2017/06/30 21:38:20 I was thinking of direct calls to ReceiveStatistic
return stats_;
}
@@ -432,6 +437,17 @@ void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated(
"ssrc", stats_.ssrc);
}
+void ReceiveStatisticsProxy::OnTimingFrameInfoUpdated(
+ const TimingFrameInfo& info) {
+ rtc::CritScope lock(&crit_);
+ // Only the frame which was processed the longest since the last
+ // GetStats() call is reported. Therefore, only single 'longest' frame is
+ // stored.
+ if (!timing_frame_info_ || info.IsLongerThan(*timing_frame_info_)) {
+ timing_frame_info_.emplace(info);
+ }
+}
+
void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
uint32_t ssrc,
const RtcpPacketTypeCounter& packet_counter) {

Powered by Google App Engine
This is Rietveld 408576698