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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 last_sent_frame_timestamp_ = encoded_image._timeStamp; | 507 last_sent_frame_timestamp_ = encoded_image._timeStamp; |
508 uma_container_->max_sent_width_per_timestamp_ = | 508 uma_container_->max_sent_width_per_timestamp_ = |
509 std::max(uma_container_->max_sent_width_per_timestamp_, | 509 std::max(uma_container_->max_sent_width_per_timestamp_, |
510 static_cast<int>(encoded_image._encodedWidth)); | 510 static_cast<int>(encoded_image._encodedWidth)); |
511 uma_container_->max_sent_height_per_timestamp_ = | 511 uma_container_->max_sent_height_per_timestamp_ = |
512 std::max(uma_container_->max_sent_height_per_timestamp_, | 512 std::max(uma_container_->max_sent_height_per_timestamp_, |
513 static_cast<int>(encoded_image._encodedHeight)); | 513 static_cast<int>(encoded_image._encodedHeight)); |
514 } | 514 } |
515 | 515 |
| 516 int SendStatisticsProxy::GetSendFrameRate() const { |
| 517 rtc::CritScope lock(&crit_); |
| 518 return stats_.encode_frame_rate; |
| 519 } |
| 520 |
516 void SendStatisticsProxy::OnIncomingFrame(int width, int height) { | 521 void SendStatisticsProxy::OnIncomingFrame(int width, int height) { |
517 rtc::CritScope lock(&crit_); | 522 rtc::CritScope lock(&crit_); |
518 uma_container_->input_frame_rate_tracker_.AddSamples(1); | 523 uma_container_->input_frame_rate_tracker_.AddSamples(1); |
519 uma_container_->input_width_counter_.Add(width); | 524 uma_container_->input_width_counter_.Add(width); |
520 uma_container_->input_height_counter_.Add(height); | 525 uma_container_->input_height_counter_.Add(height); |
521 } | 526 } |
522 | 527 |
523 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( | 528 void SendStatisticsProxy::RtcpPacketTypesCounterUpdated( |
524 uint32_t ssrc, | 529 uint32_t ssrc, |
525 const RtcpPacketTypeCounter& packet_counter) { | 530 const RtcpPacketTypeCounter& packet_counter) { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 return Fraction(min_required_samples, 1000.0f); | 627 return Fraction(min_required_samples, 1000.0f); |
623 } | 628 } |
624 | 629 |
625 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 630 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
626 int min_required_samples, float multiplier) const { | 631 int min_required_samples, float multiplier) const { |
627 if (num_samples < min_required_samples || num_samples == 0) | 632 if (num_samples < min_required_samples || num_samples == 0) |
628 return -1; | 633 return -1; |
629 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 634 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
630 } | 635 } |
631 } // namespace webrtc | 636 } // namespace webrtc |
OLD | NEW |