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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 rtc::CritScope lock(&crit_); | 702 rtc::CritScope lock(&crit_); |
703 return stats_.encode_frame_rate; | 703 return stats_.encode_frame_rate; |
704 } | 704 } |
705 | 705 |
706 void SendStatisticsProxy::OnIncomingFrame(int width, int height) { | 706 void SendStatisticsProxy::OnIncomingFrame(int width, int height) { |
707 rtc::CritScope lock(&crit_); | 707 rtc::CritScope lock(&crit_); |
708 uma_container_->input_frame_rate_tracker_.AddSamples(1); | 708 uma_container_->input_frame_rate_tracker_.AddSamples(1); |
709 uma_container_->input_fps_counter_.Add(1); | 709 uma_container_->input_fps_counter_.Add(1); |
710 uma_container_->input_width_counter_.Add(width); | 710 uma_container_->input_width_counter_.Add(width); |
711 uma_container_->input_height_counter_.Add(height); | 711 uma_container_->input_height_counter_.Add(height); |
712 uma_container_->cpu_limited_frame_counter_.Add(stats_.cpu_limited_resolution); | 712 if (cpu_downscales_ >= 0) { |
| 713 uma_container_->cpu_limited_frame_counter_.Add( |
| 714 stats_.cpu_limited_resolution); |
| 715 } |
713 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.InputFrameRate", | 716 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.InputFrameRate", |
714 "frame_rate", round( | 717 "frame_rate", round( |
715 uma_container_->input_frame_rate_tracker_.ComputeRate()), | 718 uma_container_->input_frame_rate_tracker_.ComputeRate()), |
716 "ssrc", rtp_config_.ssrcs[0]); | 719 "ssrc", rtp_config_.ssrcs[0]); |
717 } | 720 } |
718 | 721 |
719 void SendStatisticsProxy::SetCpuScalingStats(int num_cpu_downscales) { | 722 void SendStatisticsProxy::SetCpuScalingStats(int num_cpu_downscales) { |
720 rtc::CritScope lock(&crit_); | 723 rtc::CritScope lock(&crit_); |
721 cpu_downscales_ = num_cpu_downscales; | 724 cpu_downscales_ = num_cpu_downscales; |
722 stats_.cpu_limited_resolution = num_cpu_downscales > 0; | 725 stats_.cpu_limited_resolution = num_cpu_downscales > 0; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 } | 928 } |
926 | 929 |
927 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 930 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
928 int64_t min_required_samples, | 931 int64_t min_required_samples, |
929 float multiplier) const { | 932 float multiplier) const { |
930 if (num_samples < min_required_samples || num_samples == 0) | 933 if (num_samples < min_required_samples || num_samples == 0) |
931 return -1; | 934 return -1; |
932 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 935 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
933 } | 936 } |
934 } // namespace webrtc | 937 } // namespace webrtc |
OLD | NEW |