Chromium Code Reviews| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 } else { | 388 } else { |
| 389 auto it = rtx_stats_.find(ssrc); | 389 auto it = rtx_stats_.find(ssrc); |
| 390 if (it != rtx_stats_.end()) { | 390 if (it != rtx_stats_.end()) { |
| 391 it->second = counters; | 391 it->second = counters; |
| 392 } else { | 392 } else { |
| 393 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; | 393 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 void ReceiveStatisticsProxy::OnDecodedFrame() { | 398 void ReceiveStatisticsProxy::OnDecodedFrame(int qp) { |
| 399 uint64_t now = clock_->TimeInMilliseconds(); | 399 uint64_t now = clock_->TimeInMilliseconds(); |
| 400 | 400 |
| 401 rtc::CritScope lock(&crit_); | 401 rtc::CritScope lock(&crit_); |
| 402 ++stats_.frames_decoded; | 402 ++stats_.frames_decoded; |
| 403 if (qp != -1) { | |
|
sprang_webrtc
2017/01/25 15:25:41
Maybe we should dcheck on the off chance qp < -1 ?
sakal
2017/01/25 15:34:45
Sure, I can add that once we decide whether to use
sakal
2017/01/26 09:33:31
Done.
| |
| 404 if (!stats_.qp_sum) { | |
| 405 RTC_DCHECK_EQ(stats_.frames_decoded, 1); | |
| 406 stats_.qp_sum = rtc::Optional<uint64_t>(0); | |
| 407 } | |
| 408 *stats_.qp_sum += qp; | |
| 409 } else { | |
| 410 RTC_DCHECK(!stats_.qp_sum); | |
|
sprang_webrtc
2017/01/25 15:25:41
Any chance we could hit this if we change codec on
sakal
2017/01/25 15:34:45
Yes, I think that is possible if one supports prov
sprang_webrtc
2017/01/25 15:59:14
Yeah, logging a warning and resetting the stats so
sakal
2017/01/26 09:33:31
Done.
| |
| 411 } | |
| 403 decode_fps_estimator_.Update(1, now); | 412 decode_fps_estimator_.Update(1, now); |
| 404 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); | 413 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); |
| 405 } | 414 } |
| 406 | 415 |
| 407 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { | 416 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { |
| 408 int width = frame.width(); | 417 int width = frame.width(); |
| 409 int height = frame.height(); | 418 int height = frame.height(); |
| 410 RTC_DCHECK_GT(width, 0); | 419 RTC_DCHECK_GT(width, 0); |
| 411 RTC_DCHECK_GT(height, 0); | 420 RTC_DCHECK_GT(height, 0); |
| 412 uint64_t now = clock_->TimeInMilliseconds(); | 421 uint64_t now = clock_->TimeInMilliseconds(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 483 return -1; | 492 return -1; |
| 484 return static_cast<int>(sum / num_samples); | 493 return static_cast<int>(sum / num_samples); |
| 485 } | 494 } |
| 486 | 495 |
| 487 void ReceiveStatisticsProxy::SampleCounter::Reset() { | 496 void ReceiveStatisticsProxy::SampleCounter::Reset() { |
| 488 num_samples = 0; | 497 num_samples = 0; |
| 489 sum = 0; | 498 sum = 0; |
| 490 } | 499 } |
| 491 | 500 |
| 492 } // namespace webrtc | 501 } // namespace webrtc |
| OLD | NEW |