Chromium Code Reviews

Side by Side Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2772033002: Add content type information to encoded images and corresponding rtp extension header (Closed)
Patch Set: Set EncodedImage content_type from vie_encoder Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 55 matching lines...)
66 kHighVarianceThreshold, 66 kHighVarianceThreshold,
67 kBadFraction, 67 kBadFraction,
68 kNumMeasurementsVariance), 68 kNumMeasurementsVariance),
69 num_bad_states_(0), 69 num_bad_states_(0),
70 num_certain_states_(0), 70 num_certain_states_(0),
71 // 1000ms window, scale 1000 for ms to s. 71 // 1000ms window, scale 1000 for ms to s.
72 decode_fps_estimator_(1000, 1000), 72 decode_fps_estimator_(1000, 1000),
73 renders_fps_estimator_(1000, 1000), 73 renders_fps_estimator_(1000, 1000),
74 render_fps_tracker_(100, 10u), 74 render_fps_tracker_(100, 10u),
75 render_pixel_tracker_(100, 10u), 75 render_pixel_tracker_(100, 10u),
76 e2e_delay_max_ms_video_(-1),
77 e2e_delay_max_ms_screenshare_(-1),
sprang_webrtc 2017/03/28 11:14:23 Maybe we should report all stats and reset state i
ilnik 2017/03/28 14:47:02 Problem here is that due to packet loss/reordering
76 freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), 78 freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs),
77 first_report_block_time_ms_(-1), 79 first_report_block_time_ms_(-1),
78 avg_rtt_ms_(0), 80 avg_rtt_ms_(0),
79 frame_window_accumulated_bytes_(0) { 81 frame_window_accumulated_bytes_(0) {
80 stats_.ssrc = config_.rtp.remote_ssrc; 82 stats_.ssrc = config_.rtp.remote_ssrc;
81 // TODO(brandtr): Replace |rtx_stats_| with a single instance of 83 // TODO(brandtr): Replace |rtx_stats_| with a single instance of
82 // StreamDataCounters. 84 // StreamDataCounters.
83 if (config_.rtp.rtx_ssrc) { 85 if (config_.rtp.rtx_ssrc) {
84 rtx_stats_[config_.rtp.rtx_ssrc] = StreamDataCounters(); 86 rtx_stats_[config_.rtp.rtx_ssrc] = StreamDataCounters();
85 } 87 }
(...skipping 76 matching lines...)
162 } 164 }
163 int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples); 165 int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples);
164 if (current_delay_ms != -1) { 166 if (current_delay_ms != -1) {
165 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs", 167 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs",
166 current_delay_ms); 168 current_delay_ms);
167 } 169 }
168 int delay_ms = delay_counter_.Avg(kMinRequiredSamples); 170 int delay_ms = delay_counter_.Avg(kMinRequiredSamples);
169 if (delay_ms != -1) 171 if (delay_ms != -1)
170 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); 172 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms);
171 173
172 int e2e_delay_ms = e2e_delay_counter_.Avg(kMinRequiredSamples); 174 int e2e_delay_ms_video = e2e_delay_counter_video_.Avg(kMinRequiredSamples);
173 if (e2e_delay_ms != -1) 175 if (e2e_delay_ms_video != -1) {
174 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.EndToEndDelayInMs", e2e_delay_ms); 176 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.EndToEndDelayInMs",
177 e2e_delay_ms_video);
178 }
179
180 int e2e_delay_ms_screenshare =
181 e2e_delay_counter_screenshare_.Avg(kMinRequiredSamples);
182 if (e2e_delay_ms_screenshare != -1) {
183 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.Screenshare.EndToEndDelayInMs",
184 e2e_delay_ms_screenshare);
185 }
186
187 int e2e_delay_max_ms_video = e2e_delay_max_ms_video_;
188 if (e2e_delay_max_ms_video != -1) {
189 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.EndToEndDelayMaxInMs",
190 e2e_delay_max_ms_video);
191 }
192
193 int e2e_delay_max_ms_screenshare = e2e_delay_max_ms_screenshare_;
194 if (e2e_delay_max_ms_screenshare != -1) {
195 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.Screenshare.EndToEndDelayMaxInMs",
196 e2e_delay_max_ms_screenshare);
197 }
175 198
176 StreamDataCounters rtp = stats_.rtp_stats; 199 StreamDataCounters rtp = stats_.rtp_stats;
177 StreamDataCounters rtx; 200 StreamDataCounters rtx;
178 for (auto it : rtx_stats_) 201 for (auto it : rtx_stats_)
179 rtx.Add(it.second); 202 rtx.Add(it.second);
180 StreamDataCounters rtp_rtx = rtp; 203 StreamDataCounters rtp_rtx = rtp;
181 rtp_rtx.Add(rtx); 204 rtp_rtx.Add(rtx);
182 int64_t elapsed_sec = 205 int64_t elapsed_sec =
183 rtp_rtx.TimeSinceFirstPacketInMs(clock_->TimeInMilliseconds()) / 1000; 206 rtp_rtx.TimeSinceFirstPacketInMs(clock_->TimeInMilliseconds()) / 1000;
184 if (elapsed_sec > metrics::kMinRunTimeInSeconds) { 207 if (elapsed_sec > metrics::kMinRunTimeInSeconds) {
(...skipping 277 matching lines...)
462 ++stats_.frames_rendered; 485 ++stats_.frames_rendered;
463 stats_.width = width; 486 stats_.width = width;
464 stats_.height = height; 487 stats_.height = height;
465 render_width_counter_.Add(width); 488 render_width_counter_.Add(width);
466 render_height_counter_.Add(height); 489 render_height_counter_.Add(height);
467 render_fps_tracker_.AddSamples(1); 490 render_fps_tracker_.AddSamples(1);
468 render_pixel_tracker_.AddSamples(sqrt(width * height)); 491 render_pixel_tracker_.AddSamples(sqrt(width * height));
469 492
470 if (frame.ntp_time_ms() > 0) { 493 if (frame.ntp_time_ms() > 0) {
471 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); 494 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms();
472 if (delay_ms >= 0) 495 if (delay_ms >= 0) {
473 e2e_delay_counter_.Add(delay_ms); 496 if (frame.content_type() == kVideoContent_Screenshare) {
497 e2e_delay_max_ms_screenshare_ =
498 std::max(delay_ms, e2e_delay_max_ms_screenshare_);
499 e2e_delay_counter_screenshare_.Add(delay_ms);
500 } else {
501 e2e_delay_max_ms_video_ = std::max(delay_ms, e2e_delay_max_ms_video_);
502 e2e_delay_counter_video_.Add(delay_ms);
503 }
504 }
474 } 505 }
475 } 506 }
476 507
477 void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms, 508 void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms,
478 double estimated_freq_khz) { 509 double estimated_freq_khz) {
479 rtc::CritScope lock(&crit_); 510 rtc::CritScope lock(&crit_);
480 sync_offset_counter_.Add(std::abs(sync_offset_ms)); 511 sync_offset_counter_.Add(std::abs(sync_offset_ms));
481 stats_.sync_offset_ms = sync_offset_ms; 512 stats_.sync_offset_ms = sync_offset_ms;
482 513
483 const double kMaxFreqKhz = 10000.0; 514 const double kMaxFreqKhz = 10000.0;
(...skipping 64 matching lines...)
548 sum = 0; 579 sum = 0;
549 } 580 }
550 581
551 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, 582 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms,
552 int64_t max_rtt_ms) { 583 int64_t max_rtt_ms) {
553 rtc::CritScope lock(&crit_); 584 rtc::CritScope lock(&crit_);
554 avg_rtt_ms_ = avg_rtt_ms; 585 avg_rtt_ms_ = avg_rtt_ms;
555 } 586 }
556 587
557 } // namespace webrtc 588 } // namespace webrtc
OLDNEW

Powered by Google App Engine