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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: Implement Deadbeef@ 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..b28210de1c35f7c19373aeea61f535811c229c1b 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -80,7 +80,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_() {
stats_.ssrc = config_.rtp.remote_ssrc;
// TODO(brandtr): Replace |rtx_stats_| with a single instance of
// StreamDataCounters.
@@ -371,6 +372,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 default, because default value will be always
+ // overwritten in |OnTimingFrameInfoUpdated|, thus allowing to store new
+ // value instead of reported one.
+ timing_frame_info_ = TimingFrameInfo();
return stats_;
}
@@ -432,6 +438,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.
hbos 2017/06/27 14:08:31 Could we get the latest instead of the longest? Or
ilnik 2017/06/27 15:23:56 Can be simply latest, but this way we may loose im
Taylor Brandstetter 2017/06/28 07:27:46 If I understand correctly, the whole motivation he
ilnik 2017/06/29 08:39:56 Done.
+ if (info.IsLongerThan(timing_frame_info_)) {
+ timing_frame_info_ = info;
+ }
+}
+
void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated(
uint32_t ssrc,
const RtcpPacketTypeCounter& packet_counter) {

Powered by Google App Engine
This is Rietveld 408576698