| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 } else { | 240 } else { |
| 241 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; | 241 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 void ReceiveStatisticsProxy::OnDecodedFrame() { | 246 void ReceiveStatisticsProxy::OnDecodedFrame() { |
| 247 uint64_t now = clock_->TimeInMilliseconds(); | 247 uint64_t now = clock_->TimeInMilliseconds(); |
| 248 | 248 |
| 249 rtc::CritScope lock(&crit_); | 249 rtc::CritScope lock(&crit_); |
| 250 ++stats_.frames_decoded; |
| 250 decode_fps_estimator_.Update(1, now); | 251 decode_fps_estimator_.Update(1, now); |
| 251 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); | 252 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); |
| 252 } | 253 } |
| 253 | 254 |
| 254 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { | 255 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { |
| 255 int width = frame.width(); | 256 int width = frame.width(); |
| 256 int height = frame.height(); | 257 int height = frame.height(); |
| 257 RTC_DCHECK_GT(width, 0); | 258 RTC_DCHECK_GT(width, 0); |
| 258 RTC_DCHECK_GT(height, 0); | 259 RTC_DCHECK_GT(height, 0); |
| 259 uint64_t now = clock_->TimeInMilliseconds(); | 260 uint64_t now = clock_->TimeInMilliseconds(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 ++num_samples; | 313 ++num_samples; |
| 313 } | 314 } |
| 314 | 315 |
| 315 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 316 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
| 316 if (num_samples < min_required_samples || num_samples == 0) | 317 if (num_samples < min_required_samples || num_samples == 0) |
| 317 return -1; | 318 return -1; |
| 318 return sum / num_samples; | 319 return sum / num_samples; |
| 319 } | 320 } |
| 320 | 321 |
| 321 } // namespace webrtc | 322 } // namespace webrtc |
| OLD | NEW |