| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 } else { | 421 } else { |
| 422 auto it = rtx_stats_.find(ssrc); | 422 auto it = rtx_stats_.find(ssrc); |
| 423 if (it != rtx_stats_.end()) { | 423 if (it != rtx_stats_.end()) { |
| 424 it->second = counters; | 424 it->second = counters; |
| 425 } else { | 425 } else { |
| 426 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; | 426 RTC_NOTREACHED() << "Unexpected stream ssrc: " << ssrc; |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 void ReceiveStatisticsProxy::OnDecodedFrame(rtc::Optional<uint8_t> qp) { | 431 void ReceiveStatisticsProxy::OnDecodedFrame() { |
| 432 uint64_t now = clock_->TimeInMilliseconds(); | 432 uint64_t now = clock_->TimeInMilliseconds(); |
| 433 | 433 |
| 434 rtc::CritScope lock(&crit_); | 434 rtc::CritScope lock(&crit_); |
| 435 ++stats_.frames_decoded; | 435 ++stats_.frames_decoded; |
| 436 if (qp) { | |
| 437 if (!stats_.qp_sum) { | |
| 438 if (stats_.frames_decoded != 1) { | |
| 439 LOG(LS_WARNING) | |
| 440 << "Frames decoded was not 1 when first qp value was received."; | |
| 441 stats_.frames_decoded = 1; | |
| 442 } | |
| 443 stats_.qp_sum = rtc::Optional<uint64_t>(0); | |
| 444 } | |
| 445 *stats_.qp_sum += *qp; | |
| 446 } else if (stats_.qp_sum) { | |
| 447 LOG(LS_WARNING) | |
| 448 << "QP sum was already set and no QP was given for a frame."; | |
| 449 stats_.qp_sum = rtc::Optional<uint64_t>(); | |
| 450 } | |
| 451 decode_fps_estimator_.Update(1, now); | 436 decode_fps_estimator_.Update(1, now); |
| 452 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); | 437 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0); |
| 453 } | 438 } |
| 454 | 439 |
| 455 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { | 440 void ReceiveStatisticsProxy::OnRenderedFrame(const VideoFrame& frame) { |
| 456 int width = frame.width(); | 441 int width = frame.width(); |
| 457 int height = frame.height(); | 442 int height = frame.height(); |
| 458 RTC_DCHECK_GT(width, 0); | 443 RTC_DCHECK_GT(width, 0); |
| 459 RTC_DCHECK_GT(height, 0); | 444 RTC_DCHECK_GT(height, 0); |
| 460 uint64_t now = clock_->TimeInMilliseconds(); | 445 uint64_t now = clock_->TimeInMilliseconds(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 sum = 0; | 536 sum = 0; |
| 552 } | 537 } |
| 553 | 538 |
| 554 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, | 539 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, |
| 555 int64_t max_rtt_ms) { | 540 int64_t max_rtt_ms) { |
| 556 rtc::CritScope lock(&crit_); | 541 rtc::CritScope lock(&crit_); |
| 557 avg_rtt_ms_ = avg_rtt_ms; | 542 avg_rtt_ms_ = avg_rtt_ms; |
| 558 } | 543 } |
| 559 | 544 |
| 560 } // namespace webrtc | 545 } // namespace webrtc |
| OLD | NEW |