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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: rebase Created 3 years, 5 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 2af19125c24ea62e8a5e5df136d5943744b4fc07..62d0b1c29246f485369f2d9742a292937ef14674 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -406,6 +406,17 @@ VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
return stats_;
}
+rtc::Optional<TimingFrameInfo>
+ReceiveStatisticsProxy::GetAndResetTimingFrameInfo() {
+ rtc::CritScope lock(&crit_);
+ rtc::Optional<TimingFrameInfo> 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();
+ return info;
+}
+
void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) {
rtc::CritScope lock(&crit_);
stats_.current_payload_type = payload_type;
@@ -464,6 +475,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) {
« 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