| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 int delay_ms = delay_counter_.Avg(kMinRequiredSamples); | 120 int delay_ms = delay_counter_.Avg(kMinRequiredSamples); |
| 121 if (delay_ms != -1) | 121 if (delay_ms != -1) |
| 122 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.SendSideDelayInMs", delay_ms); | 122 RTC_HISTOGRAM_COUNTS_100000("WebRTC.Video.SendSideDelayInMs", delay_ms); |
| 123 | 123 |
| 124 int max_delay_ms = max_delay_counter_.Avg(kMinRequiredSamples); | 124 int max_delay_ms = max_delay_counter_.Avg(kMinRequiredSamples); |
| 125 if (max_delay_ms != -1) { | 125 if (max_delay_ms != -1) { |
| 126 RTC_HISTOGRAM_COUNTS_100000( | 126 RTC_HISTOGRAM_COUNTS_100000( |
| 127 "WebRTC.Video.SendSideDelayMaxInMs", max_delay_ms); | 127 "WebRTC.Video.SendSideDelayMaxInMs", max_delay_ms); |
| 128 } | 128 } |
| 129 for (const auto& it : qp_counters_) { |
| 130 int qp = it.second.vp8.Avg(kMinRequiredSamples); |
| 131 if (qp != -1) |
| 132 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Encoded.Vp8.Qp", qp); |
| 133 } |
| 129 } | 134 } |
| 130 | 135 |
| 131 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { | 136 void SendStatisticsProxy::OnOutgoingRate(uint32_t framerate, uint32_t bitrate) { |
| 132 rtc::CritScope lock(&crit_); | 137 rtc::CritScope lock(&crit_); |
| 133 stats_.encode_frame_rate = framerate; | 138 stats_.encode_frame_rate = framerate; |
| 134 stats_.media_bitrate_bps = bitrate; | 139 stats_.media_bitrate_bps = bitrate; |
| 135 } | 140 } |
| 136 | 141 |
| 137 void SendStatisticsProxy::CpuOveruseMetricsUpdated( | 142 void SendStatisticsProxy::CpuOveruseMetricsUpdated( |
| 138 const CpuOveruseMetrics& metrics) { | 143 const CpuOveruseMetrics& metrics) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 } | 241 } |
| 237 } | 242 } |
| 238 if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) { | 243 if (encoded_image.adapt_reason_.bw_resolutions_disabled != -1) { |
| 239 bool bw_limited = encoded_image.adapt_reason_.bw_resolutions_disabled > 0; | 244 bool bw_limited = encoded_image.adapt_reason_.bw_resolutions_disabled > 0; |
| 240 bw_limited_frame_counter_.Add(bw_limited); | 245 bw_limited_frame_counter_.Add(bw_limited); |
| 241 if (bw_limited) { | 246 if (bw_limited) { |
| 242 bw_resolutions_disabled_counter_.Add( | 247 bw_resolutions_disabled_counter_.Add( |
| 243 encoded_image.adapt_reason_.bw_resolutions_disabled); | 248 encoded_image.adapt_reason_.bw_resolutions_disabled); |
| 244 } | 249 } |
| 245 } | 250 } |
| 251 if (encoded_image.qp_ != -1 && rtp_video_header != nullptr) { |
| 252 if (rtp_video_header->codec == kRtpVideoVp8) { |
| 253 qp_counters_[ssrc].vp8.Add(encoded_image.qp_); |
| 254 qp_filters_[ssrc].qp.Apply(1.0f, encoded_image.qp_); |
| 255 stats->qp = round(qp_filters_[ssrc].qp.filtered()); |
| 256 } |
| 257 } |
| 246 | 258 |
| 247 // TODO(asapersson): This is incorrect if simulcast layers are encoded on | 259 // TODO(asapersson): This is incorrect if simulcast layers are encoded on |
| 248 // different threads and there is no guarantee that one frame of all layers | 260 // different threads and there is no guarantee that one frame of all layers |
| 249 // are encoded before the next start. | 261 // are encoded before the next start. |
| 250 if (last_sent_frame_timestamp_ > 0 && | 262 if (last_sent_frame_timestamp_ > 0 && |
| 251 encoded_image._timeStamp != last_sent_frame_timestamp_) { | 263 encoded_image._timeStamp != last_sent_frame_timestamp_) { |
| 252 sent_frame_rate_tracker_.AddSamples(1); | 264 sent_frame_rate_tracker_.AddSamples(1); |
| 253 sent_width_counter_.Add(max_sent_width_per_timestamp_); | 265 sent_width_counter_.Add(max_sent_width_per_timestamp_); |
| 254 sent_height_counter_.Add(max_sent_height_per_timestamp_); | 266 sent_height_counter_.Add(max_sent_height_per_timestamp_); |
| 255 max_sent_width_per_timestamp_ = 0; | 267 max_sent_width_per_timestamp_ = 0; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 387 } |
| 376 | 388 |
| 377 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 389 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 378 int min_required_samples, float multiplier) const { | 390 int min_required_samples, float multiplier) const { |
| 379 if (num_samples < min_required_samples || num_samples == 0) | 391 if (num_samples < min_required_samples || num_samples == 0) |
| 380 return -1; | 392 return -1; |
| 381 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 393 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 382 } | 394 } |
| 383 | 395 |
| 384 } // namespace webrtc | 396 } // namespace webrtc |
| OLD | NEW |