| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 RTC_HISTOGRAM_COUNTS_100000( | 52 RTC_HISTOGRAM_COUNTS_100000( |
| 53 "WebRTC.Video.RenderSqrtPixelsPerSecond", | 53 "WebRTC.Video.RenderSqrtPixelsPerSecond", |
| 54 round(render_pixel_tracker_.ComputeTotalRate())); | 54 round(render_pixel_tracker_.ComputeTotalRate())); |
| 55 } | 55 } |
| 56 int width = render_width_counter_.Avg(kMinRequiredSamples); | 56 int width = render_width_counter_.Avg(kMinRequiredSamples); |
| 57 int height = render_height_counter_.Avg(kMinRequiredSamples); | 57 int height = render_height_counter_.Avg(kMinRequiredSamples); |
| 58 if (width != -1) { | 58 if (width != -1) { |
| 59 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); | 59 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); |
| 60 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); | 60 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); |
| 61 } | 61 } |
| 62 int sync_offset_ms = sync_offset_counter_.Avg(kMinRequiredSamples); |
| 63 if (sync_offset_ms != -1) |
| 64 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.AVSyncOffsetInMs", sync_offset_ms); |
| 65 |
| 62 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); | 66 int qp = qp_counters_.vp8.Avg(kMinRequiredSamples); |
| 63 if (qp != -1) | 67 if (qp != -1) |
| 64 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); | 68 RTC_HISTOGRAM_COUNTS_200("WebRTC.Video.Decoded.Vp8.Qp", qp); |
| 65 | 69 |
| 66 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and | 70 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and |
| 67 // not per frame. Change decode time to include every frame. | 71 // not per frame. Change decode time to include every frame. |
| 68 const int kMinRequiredDecodeSamples = 5; | 72 const int kMinRequiredDecodeSamples = 5; |
| 69 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); | 73 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
| 70 if (decode_ms != -1) | 74 if (decode_ms != -1) |
| 71 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); | 75 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 render_fps_tracker_.AddSamples(1); | 236 render_fps_tracker_.AddSamples(1); |
| 233 render_pixel_tracker_.AddSamples(sqrt(width * height)); | 237 render_pixel_tracker_.AddSamples(sqrt(width * height)); |
| 234 | 238 |
| 235 if (frame.ntp_time_ms() > 0) { | 239 if (frame.ntp_time_ms() > 0) { |
| 236 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); | 240 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); |
| 237 if (delay_ms >= 0) | 241 if (delay_ms >= 0) |
| 238 delay_counter_.Add(delay_ms); | 242 delay_counter_.Add(delay_ms); |
| 239 } | 243 } |
| 240 } | 244 } |
| 241 | 245 |
| 246 void ReceiveStatisticsProxy::OnSyncOffsetUpdated(int64_t sync_offset_ms) { |
| 247 rtc::CritScope lock(&crit_); |
| 248 sync_offset_counter_.Add(std::abs(sync_offset_ms)); |
| 249 stats_.sync_offset_ms = sync_offset_ms; |
| 250 } |
| 251 |
| 242 void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, | 252 void ReceiveStatisticsProxy::OnReceiveRatesUpdated(uint32_t bitRate, |
| 243 uint32_t frameRate) { | 253 uint32_t frameRate) { |
| 244 } | 254 } |
| 245 | 255 |
| 246 void ReceiveStatisticsProxy::OnFrameCountsUpdated( | 256 void ReceiveStatisticsProxy::OnFrameCountsUpdated( |
| 247 const FrameCounts& frame_counts) { | 257 const FrameCounts& frame_counts) { |
| 248 rtc::CritScope lock(&crit_); | 258 rtc::CritScope lock(&crit_); |
| 249 stats_.frame_counts = frame_counts; | 259 stats_.frame_counts = frame_counts; |
| 250 } | 260 } |
| 251 | 261 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 270 ++num_samples; | 280 ++num_samples; |
| 271 } | 281 } |
| 272 | 282 |
| 273 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 283 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
| 274 if (num_samples < min_required_samples || num_samples == 0) | 284 if (num_samples < min_required_samples || num_samples == 0) |
| 275 return -1; | 285 return -1; |
| 276 return sum / num_samples; | 286 return sum / num_samples; |
| 277 } | 287 } |
| 278 | 288 |
| 279 } // namespace webrtc | 289 } // namespace webrtc |
| OLD | NEW |