| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { | 407 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { |
| 408 int width = frame.width(); | 408 int width = frame.width(); |
| 409 int height = frame.height(); | 409 int height = frame.height(); |
| 410 RTC_DCHECK_GT(width, 0); | 410 RTC_DCHECK_GT(width, 0); |
| 411 RTC_DCHECK_GT(height, 0); | 411 RTC_DCHECK_GT(height, 0); |
| 412 uint64_t now = clock_->TimeInMilliseconds(); | 412 uint64_t now = clock_->TimeInMilliseconds(); |
| 413 | 413 |
| 414 rtc::CritScope lock(&crit_); | 414 rtc::CritScope lock(&crit_); |
| 415 renders_fps_estimator_.Update(1, now); | 415 renders_fps_estimator_.Update(1, now); |
| 416 stats_.render_frame_rate = renders_fps_estimator_.Rate(now).value_or(0); | 416 stats_.render_frame_rate = renders_fps_estimator_.Rate(now).value_or(0); |
| 417 ++stats_.frames_rendered; |
| 417 stats_.width = width; | 418 stats_.width = width; |
| 418 stats_.height = height; | 419 stats_.height = height; |
| 419 render_width_counter_.Add(width); | 420 render_width_counter_.Add(width); |
| 420 render_height_counter_.Add(height); | 421 render_height_counter_.Add(height); |
| 421 render_fps_tracker_.AddSamples(1); | 422 render_fps_tracker_.AddSamples(1); |
| 422 render_pixel_tracker_.AddSamples(sqrt(width * height)); | 423 render_pixel_tracker_.AddSamples(sqrt(width * height)); |
| 423 | 424 |
| 424 if (frame.ntp_time_ms() > 0) { | 425 if (frame.ntp_time_ms() > 0) { |
| 425 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); | 426 int64_t delay_ms = clock_->CurrentNtpInMilliseconds() - frame.ntp_time_ms(); |
| 426 if (delay_ms >= 0) | 427 if (delay_ms >= 0) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 return -1; | 483 return -1; |
| 483 return static_cast<int>(sum / num_samples); | 484 return static_cast<int>(sum / num_samples); |
| 484 } | 485 } |
| 485 | 486 |
| 486 void ReceiveStatisticsProxy::SampleCounter::Reset() { | 487 void ReceiveStatisticsProxy::SampleCounter::Reset() { |
| 487 num_samples = 0; | 488 num_samples = 0; |
| 488 sum = 0; | 489 sum = 0; |
| 489 } | 490 } |
| 490 | 491 |
| 491 } // namespace webrtc | 492 } // namespace webrtc |
| OLD | NEW |