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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 3008983002: Change reporting of timing frames conditions in GetStats on receive side (Closed)
Patch Set: Implement Tommi@ comments Created 3 years, 3 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 4f231694aa1b5efd7c7daa82f497858fd7153924..f98a3bae062ac823660b4f8874e902add3c5f3b6 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -85,7 +85,8 @@ ReceiveStatisticsProxy::ReceiveStatisticsProxy(
freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs),
first_report_block_time_ms_(-1),
avg_rtt_ms_(0),
- last_content_type_(VideoContentType::UNSPECIFIED) {
+ last_content_type_(VideoContentType::UNSPECIFIED),
+ timing_frame_info_counter_(kMovingMaxWindowMs) {
stats_.ssrc = config_.rtp.remote_ssrc;
// TODO(brandtr): Replace |rtx_stats_| with a single instance of
// StreamDataCounters.
@@ -400,20 +401,10 @@ VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const {
static_cast<int>(total_byte_tracker_.ComputeRate() * 8);
stats_.interframe_delay_max_ms =
interframe_delay_max_moving_.Max(now_ms).value_or(-1);
+ stats_.timing_frame_info = timing_frame_info_counter_.Max(now_ms);
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;
@@ -458,13 +449,9 @@ void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated(
void ReceiveStatisticsProxy::OnTimingFrameInfoUpdated(
const TimingFrameInfo& info) {
+ int64_t now_ms = clock_->TimeInMilliseconds();
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);
- }
+ timing_frame_info_counter_.Add(info, now_ms);
}
void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
« 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