Expose video freeze metrics in GetStats.
This adds the following non-standardized metrics to video receiver
stats:
- freezeCount
- pauseCount
- totalFreezesDuration
- totalPausesDuration
- totalFramesDuration
- sumOfSquaredFrameDurations
For description of these metrics see
https://henbos.github.io/webrtc-provisional-stats/#RTCVideoReceiverStats-dict*
Bug: webrtc:10145
Change-Id: I4c76d5651102e73b1592ffed561e6224f2badeb6
Reviewed-on: https://webrtc-review.googlesource.com/c/114840
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26523}
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index e66a504..a25a785 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -523,6 +523,20 @@
video_receiver_info.frames_rendered);
video_track_stats->frames_dropped = video_receiver_info.frames_received -
video_receiver_info.frames_rendered;
+ video_track_stats->freeze_count = video_receiver_info.freeze_count;
+ video_track_stats->pause_count = video_receiver_info.pause_count;
+ video_track_stats->total_freezes_duration =
+ static_cast<double>(video_receiver_info.total_freezes_duration_ms) /
+ rtc::kNumMillisecsPerSec;
+ video_track_stats->total_pauses_duration =
+ static_cast<double>(video_receiver_info.total_pauses_duration_ms) /
+ rtc::kNumMillisecsPerSec;
+ video_track_stats->total_frames_duration =
+ static_cast<double>(video_receiver_info.total_frames_duration_ms) /
+ rtc::kNumMillisecsPerSec;
+ video_track_stats->sum_squared_frame_durations =
+ video_receiver_info.sum_squared_frame_durations;
+
return video_track_stats;
}