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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 1905563002: Add histogram for end-to-end delay. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + add separate histogram for end-to-end delay Created 4 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/video_receive_stream.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 66726a57b3b012282cee3b2f62e59735535f0eac..e4be1cc43c310665f9b7be40a1ec1fa62c27369c 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -94,11 +94,14 @@ void ReceiveStatisticsProxy::UpdateHistograms() {
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
current_delay_ms);
}
-
int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples);
if (delay_ms != -1)
RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms);
+ int e2e_delay_ms = e2e_delay_counter_.Avg(kMinRequiredSamples);
+ if (e2e_delay_ms != -1)
+ RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.EndToEndDelayInMs", e2e_delay_ms);
+
StreamDataCounters rtp = stats_.rtp_stats;
StreamDataCounters rtx;
for (auto it : rtx_stats_)
@@ -248,7 +251,9 @@ void ReceiveStatisticsProxy::OnDecodedFrame() {
stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0);
}
-void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
+void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) {
+ int width = frame.width();
+ int height = frame.height();
RTC_DCHECK_GT(width, 0);
RTC_DCHECK_GT(height, 0);
uint64_t now = clock_->TimeInMilliseconds();
@@ -262,6 +267,12 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
render_height_counter_.Add(height);
render_fps_tracker_.AddSamples(1);
render_pixel_tracker_.AddSamples(sqrt(width * height));
+
+ if (frame.ntp_time_ms() > 0) {
+ int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms();
+ if (delay_ms >= 0)
+ e2e_delay_counter_.Add(delay_ms);
+ }
}
void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms) {
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698