| OLD | NEW | 
|    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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   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       total_byte_tracker_(100, 10u),  // bucket_interval_ms, bucket_count |   76       total_byte_tracker_(100, 10u),  // bucket_interval_ms, bucket_count | 
 |   77       e2e_delay_max_ms_video_(-1), | 
 |   78       e2e_delay_max_ms_screenshare_(-1), | 
|   77       freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), |   79       freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), | 
|   78       first_report_block_time_ms_(-1), |   80       first_report_block_time_ms_(-1), | 
|   79       avg_rtt_ms_(0) { |   81       avg_rtt_ms_(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   } | 
|   86 } |   88 } | 
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  468   ++stats_.frames_rendered; |  491   ++stats_.frames_rendered; | 
|  469   stats_.width = width; |  492   stats_.width = width; | 
|  470   stats_.height = height; |  493   stats_.height = height; | 
|  471   render_width_counter_.Add(width); |  494   render_width_counter_.Add(width); | 
|  472   render_height_counter_.Add(height); |  495   render_height_counter_.Add(height); | 
|  473   render_fps_tracker_.AddSamples(1); |  496   render_fps_tracker_.AddSamples(1); | 
|  474   render_pixel_tracker_.AddSamples(sqrt(width * height)); |  497   render_pixel_tracker_.AddSamples(sqrt(width * height)); | 
|  475  |  498  | 
|  476   if (frame.ntp_time_ms() > 0) { |  499   if (frame.ntp_time_ms() > 0) { | 
|  477     int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); |  500     int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); | 
|  478     if (delay_ms >= 0) |  501     if (delay_ms >= 0) { | 
|  479       e2e_delay_counter_.Add(delay_ms); |  502       if (frame.content_type() == VideoContentType::kScreenshare) { | 
 |  503         e2e_delay_max_ms_screenshare_ = | 
 |  504             std::max(delay_ms, e2e_delay_max_ms_screenshare_); | 
 |  505         e2e_delay_counter_screenshare_.Add(delay_ms); | 
 |  506       } else { | 
 |  507         e2e_delay_max_ms_video_ = std::max(delay_ms, e2e_delay_max_ms_video_); | 
 |  508         e2e_delay_counter_video_.Add(delay_ms); | 
 |  509       } | 
 |  510     } | 
|  480   } |  511   } | 
|  481 } |  512 } | 
|  482  |  513  | 
|  483 void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms, |  514 void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms, | 
|  484                                                  double estimated_freq_khz) { |  515                                                  double estimated_freq_khz) { | 
|  485   rtc::CritScope lock(&crit_); |  516   rtc::CritScope lock(&crit_); | 
|  486   sync_offset_counter_.Add(std::abs(sync_offset_ms)); |  517   sync_offset_counter_.Add(std::abs(sync_offset_ms)); | 
|  487   stats_.sync_offset_ms = sync_offset_ms; |  518   stats_.sync_offset_ms = sync_offset_ms; | 
|  488  |  519  | 
|  489   const double kMaxFreqKhz = 10000.0; |  520   const double kMaxFreqKhz = 10000.0; | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  553   sum = 0; |  584   sum = 0; | 
|  554 } |  585 } | 
|  555  |  586  | 
|  556 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, |  587 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, | 
|  557                                          int64_t max_rtt_ms) { |  588                                          int64_t max_rtt_ms) { | 
|  558   rtc::CritScope lock(&crit_); |  589   rtc::CritScope lock(&crit_); | 
|  559   avg_rtt_ms_ = avg_rtt_ms; |  590   avg_rtt_ms_ = avg_rtt_ms; | 
|  560 } |  591 } | 
|  561  |  592  | 
|  562 }  // namespace webrtc |  593 }  // namespace webrtc | 
| OLD | NEW |