sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "webrtc/video/receive_statistics_proxy.h" |
| 12 | |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 13 | #include <algorithm> |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 14 | #include <cmath> |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 15 | #include <sstream> |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 16 | #include <utility> |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 17 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 18 | #include "webrtc/modules/pacing/alr_detector.h" |
Henrik Kjellander | 2557b86 | 2015-11-18 22:00:21 +0100 | [diff] [blame] | 19 | #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
Edward Lemur | c20978e | 2017-07-06 19:44:34 +0200 | [diff] [blame] | 20 | #include "webrtc/rtc_base/checks.h" |
| 21 | #include "webrtc/rtc_base/logging.h" |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 22 | #include "webrtc/system_wrappers/include/clock.h" |
Henrik Kjellander | 98f5351 | 2015-10-28 18:17:40 +0100 | [diff] [blame] | 23 | #include "webrtc/system_wrappers/include/metrics.h" |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 24 | |
| 25 | namespace webrtc { |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 26 | namespace { |
| 27 | // Periodic time interval for processing samples for |freq_offset_counter_|. |
| 28 | const int64_t kFreqOffsetProcessIntervalMs = 40000; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 29 | |
| 30 | // Configuration for bad call detection. |
palmkvist | a40672a | 2017-01-13 05:58:34 -0800 | [diff] [blame] | 31 | const int kBadCallMinRequiredSamples = 10; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 32 | const int kMinSampleLengthMs = 990; |
| 33 | const int kNumMeasurements = 10; |
| 34 | const int kNumMeasurementsVariance = kNumMeasurements * 1.5; |
| 35 | const float kBadFraction = 0.8f; |
| 36 | // For fps: |
| 37 | // Low means low enough to be bad, high means high enough to be good |
| 38 | const int kLowFpsThreshold = 12; |
| 39 | const int kHighFpsThreshold = 14; |
| 40 | // For qp and fps variance: |
| 41 | // Low means low enough to be good, high means high enough to be bad |
| 42 | const int kLowQpThresholdVp8 = 60; |
| 43 | const int kHighQpThresholdVp8 = 70; |
| 44 | const int kLowVarianceThreshold = 1; |
| 45 | const int kHighVarianceThreshold = 2; |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 46 | |
ilnik | a79cc28 | 2017-08-23 05:24:10 -0700 | [diff] [blame] | 47 | // Some metrics are reported as a maximum over this period. |
| 48 | const int kMovingMaxWindowMs = 10000; |
| 49 | |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 50 | // How large window we use to calculate the framerate/bitrate. |
| 51 | const int kRateStatisticsWindowSizeMs = 1000; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 52 | |
| 53 | std::string UmaPrefixForContentType(VideoContentType content_type) { |
| 54 | std::stringstream ss; |
| 55 | ss << "WebRTC.Video"; |
| 56 | if (videocontenttypehelpers::IsScreenshare(content_type)) { |
| 57 | ss << ".Screenshare"; |
| 58 | } |
| 59 | return ss.str(); |
| 60 | } |
| 61 | |
| 62 | std::string UmaSuffixForContentType(VideoContentType content_type) { |
| 63 | std::stringstream ss; |
| 64 | int simulcast_id = videocontenttypehelpers::GetSimulcastId(content_type); |
| 65 | if (simulcast_id > 0) { |
| 66 | ss << ".S" << simulcast_id - 1; |
| 67 | } |
| 68 | int experiment_id = videocontenttypehelpers::GetExperimentId(content_type); |
| 69 | if (experiment_id > 0) { |
| 70 | ss << ".ExperimentGroup" << experiment_id - 1; |
| 71 | } |
| 72 | return ss.str(); |
| 73 | } |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 74 | } // namespace |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 75 | |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 76 | ReceiveStatisticsProxy::ReceiveStatisticsProxy( |
Tommi | 733b547 | 2016-06-10 17:58:01 +0200 | [diff] [blame] | 77 | const VideoReceiveStream::Config* config, |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 78 | Clock* clock) |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 79 | : clock_(clock), |
Tommi | 733b547 | 2016-06-10 17:58:01 +0200 | [diff] [blame] | 80 | config_(*config), |
asapersson | 4374a09 | 2016-07-27 00:39:09 -0700 | [diff] [blame] | 81 | start_ms_(clock->TimeInMilliseconds()), |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 82 | last_sample_time_(clock->TimeInMilliseconds()), |
| 83 | fps_threshold_(kLowFpsThreshold, |
| 84 | kHighFpsThreshold, |
| 85 | kBadFraction, |
| 86 | kNumMeasurements), |
| 87 | qp_threshold_(kLowQpThresholdVp8, |
| 88 | kHighQpThresholdVp8, |
| 89 | kBadFraction, |
| 90 | kNumMeasurements), |
| 91 | variance_threshold_(kLowVarianceThreshold, |
| 92 | kHighVarianceThreshold, |
| 93 | kBadFraction, |
| 94 | kNumMeasurementsVariance), |
palmkvist | a40672a | 2017-01-13 05:58:34 -0800 | [diff] [blame] | 95 | num_bad_states_(0), |
| 96 | num_certain_states_(0), |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 97 | // 1000ms window, scale 1000 for ms to s. |
| 98 | decode_fps_estimator_(1000, 1000), |
Tim Psiaki | 6304626 | 2015-09-14 10:38:08 -0700 | [diff] [blame] | 99 | renders_fps_estimator_(1000, 1000), |
Honghai Zhang | 82d7862 | 2016-05-06 11:29:15 -0700 | [diff] [blame] | 100 | render_fps_tracker_(100, 10u), |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 101 | render_pixel_tracker_(100, 10u), |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 102 | total_byte_tracker_(100, 10u), // bucket_interval_ms, bucket_count |
ilnik | a79cc28 | 2017-08-23 05:24:10 -0700 | [diff] [blame] | 103 | interframe_delay_max_moving_(kMovingMaxWindowMs), |
asapersson | 0c43f77 | 2016-11-30 01:42:26 -0800 | [diff] [blame] | 104 | freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 105 | first_report_block_time_ms_(-1), |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 106 | avg_rtt_ms_(0), |
ilnik | 75204c5 | 2017-09-04 03:35:40 -0700 | [diff] [blame^] | 107 | last_content_type_(VideoContentType::UNSPECIFIED), |
| 108 | timing_frame_info_counter_(kMovingMaxWindowMs) { |
Tommi | 733b547 | 2016-06-10 17:58:01 +0200 | [diff] [blame] | 109 | stats_.ssrc = config_.rtp.remote_ssrc; |
brandtr | 1474212 | 2017-01-27 04:53:07 -0800 | [diff] [blame] | 110 | // TODO(brandtr): Replace |rtx_stats_| with a single instance of |
| 111 | // StreamDataCounters. |
| 112 | if (config_.rtp.rtx_ssrc) { |
| 113 | rtx_stats_[config_.rtp.rtx_ssrc] = StreamDataCounters(); |
| 114 | } |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 115 | } |
| 116 | |
Åsa Persson | 3c391cb | 2015-04-27 10:09:49 +0200 | [diff] [blame] | 117 | ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
| 118 | UpdateHistograms(); |
| 119 | } |
| 120 | |
asapersson | d89920b | 2015-07-22 06:52:00 -0700 | [diff] [blame] | 121 | void ReceiveStatisticsProxy::UpdateHistograms() { |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 122 | int stream_duration_sec = (clock_->TimeInMilliseconds() - start_ms_) / 1000; |
| 123 | if (stats_.frame_counts.key_frames > 0 || |
| 124 | stats_.frame_counts.delta_frames > 0) { |
| 125 | RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.ReceiveStreamLifetimeInSeconds", |
| 126 | stream_duration_sec); |
| 127 | LOG(LS_INFO) << "WebRTC.Video.ReceiveStreamLifetimeInSeconds " |
| 128 | << stream_duration_sec; |
| 129 | } |
asapersson | 4374a09 | 2016-07-27 00:39:09 -0700 | [diff] [blame] | 130 | |
asapersson | 0c43f77 | 2016-11-30 01:42:26 -0800 | [diff] [blame] | 131 | if (first_report_block_time_ms_ != -1 && |
| 132 | ((clock_->TimeInMilliseconds() - first_report_block_time_ms_) / 1000) >= |
| 133 | metrics::kMinRunTimeInSeconds) { |
| 134 | int fraction_lost = report_block_stats_.FractionLostInPercent(); |
| 135 | if (fraction_lost != -1) { |
| 136 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.ReceivedPacketsLostInPercent", |
| 137 | fraction_lost); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 138 | LOG(LS_INFO) << "WebRTC.Video.ReceivedPacketsLostInPercent " |
| 139 | << fraction_lost; |
asapersson | 0c43f77 | 2016-11-30 01:42:26 -0800 | [diff] [blame] | 140 | } |
Åsa Persson | 3c391cb | 2015-04-27 10:09:49 +0200 | [diff] [blame] | 141 | } |
asapersson | 0c43f77 | 2016-11-30 01:42:26 -0800 | [diff] [blame] | 142 | |
asapersson | 6718e97 | 2015-07-24 00:20:58 -0700 | [diff] [blame] | 143 | const int kMinRequiredSamples = 200; |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 144 | int samples = static_cast<int>(render_fps_tracker_.TotalSampleCount()); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 145 | if (samples >= kMinRequiredSamples) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 146 | RTC_HISTOGRAM_COUNTS_100("WebRTC.Video.RenderFramesPerSecond", |
| 147 | round(render_fps_tracker_.ComputeTotalRate())); |
| 148 | RTC_HISTOGRAM_COUNTS_100000( |
asapersson | 28ba927 | 2016-01-25 05:58:23 -0800 | [diff] [blame] | 149 | "WebRTC.Video.RenderSqrtPixelsPerSecond", |
Tim Psiaki | ad13d2f | 2015-11-10 16:34:50 -0800 | [diff] [blame] | 150 | round(render_pixel_tracker_.ComputeTotalRate())); |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 151 | } |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 152 | |
asapersson | f8cdd18 | 2016-03-15 01:00:47 -0700 | [diff] [blame] | 153 | int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples); |
pbos | 35fdb2a | 2016-05-03 03:32:10 -0700 | [diff] [blame] | 154 | if (sync_offset_ms != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 155 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 156 | LOG(LS_INFO) << "WebRTC.Video.AVSyncOffsetInMs " << sync_offset_ms; |
pbos | 35fdb2a | 2016-05-03 03:32:10 -0700 | [diff] [blame] | 157 | } |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 158 | AggregatedStats freq_offset_stats = freq_offset_counter_.GetStats(); |
| 159 | if (freq_offset_stats.num_samples > 0) { |
| 160 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtpToNtpFreqOffsetInKhz", |
| 161 | freq_offset_stats.average); |
asapersson | 43cb716 | 2016-11-15 08:20:48 -0800 | [diff] [blame] | 162 | LOG(LS_INFO) << "WebRTC.Video.RtpToNtpFreqOffsetInKhz, " |
| 163 | << freq_offset_stats.ToString(); |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 164 | } |
asapersson | f8cdd18 | 2016-03-15 01:00:47 -0700 | [diff] [blame] | 165 | |
asapersson | b99baf8 | 2017-04-20 04:05:43 -0700 | [diff] [blame] | 166 | int num_total_frames = |
| 167 | stats_.frame_counts.key_frames + stats_.frame_counts.delta_frames; |
| 168 | if (num_total_frames >= kMinRequiredSamples) { |
| 169 | int num_key_frames = stats_.frame_counts.key_frames; |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 170 | int key_frames_permille = |
asapersson | b99baf8 | 2017-04-20 04:05:43 -0700 | [diff] [blame] | 171 | (num_key_frames * 1000 + num_total_frames / 2) / num_total_frames; |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 172 | RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.KeyFramesReceivedInPermille", |
| 173 | key_frames_permille); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 174 | LOG(LS_INFO) << "WebRTC.Video.KeyFramesReceivedInPermille " |
| 175 | << key_frames_permille; |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 176 | } |
| 177 | |
asapersson | 86b0160 | 2015-10-20 23:55:26 -0700 | [diff] [blame] | 178 | int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 179 | if (qp != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 180 | RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 181 | LOG(LS_INFO) << "WebRTC.Video.Decoded.Vp8.Qp " << qp; |
| 182 | } |
asapersson | a563c21 | 2017-03-02 08:25:46 -0800 | [diff] [blame] | 183 | int decode_ms = decode_time_counter_.Avg(kMinRequiredSamples); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 184 | if (decode_ms != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 185 | RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 186 | LOG(LS_INFO) << "WebRTC.Video.DecodeTimeInMs " << decode_ms; |
| 187 | } |
asapersson | a563c21 | 2017-03-02 08:25:46 -0800 | [diff] [blame] | 188 | int jb_delay_ms = jitter_buffer_delay_counter_.Avg(kMinRequiredSamples); |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 189 | if (jb_delay_ms != -1) { |
| 190 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.JitterBufferDelayInMs", |
| 191 | jb_delay_ms); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 192 | LOG(LS_INFO) << "WebRTC.Video.JitterBufferDelayInMs " << jb_delay_ms; |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 193 | } |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 194 | |
asapersson | a563c21 | 2017-03-02 08:25:46 -0800 | [diff] [blame] | 195 | int target_delay_ms = target_delay_counter_.Avg(kMinRequiredSamples); |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 196 | if (target_delay_ms != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 197 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.TargetDelayInMs", target_delay_ms); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 198 | LOG(LS_INFO) << "WebRTC.Video.TargetDelayInMs " << target_delay_ms; |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 199 | } |
asapersson | a563c21 | 2017-03-02 08:25:46 -0800 | [diff] [blame] | 200 | int current_delay_ms = current_delay_counter_.Avg(kMinRequiredSamples); |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 201 | if (current_delay_ms != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 202 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.CurrentDelayInMs", |
| 203 | current_delay_ms); |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 204 | LOG(LS_INFO) << "WebRTC.Video.CurrentDelayInMs " << current_delay_ms; |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 205 | } |
asapersson | a563c21 | 2017-03-02 08:25:46 -0800 | [diff] [blame] | 206 | int delay_ms = delay_counter_.Avg(kMinRequiredSamples); |
asapersson | 13c433c | 2015-10-06 04:08:15 -0700 | [diff] [blame] | 207 | if (delay_ms != -1) |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 208 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.OnewayDelayInMs", delay_ms); |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 209 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 210 | // Aggregate content_specific_stats_ by removing experiment or simulcast |
| 211 | // information; |
| 212 | std::map<VideoContentType, ContentSpecificStats> aggregated_stats; |
| 213 | for (auto it : content_specific_stats_) { |
| 214 | // Calculate simulcast specific metrics (".S0" ... ".S2" suffixes). |
| 215 | VideoContentType content_type = it.first; |
| 216 | if (videocontenttypehelpers::GetSimulcastId(content_type) > 0) { |
| 217 | // Aggregate on experiment id. |
| 218 | videocontenttypehelpers::SetExperimentId(&content_type, 0); |
| 219 | aggregated_stats[content_type].Add(it.second); |
| 220 | } |
| 221 | // Calculate experiment specific metrics (".ExperimentGroup[0-7]" suffixes). |
| 222 | content_type = it.first; |
| 223 | if (videocontenttypehelpers::GetExperimentId(content_type) > 0) { |
| 224 | // Aggregate on simulcast id. |
| 225 | videocontenttypehelpers::SetSimulcastId(&content_type, 0); |
| 226 | aggregated_stats[content_type].Add(it.second); |
| 227 | } |
| 228 | // Calculate aggregated metrics (no suffixes. Aggregated on everything). |
| 229 | content_type = it.first; |
| 230 | videocontenttypehelpers::SetSimulcastId(&content_type, 0); |
| 231 | videocontenttypehelpers::SetExperimentId(&content_type, 0); |
| 232 | aggregated_stats[content_type].Add(it.second); |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 233 | } |
| 234 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 235 | for (auto it : aggregated_stats) { |
| 236 | // For the metric Foo we report the following slices: |
| 237 | // WebRTC.Video.Foo, |
| 238 | // WebRTC.Video.Screenshare.Foo, |
| 239 | // WebRTC.Video.Foo.S[0-3], |
| 240 | // WebRTC.Video.Foo.ExperimentGroup[0-7], |
| 241 | // WebRTC.Video.Screenshare.Foo.S[0-3], |
| 242 | // WebRTC.Video.Screenshare.Foo.ExperimentGroup[0-7]. |
| 243 | auto content_type = it.first; |
| 244 | auto stats = it.second; |
| 245 | std::string uma_prefix = UmaPrefixForContentType(content_type); |
| 246 | std::string uma_suffix = UmaSuffixForContentType(content_type); |
| 247 | // Metrics can be sliced on either simulcast id or experiment id but not |
| 248 | // both. |
| 249 | RTC_DCHECK(videocontenttypehelpers::GetExperimentId(content_type) == 0 || |
| 250 | videocontenttypehelpers::GetSimulcastId(content_type) == 0); |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 251 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 252 | int e2e_delay_ms = stats.e2e_delay_counter.Avg(kMinRequiredSamples); |
| 253 | if (e2e_delay_ms != -1) { |
| 254 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 255 | uma_prefix + ".EndToEndDelayInMs" + uma_suffix, e2e_delay_ms); |
| 256 | LOG(LS_INFO) << uma_prefix << ".EndToEndDelayInMs" << uma_suffix << " " |
| 257 | << e2e_delay_ms; |
| 258 | } |
| 259 | int e2e_delay_max_ms = stats.e2e_delay_counter.Max(); |
| 260 | if (e2e_delay_max_ms != -1 && e2e_delay_ms != -1) { |
| 261 | RTC_HISTOGRAM_COUNTS_SPARSE_100000( |
| 262 | uma_prefix + ".EndToEndDelayMaxInMs" + uma_suffix, e2e_delay_max_ms); |
| 263 | LOG(LS_INFO) << uma_prefix << ".EndToEndDelayMaxInMs" << uma_suffix << " " |
| 264 | << e2e_delay_max_ms; |
| 265 | } |
| 266 | int interframe_delay_ms = |
| 267 | stats.interframe_delay_counter.Avg(kMinRequiredSamples); |
| 268 | if (interframe_delay_ms != -1) { |
| 269 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 270 | uma_prefix + ".InterframeDelayInMs" + uma_suffix, |
| 271 | interframe_delay_ms); |
| 272 | LOG(LS_INFO) << uma_prefix << ".InterframeDelayInMs" << uma_suffix << " " |
| 273 | << interframe_delay_ms; |
| 274 | } |
| 275 | int interframe_delay_max_ms = stats.interframe_delay_counter.Max(); |
| 276 | if (interframe_delay_max_ms != -1 && interframe_delay_ms != -1) { |
| 277 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 278 | uma_prefix + ".InterframeDelayMaxInMs" + uma_suffix, |
| 279 | interframe_delay_max_ms); |
| 280 | LOG(LS_INFO) << uma_prefix << ".InterframeDelayMaxInMs" << uma_suffix |
| 281 | << " " << interframe_delay_max_ms; |
| 282 | } |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 283 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 284 | int width = stats.received_width.Avg(kMinRequiredSamples); |
| 285 | if (width != -1) { |
| 286 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 287 | uma_prefix + ".ReceivedWidthInPixels" + uma_suffix, width); |
| 288 | LOG(LS_INFO) << uma_prefix << ".ReceivedWidthInPixels" << uma_suffix |
| 289 | << " " << width; |
| 290 | } |
asapersson | 1490f7a | 2016-09-23 02:09:46 -0700 | [diff] [blame] | 291 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 292 | int height = stats.received_height.Avg(kMinRequiredSamples); |
| 293 | if (height != -1) { |
| 294 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 295 | uma_prefix + ".ReceivedHeightInPixels" + uma_suffix, height); |
| 296 | LOG(LS_INFO) << uma_prefix << ".ReceivedHeightInPixels" << uma_suffix |
| 297 | << " " << height; |
| 298 | } |
ilnik | 4257ab2 | 2017-07-03 01:15:58 -0700 | [diff] [blame] | 299 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 300 | if (content_type != VideoContentType::UNSPECIFIED) { |
| 301 | // Don't report these 3 metrics unsliced, as more precise variants |
| 302 | // are reported separately in this method. |
| 303 | float flow_duration_sec = stats.flow_duration_ms / 1000.0; |
| 304 | if (flow_duration_sec >= metrics::kMinRunTimeInSeconds) { |
| 305 | int media_bitrate_kbps = static_cast<int>(stats.total_media_bytes * 8 / |
| 306 | flow_duration_sec / 1000); |
| 307 | RTC_HISTOGRAM_COUNTS_SPARSE_10000( |
| 308 | uma_prefix + ".MediaBitrateReceivedInKbps" + uma_suffix, |
| 309 | media_bitrate_kbps); |
| 310 | LOG(LS_INFO) << uma_prefix << ".MediaBitrateReceivedInKbps" |
| 311 | << uma_suffix << " " << media_bitrate_kbps; |
| 312 | } |
| 313 | |
| 314 | int num_total_frames = |
| 315 | stats.frame_counts.key_frames + stats.frame_counts.delta_frames; |
| 316 | if (num_total_frames >= kMinRequiredSamples) { |
| 317 | int num_key_frames = stats.frame_counts.key_frames; |
| 318 | int key_frames_permille = |
| 319 | (num_key_frames * 1000 + num_total_frames / 2) / num_total_frames; |
| 320 | RTC_HISTOGRAM_COUNTS_SPARSE_1000( |
| 321 | uma_prefix + ".KeyFramesReceivedInPermille" + uma_suffix, |
| 322 | key_frames_permille); |
| 323 | LOG(LS_INFO) << uma_prefix << ".KeyFramesReceivedInPermille" |
| 324 | << uma_suffix << " " << key_frames_permille; |
| 325 | } |
| 326 | |
| 327 | int qp = stats.qp_counter.Avg(kMinRequiredSamples); |
| 328 | if (qp != -1) { |
| 329 | RTC_HISTOGRAM_COUNTS_SPARSE_200( |
| 330 | uma_prefix + ".Decoded.Vp8.Qp" + uma_suffix, qp); |
| 331 | LOG(LS_INFO) << uma_prefix << ".Decoded.Vp8.Qp" << uma_suffix << " " |
| 332 | << qp; |
| 333 | } |
| 334 | } |
ilnik | 4257ab2 | 2017-07-03 01:15:58 -0700 | [diff] [blame] | 335 | } |
| 336 | |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 337 | StreamDataCounters rtp = stats_.rtp_stats; |
| 338 | StreamDataCounters rtx; |
| 339 | for (auto it : rtx_stats_) |
| 340 | rtx.Add(it.second); |
| 341 | StreamDataCounters rtp_rtx = rtp; |
| 342 | rtp_rtx.Add(rtx); |
| 343 | int64_t elapsed_sec = |
| 344 | rtp_rtx.TimeSinceFirstPacketInMs(clock_->TimeInMilliseconds()) / 1000; |
asapersson | 2077f2f | 2017-05-11 05:37:35 -0700 | [diff] [blame] | 345 | if (elapsed_sec >= metrics::kMinRunTimeInSeconds) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 346 | RTC_HISTOGRAM_COUNTS_10000( |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 347 | "WebRTC.Video.BitrateReceivedInKbps", |
| 348 | static_cast<int>(rtp_rtx.transmitted.TotalBytes() * 8 / elapsed_sec / |
| 349 | 1000)); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 350 | int media_bitrate_kbs = |
| 351 | static_cast<int>(rtp.MediaPayloadBytes() * 8 / elapsed_sec / 1000); |
| 352 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.MediaBitrateReceivedInKbps", |
| 353 | media_bitrate_kbs); |
| 354 | LOG(LS_INFO) << "WebRTC.Video.MediaBitrateReceivedInKbps " |
| 355 | << media_bitrate_kbs; |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 356 | RTC_HISTOGRAM_COUNTS_10000( |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 357 | "WebRTC.Video.PaddingBitrateReceivedInKbps", |
| 358 | static_cast<int>(rtp_rtx.transmitted.padding_bytes * 8 / elapsed_sec / |
| 359 | 1000)); |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 360 | RTC_HISTOGRAM_COUNTS_10000( |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 361 | "WebRTC.Video.RetransmittedBitrateReceivedInKbps", |
| 362 | static_cast<int>(rtp_rtx.retransmitted.TotalBytes() * 8 / elapsed_sec / |
| 363 | 1000)); |
| 364 | if (!rtx_stats_.empty()) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 365 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.RtxBitrateReceivedInKbps", |
| 366 | static_cast<int>(rtx.transmitted.TotalBytes() * |
| 367 | 8 / elapsed_sec / 1000)); |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 368 | } |
brandtr | b5f2c3f | 2016-10-04 23:28:39 -0700 | [diff] [blame] | 369 | if (config_.rtp.ulpfec.ulpfec_payload_type != -1) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 370 | RTC_HISTOGRAM_COUNTS_10000( |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 371 | "WebRTC.Video.FecBitrateReceivedInKbps", |
| 372 | static_cast<int>(rtp_rtx.fec.TotalBytes() * 8 / elapsed_sec / 1000)); |
| 373 | } |
sprang | 07fb9be | 2016-02-24 07:55:00 -0800 | [diff] [blame] | 374 | const RtcpPacketTypeCounter& counters = stats_.rtcp_packet_type_counts; |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 375 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.NackPacketsSentPerMinute", |
| 376 | counters.nack_packets * 60 / elapsed_sec); |
| 377 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.FirPacketsSentPerMinute", |
| 378 | counters.fir_packets * 60 / elapsed_sec); |
| 379 | RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.PliPacketsSentPerMinute", |
| 380 | counters.pli_packets * 60 / elapsed_sec); |
sprang | 07fb9be | 2016-02-24 07:55:00 -0800 | [diff] [blame] | 381 | if (counters.nack_requests > 0) { |
asapersson | 1d02d3e | 2016-09-09 22:40:25 -0700 | [diff] [blame] | 382 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.UniqueNackRequestsSentInPercent", |
| 383 | counters.UniqueNackRequestsInPercent()); |
sprang | 07fb9be | 2016-02-24 07:55:00 -0800 | [diff] [blame] | 384 | } |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 385 | } |
palmkvist | a40672a | 2017-01-13 05:58:34 -0800 | [diff] [blame] | 386 | |
| 387 | if (num_certain_states_ >= kBadCallMinRequiredSamples) { |
| 388 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.Any", |
| 389 | 100 * num_bad_states_ / num_certain_states_); |
| 390 | } |
| 391 | rtc::Optional<double> fps_fraction = |
| 392 | fps_threshold_.FractionHigh(kBadCallMinRequiredSamples); |
| 393 | if (fps_fraction) { |
| 394 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.FrameRate", |
| 395 | static_cast<int>(100 * (1 - *fps_fraction))); |
| 396 | } |
| 397 | rtc::Optional<double> variance_fraction = |
| 398 | variance_threshold_.FractionHigh(kBadCallMinRequiredSamples); |
| 399 | if (variance_fraction) { |
| 400 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.FrameRateVariance", |
| 401 | static_cast<int>(100 * *variance_fraction)); |
| 402 | } |
| 403 | rtc::Optional<double> qp_fraction = |
| 404 | qp_threshold_.FractionHigh(kBadCallMinRequiredSamples); |
| 405 | if (qp_fraction) { |
| 406 | RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.BadCall.Qp", |
| 407 | static_cast<int>(100 * *qp_fraction)); |
| 408 | } |
Åsa Persson | 3c391cb | 2015-04-27 10:09:49 +0200 | [diff] [blame] | 409 | } |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 410 | |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 411 | void ReceiveStatisticsProxy::QualitySample() { |
| 412 | int64_t now = clock_->TimeInMilliseconds(); |
| 413 | if (last_sample_time_ + kMinSampleLengthMs > now) |
| 414 | return; |
| 415 | |
| 416 | double fps = |
| 417 | render_fps_tracker_.ComputeRateForInterval(now - last_sample_time_); |
| 418 | int qp = qp_sample_.Avg(1); |
| 419 | |
| 420 | bool prev_fps_bad = !fps_threshold_.IsHigh().value_or(true); |
| 421 | bool prev_qp_bad = qp_threshold_.IsHigh().value_or(false); |
| 422 | bool prev_variance_bad = variance_threshold_.IsHigh().value_or(false); |
| 423 | bool prev_any_bad = prev_fps_bad || prev_qp_bad || prev_variance_bad; |
| 424 | |
| 425 | fps_threshold_.AddMeasurement(static_cast<int>(fps)); |
| 426 | if (qp != -1) |
| 427 | qp_threshold_.AddMeasurement(qp); |
| 428 | rtc::Optional<double> fps_variance_opt = fps_threshold_.CalculateVariance(); |
| 429 | double fps_variance = fps_variance_opt.value_or(0); |
| 430 | if (fps_variance_opt) { |
| 431 | variance_threshold_.AddMeasurement(static_cast<int>(fps_variance)); |
| 432 | } |
| 433 | |
| 434 | bool fps_bad = !fps_threshold_.IsHigh().value_or(true); |
| 435 | bool qp_bad = qp_threshold_.IsHigh().value_or(false); |
| 436 | bool variance_bad = variance_threshold_.IsHigh().value_or(false); |
| 437 | bool any_bad = fps_bad || qp_bad || variance_bad; |
| 438 | |
| 439 | if (!prev_any_bad && any_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 440 | LOG(LS_INFO) << "Bad call (any) start: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 441 | } else if (prev_any_bad && !any_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 442 | LOG(LS_INFO) << "Bad call (any) end: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 443 | } |
| 444 | |
| 445 | if (!prev_fps_bad && fps_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 446 | LOG(LS_INFO) << "Bad call (fps) start: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 447 | } else if (prev_fps_bad && !fps_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 448 | LOG(LS_INFO) << "Bad call (fps) end: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 449 | } |
| 450 | |
| 451 | if (!prev_qp_bad && qp_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 452 | LOG(LS_INFO) << "Bad call (qp) start: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 453 | } else if (prev_qp_bad && !qp_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 454 | LOG(LS_INFO) << "Bad call (qp) end: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 455 | } |
| 456 | |
| 457 | if (!prev_variance_bad && variance_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 458 | LOG(LS_INFO) << "Bad call (variance) start: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 459 | } else if (prev_variance_bad && !variance_bad) { |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 460 | LOG(LS_INFO) << "Bad call (variance) end: " << now; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 461 | } |
| 462 | |
palmkvist | c7e7e07 | 2017-01-09 07:23:33 -0800 | [diff] [blame] | 463 | LOG(LS_VERBOSE) << "SAMPLE: sample_length: " << (now - last_sample_time_) |
| 464 | << " fps: " << fps << " fps_bad: " << fps_bad << " qp: " << qp |
| 465 | << " qp_bad: " << qp_bad << " variance_bad: " << variance_bad |
| 466 | << " fps_variance: " << fps_variance; |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 467 | |
| 468 | last_sample_time_ = now; |
| 469 | qp_sample_.Reset(); |
palmkvist | a40672a | 2017-01-13 05:58:34 -0800 | [diff] [blame] | 470 | |
| 471 | if (fps_threshold_.IsHigh() || variance_threshold_.IsHigh() || |
| 472 | qp_threshold_.IsHigh()) { |
| 473 | if (any_bad) |
| 474 | ++num_bad_states_; |
| 475 | ++num_certain_states_; |
| 476 | } |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 477 | } |
| 478 | |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 479 | void ReceiveStatisticsProxy::UpdateFramerate(int64_t now_ms) const { |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 480 | int64_t old_frames_ms = now_ms - kRateStatisticsWindowSizeMs; |
| 481 | while (!frame_window_.empty() && |
| 482 | frame_window_.begin()->first < old_frames_ms) { |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 483 | frame_window_.erase(frame_window_.begin()); |
| 484 | } |
| 485 | |
| 486 | size_t framerate = |
| 487 | (frame_window_.size() * 1000 + 500) / kRateStatisticsWindowSizeMs; |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 488 | stats_.network_frame_rate = static_cast<int>(framerate); |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 489 | } |
| 490 | |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 491 | VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 492 | rtc::CritScope lock(&crit_); |
sprang | 948b275 | 2017-05-04 02:47:13 -0700 | [diff] [blame] | 493 | // Get current frame rates here, as only updating them on new frames prevents |
| 494 | // us from ever correctly displaying frame rate of 0. |
| 495 | int64_t now_ms = clock_->TimeInMilliseconds(); |
| 496 | UpdateFramerate(now_ms); |
| 497 | stats_.render_frame_rate = renders_fps_estimator_.Rate(now_ms).value_or(0); |
| 498 | stats_.decode_frame_rate = decode_fps_estimator_.Rate(now_ms).value_or(0); |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 499 | stats_.total_bitrate_bps = |
| 500 | static_cast<int>(total_byte_tracker_.ComputeRate() * 8); |
ilnik | a79cc28 | 2017-08-23 05:24:10 -0700 | [diff] [blame] | 501 | stats_.interframe_delay_max_ms = |
| 502 | interframe_delay_max_moving_.Max(now_ms).value_or(-1); |
ilnik | 75204c5 | 2017-09-04 03:35:40 -0700 | [diff] [blame^] | 503 | stats_.timing_frame_info = timing_frame_info_counter_.Max(now_ms); |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 504 | return stats_; |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 505 | } |
| 506 | |
pbos | f42376c | 2015-08-28 07:35:32 -0700 | [diff] [blame] | 507 | void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
| 508 | rtc::CritScope lock(&crit_); |
| 509 | stats_.current_payload_type = payload_type; |
| 510 | } |
| 511 | |
Peter Boström | b7d9a97 | 2015-12-18 16:01:11 +0100 | [diff] [blame] | 512 | void ReceiveStatisticsProxy::OnDecoderImplementationName( |
| 513 | const char* implementation_name) { |
| 514 | rtc::CritScope lock(&crit_); |
| 515 | stats_.decoder_implementation_name = implementation_name; |
| 516 | } |
pbos | f42376c | 2015-08-28 07:35:32 -0700 | [diff] [blame] | 517 | void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, |
| 518 | unsigned int bitrate_bps) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 519 | rtc::CritScope lock(&crit_); |
palmkvist | a40672a | 2017-01-13 05:58:34 -0800 | [diff] [blame] | 520 | if (stats_.rtp_stats.first_packet_time_ms != -1) |
| 521 | QualitySample(); |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 522 | } |
| 523 | |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 524 | void ReceiveStatisticsProxy::OnFrameBufferTimingsUpdated( |
| 525 | int decode_ms, |
| 526 | int max_decode_ms, |
| 527 | int current_delay_ms, |
| 528 | int target_delay_ms, |
| 529 | int jitter_buffer_ms, |
| 530 | int min_playout_delay_ms, |
| 531 | int render_delay_ms) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 532 | rtc::CritScope lock(&crit_); |
pbos@webrtc.org | 09c77b9 | 2015-02-25 10:42:16 +0000 | [diff] [blame] | 533 | stats_.decode_ms = decode_ms; |
| 534 | stats_.max_decode_ms = max_decode_ms; |
| 535 | stats_.current_delay_ms = current_delay_ms; |
| 536 | stats_.target_delay_ms = target_delay_ms; |
| 537 | stats_.jitter_buffer_ms = jitter_buffer_ms; |
| 538 | stats_.min_playout_delay_ms = min_playout_delay_ms; |
| 539 | stats_.render_delay_ms = render_delay_ms; |
asapersson | 6718e97 | 2015-07-24 00:20:58 -0700 | [diff] [blame] | 540 | decode_time_counter_.Add(decode_ms); |
asapersson | 8688a4e | 2016-04-27 23:42:35 -0700 | [diff] [blame] | 541 | jitter_buffer_delay_counter_.Add(jitter_buffer_ms); |
| 542 | target_delay_counter_.Add(target_delay_ms); |
| 543 | current_delay_counter_.Add(current_delay_ms); |
asapersson | a186288 | 2016-04-18 00:41:05 -0700 | [diff] [blame] | 544 | // Network delay (rtt/2) + target_delay_ms (jitter delay + decode time + |
| 545 | // render delay). |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 546 | delay_counter_.Add(target_delay_ms + avg_rtt_ms_ / 2); |
pbos@webrtc.org | 98c04b3 | 2014-12-18 13:12:52 +0000 | [diff] [blame] | 547 | } |
| 548 | |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 549 | void ReceiveStatisticsProxy::OnTimingFrameInfoUpdated( |
| 550 | const TimingFrameInfo& info) { |
ilnik | 75204c5 | 2017-09-04 03:35:40 -0700 | [diff] [blame^] | 551 | int64_t now_ms = clock_->TimeInMilliseconds(); |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 552 | rtc::CritScope lock(&crit_); |
ilnik | 75204c5 | 2017-09-04 03:35:40 -0700 | [diff] [blame^] | 553 | timing_frame_info_counter_.Add(info, now_ms); |
ilnik | 2edc684 | 2017-07-06 03:06:50 -0700 | [diff] [blame] | 554 | } |
| 555 | |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 556 | void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( |
| 557 | uint32_t ssrc, |
| 558 | const RtcpPacketTypeCounter& packet_counter) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 559 | rtc::CritScope lock(&crit_); |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 560 | if (stats_.ssrc != ssrc) |
| 561 | return; |
| 562 | stats_.rtcp_packet_type_counts = packet_counter; |
| 563 | } |
| 564 | |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 565 | void ReceiveStatisticsProxy::StatisticsUpdated( |
| 566 | const webrtc::RtcpStatistics& statistics, |
| 567 | uint32_t ssrc) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 568 | rtc::CritScope lock(&crit_); |
henrikg | 91d6ede | 2015-09-17 00:24:34 -0700 | [diff] [blame] | 569 | // TODO(pbos): Handle both local and remote ssrcs here and RTC_DCHECK that we |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 570 | // receive stats from one of them. |
| 571 | if (stats_.ssrc != ssrc) |
| 572 | return; |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 573 | stats_.rtcp_stats = statistics; |
Åsa Persson | 3c391cb | 2015-04-27 10:09:49 +0200 | [diff] [blame] | 574 | report_block_stats_.Store(statistics, ssrc, 0); |
asapersson | 0c43f77 | 2016-11-30 01:42:26 -0800 | [diff] [blame] | 575 | |
| 576 | if (first_report_block_time_ms_ == -1) |
| 577 | first_report_block_time_ms_ = clock_->TimeInMilliseconds(); |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 578 | } |
| 579 | |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 580 | void ReceiveStatisticsProxy::CNameChanged(const char* cname, uint32_t ssrc) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 581 | rtc::CritScope lock(&crit_); |
henrikg | 91d6ede | 2015-09-17 00:24:34 -0700 | [diff] [blame] | 582 | // TODO(pbos): Handle both local and remote ssrcs here and RTC_DCHECK that we |
pbos@webrtc.org | 1d0fa5d | 2015-02-19 12:47:00 +0000 | [diff] [blame] | 583 | // receive stats from one of them. |
| 584 | if (stats_.ssrc != ssrc) |
| 585 | return; |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 586 | stats_.c_name = cname; |
| 587 | } |
| 588 | |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 589 | void ReceiveStatisticsProxy::DataCountersUpdated( |
| 590 | const webrtc::StreamDataCounters& counters, |
| 591 | uint32_t ssrc) { |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 592 | size_t last_total_bytes = 0; |
| 593 | size_t total_bytes = 0; |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 594 | rtc::CritScope lock(&crit_); |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 595 | if (ssrc == stats_.ssrc) { |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 596 | last_total_bytes = stats_.rtp_stats.transmitted.TotalBytes(); |
| 597 | total_bytes = counters.transmitted.TotalBytes(); |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 598 | stats_.rtp_stats = counters; |
| 599 | } else { |
| 600 | auto it = rtx_stats_.find(ssrc); |
| 601 | if (it != rtx_stats_.end()) { |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 602 | last_total_bytes = it->second.transmitted.TotalBytes(); |
| 603 | total_bytes = counters.transmitted.TotalBytes(); |
sprang | 0ab8e81 | 2016-02-24 01:35:40 -0800 | [diff] [blame] | 604 | it->second = counters; |
| 605 | } else { |
| 606 | RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; |
| 607 | } |
| 608 | } |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 609 | if (total_bytes > last_total_bytes) |
| 610 | total_byte_tracker_.AddSamples(total_bytes - last_total_bytes); |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 611 | } |
| 612 | |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 613 | void ReceiveStatisticsProxy::OnDecodedFrame(rtc::Optional<uint8_t> qp, |
| 614 | VideoContentType content_type) { |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 615 | uint64_t now = clock_->TimeInMilliseconds(); |
| 616 | |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 617 | rtc::CritScope lock(&crit_); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 618 | |
| 619 | ContentSpecificStats* content_specific_stats = |
| 620 | &content_specific_stats_[content_type]; |
sakal | e5ba44e | 2016-10-26 07:09:24 -0700 | [diff] [blame] | 621 | ++stats_.frames_decoded; |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 622 | if (qp) { |
| 623 | if (!stats_.qp_sum) { |
| 624 | if (stats_.frames_decoded != 1) { |
| 625 | LOG(LS_WARNING) |
| 626 | << "Frames decoded was not 1 when first qp value was received."; |
| 627 | stats_.frames_decoded = 1; |
| 628 | } |
| 629 | stats_.qp_sum = rtc::Optional<uint64_t>(0); |
| 630 | } |
| 631 | *stats_.qp_sum += *qp; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 632 | content_specific_stats->qp_counter.Add(*qp); |
sakal | cc452e1 | 2017-02-09 04:53:45 -0800 | [diff] [blame] | 633 | } else if (stats_.qp_sum) { |
| 634 | LOG(LS_WARNING) |
| 635 | << "QP sum was already set and no QP was given for a frame."; |
| 636 | stats_.qp_sum = rtc::Optional<uint64_t>(); |
| 637 | } |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 638 | last_content_type_ = content_type; |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 639 | decode_fps_estimator_.Update(1, now); |
ilnik | 4257ab2 | 2017-07-03 01:15:58 -0700 | [diff] [blame] | 640 | if (last_decoded_frame_time_ms_) { |
| 641 | int64_t interframe_delay_ms = now - *last_decoded_frame_time_ms_; |
| 642 | RTC_DCHECK_GE(interframe_delay_ms, 0); |
ilnik | a79cc28 | 2017-08-23 05:24:10 -0700 | [diff] [blame] | 643 | interframe_delay_max_moving_.Add(interframe_delay_ms, now); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 644 | content_specific_stats->interframe_delay_counter.Add(interframe_delay_ms); |
| 645 | content_specific_stats->flow_duration_ms += interframe_delay_ms; |
ilnik | 4257ab2 | 2017-07-03 01:15:58 -0700 | [diff] [blame] | 646 | } |
| 647 | last_decoded_frame_time_ms_.emplace(now); |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 648 | } |
| 649 | |
asapersson | 1490f7a | 2016-09-23 02:09:46 -0700 | [diff] [blame] | 650 | void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { |
| 651 | int width = frame.width(); |
| 652 | int height = frame.height(); |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 653 | RTC_DCHECK_GT(width, 0); |
| 654 | RTC_DCHECK_GT(height, 0); |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 655 | uint64_t now = clock_->TimeInMilliseconds(); |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 656 | rtc::CritScope lock(&crit_); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 657 | ContentSpecificStats* content_specific_stats = |
| 658 | &content_specific_stats_[last_content_type_]; |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 659 | renders_fps_estimator_.Update(1, now); |
hbos | 50cfe1f | 2017-01-23 07:21:55 -0800 | [diff] [blame] | 660 | ++stats_.frames_rendered; |
asapersson | 2e5cfcd | 2016-08-11 08:41:18 -0700 | [diff] [blame] | 661 | stats_.width = width; |
| 662 | stats_.height = height; |
Tim Psiaki | 6304626 | 2015-09-14 10:38:08 -0700 | [diff] [blame] | 663 | render_fps_tracker_.AddSamples(1); |
asapersson | f839dcc | 2015-10-08 00:41:59 -0700 | [diff] [blame] | 664 | render_pixel_tracker_.AddSamples(sqrt(width * height)); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 665 | content_specific_stats->received_width.Add(width); |
| 666 | content_specific_stats->received_height.Add(height); |
asapersson | 1490f7a | 2016-09-23 02:09:46 -0700 | [diff] [blame] | 667 | |
| 668 | if (frame.ntp_time_ms() > 0) { |
| 669 | int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 670 | if (delay_ms >= 0) { |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 671 | content_specific_stats->e2e_delay_counter.Add(delay_ms); |
ilnik | 00d802b | 2017-04-11 10:34:31 -0700 | [diff] [blame] | 672 | } |
asapersson | 1490f7a | 2016-09-23 02:09:46 -0700 | [diff] [blame] | 673 | } |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 674 | } |
| 675 | |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 676 | void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms, |
| 677 | double estimated_freq_khz) { |
asapersson | f8cdd18 | 2016-03-15 01:00:47 -0700 | [diff] [blame] | 678 | rtc::CritScope lock(&crit_); |
| 679 | sync_offset_counter_.Add(std::abs(sync_offset_ms)); |
| 680 | stats_.sync_offset_ms = sync_offset_ms; |
asapersson | de9e5ff | 2016-11-02 07:14:03 -0700 | [diff] [blame] | 681 | |
| 682 | const double kMaxFreqKhz = 10000.0; |
| 683 | int offset_khz = kMaxFreqKhz; |
| 684 | // Should not be zero or negative. If so, report max. |
| 685 | if (estimated_freq_khz < kMaxFreqKhz && estimated_freq_khz > 0.0) |
| 686 | offset_khz = static_cast<int>(std::fabs(estimated_freq_khz - 90.0) + 0.5); |
| 687 | |
| 688 | freq_offset_counter_.Add(offset_khz); |
asapersson | f8cdd18 | 2016-03-15 01:00:47 -0700 | [diff] [blame] | 689 | } |
| 690 | |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 691 | void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, |
| 692 | uint32_t frameRate) { |
| 693 | } |
| 694 | |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 695 | void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe, |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 696 | size_t size_bytes, |
| 697 | VideoContentType content_type) { |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 698 | rtc::CritScope lock(&crit_); |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 699 | if (is_keyframe) { |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 700 | ++stats_.frame_counts.key_frames; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 701 | } else { |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 702 | ++stats_.frame_counts.delta_frames; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 703 | } |
| 704 | |
| 705 | ContentSpecificStats* content_specific_stats = |
| 706 | &content_specific_stats_[content_type]; |
| 707 | |
| 708 | content_specific_stats->total_media_bytes += size_bytes; |
| 709 | if (is_keyframe) { |
| 710 | ++content_specific_stats->frame_counts.key_frames; |
| 711 | } else { |
| 712 | ++content_specific_stats->frame_counts.delta_frames; |
| 713 | } |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 714 | |
| 715 | int64_t now_ms = clock_->TimeInMilliseconds(); |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 716 | frame_window_.insert(std::make_pair(now_ms, size_bytes)); |
asapersson | 0255acb | 2017-03-28 02:44:58 -0700 | [diff] [blame] | 717 | UpdateFramerate(now_ms); |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 718 | } |
| 719 | |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 720 | void ReceiveStatisticsProxy::OnFrameCountsUpdated( |
| 721 | const FrameCounts& frame_counts) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 722 | rtc::CritScope lock(&crit_); |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 723 | stats_.frame_counts = frame_counts; |
| 724 | } |
| 725 | |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 726 | void ReceiveStatisticsProxy::OnDiscardedPacketsUpdated(int discarded_packets) { |
Peter Boström | f2f8283 | 2015-05-01 13:00:41 +0200 | [diff] [blame] | 727 | rtc::CritScope lock(&crit_); |
pbos@webrtc.org | 5570769 | 2014-12-19 15:45:03 +0000 | [diff] [blame] | 728 | stats_.discarded_packets = discarded_packets; |
| 729 | } |
| 730 | |
asapersson | 86b0160 | 2015-10-20 23:55:26 -0700 | [diff] [blame] | 731 | void ReceiveStatisticsProxy::OnPreDecode( |
| 732 | const EncodedImage& encoded_image, |
| 733 | const CodecSpecificInfo* codec_specific_info) { |
Peter Boström | 74f6e9e | 2016-04-04 17:56:10 +0200 | [diff] [blame] | 734 | if (!codec_specific_info || encoded_image.qp_ == -1) { |
asapersson | 86b0160 | 2015-10-20 23:55:26 -0700 | [diff] [blame] | 735 | return; |
| 736 | } |
| 737 | if (codec_specific_info->codecType == kVideoCodecVP8) { |
| 738 | qp_counters_.vp8.Add(encoded_image.qp_); |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 739 | rtc::CritScope lock(&crit_); |
| 740 | qp_sample_.Add(encoded_image.qp_); |
asapersson | 86b0160 | 2015-10-20 23:55:26 -0700 | [diff] [blame] | 741 | } |
| 742 | } |
| 743 | |
sprang | 3e86e7e | 2017-08-22 09:23:28 -0700 | [diff] [blame] | 744 | void ReceiveStatisticsProxy::OnStreamInactive() { |
| 745 | // TODO(sprang): Figure out any other state that should be reset. |
| 746 | |
| 747 | rtc::CritScope lock(&crit_); |
| 748 | // Don't report inter-frame delay if stream was paused. |
| 749 | last_decoded_frame_time_ms_.reset(); |
| 750 | } |
| 751 | |
asapersson | d89920b | 2015-07-22 06:52:00 -0700 | [diff] [blame] | 752 | void ReceiveStatisticsProxy::SampleCounter::Add(int sample) { |
| 753 | sum += sample; |
| 754 | ++num_samples; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 755 | if (!max || sample > *max) { |
| 756 | max.emplace(sample); |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | void ReceiveStatisticsProxy::SampleCounter::Add(const SampleCounter& other) { |
| 761 | sum += other.sum; |
| 762 | num_samples += other.num_samples; |
| 763 | if (other.max && (!max || *max < *other.max)) |
| 764 | max = other.max; |
asapersson | d89920b | 2015-07-22 06:52:00 -0700 | [diff] [blame] | 765 | } |
| 766 | |
asapersson | 6966bd5 | 2017-01-03 00:44:06 -0800 | [diff] [blame] | 767 | int ReceiveStatisticsProxy::SampleCounter::Avg( |
| 768 | int64_t min_required_samples) const { |
asapersson | d89920b | 2015-07-22 06:52:00 -0700 | [diff] [blame] | 769 | if (num_samples < min_required_samples || num_samples == 0) |
| 770 | return -1; |
asapersson | 6966bd5 | 2017-01-03 00:44:06 -0800 | [diff] [blame] | 771 | return static_cast<int>(sum / num_samples); |
asapersson | d89920b | 2015-07-22 06:52:00 -0700 | [diff] [blame] | 772 | } |
| 773 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 774 | int ReceiveStatisticsProxy::SampleCounter::Max() const { |
| 775 | return max.value_or(-1); |
| 776 | } |
| 777 | |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 778 | void ReceiveStatisticsProxy::SampleCounter::Reset() { |
| 779 | num_samples = 0; |
| 780 | sum = 0; |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 781 | max.reset(); |
palmkvist | 349092b | 2016-12-13 02:45:57 -0800 | [diff] [blame] | 782 | } |
| 783 | |
philipel | a45102f | 2017-02-22 05:30:39 -0800 | [diff] [blame] | 784 | void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, |
| 785 | int64_t max_rtt_ms) { |
| 786 | rtc::CritScope lock(&crit_); |
| 787 | avg_rtt_ms_ = avg_rtt_ms; |
| 788 | } |
| 789 | |
ilnik | 6d5b4d6 | 2017-08-30 03:32:14 -0700 | [diff] [blame] | 790 | void ReceiveStatisticsProxy::ContentSpecificStats::Add( |
| 791 | const ContentSpecificStats& other) { |
| 792 | e2e_delay_counter.Add(other.e2e_delay_counter); |
| 793 | interframe_delay_counter.Add(other.interframe_delay_counter); |
| 794 | flow_duration_ms += other.flow_duration_ms; |
| 795 | total_media_bytes += other.total_media_bytes; |
| 796 | received_height.Add(other.received_height); |
| 797 | received_width.Add(other.received_width); |
| 798 | qp_counter.Add(other.qp_counter); |
| 799 | frame_counts.key_frames += other.frame_counts.key_frames; |
| 800 | frame_counts.delta_frames += other.frame_counts.delta_frames; |
| 801 | } |
| 802 | |
sprang@webrtc.org | 0931570 | 2014-02-07 12:06:29 +0000 | [diff] [blame] | 803 | } // namespace webrtc |