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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 uma_container_->input_fps_counter_.Add(1); | 670 uma_container_->input_fps_counter_.Add(1); |
671 uma_container_->input_width_counter_.Add(width); | 671 uma_container_->input_width_counter_.Add(width); |
672 uma_container_->input_height_counter_.Add(height); | 672 uma_container_->input_height_counter_.Add(height); |
673 uma_container_->cpu_limited_frame_counter_.Add(stats_.cpu_limited_resolution); | 673 uma_container_->cpu_limited_frame_counter_.Add(stats_.cpu_limited_resolution); |
674 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.InputFrameRate", | 674 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.InputFrameRate", |
675 "frame_rate", round( | 675 "frame_rate", round( |
676 uma_container_->input_frame_rate_tracker_.ComputeRate()), | 676 uma_container_->input_frame_rate_tracker_.ComputeRate()), |
677 "ssrc", rtp_config_.ssrcs[0]); | 677 "ssrc", rtp_config_.ssrcs[0]); |
678 } | 678 } |
679 | 679 |
680 void SendStatisticsProxy::SetResolutionRestrictionStats( | 680 void SendStatisticsProxy::SetCpuScalingStats(bool cpu_restricted_resolution) { |
681 bool scaling_enabled, | |
682 bool cpu_restricted, | |
683 int num_quality_downscales) { | |
684 rtc::CritScope lock(&crit_); | 681 rtc::CritScope lock(&crit_); |
685 if (scaling_enabled) { | 682 stats_.cpu_limited_resolution = cpu_restricted_resolution; |
686 quality_downscales_ = num_quality_downscales; | 683 } |
687 stats_.bw_limited_resolution = quality_downscales_ > 0; | 684 |
688 stats_.cpu_limited_resolution = cpu_restricted; | 685 void SendStatisticsProxy::SetQualityScalingStats(int num_quality_downscales) { |
689 } else { | 686 rtc::CritScope lock(&crit_); |
690 stats_.bw_limited_resolution = false; | 687 quality_downscales_ = num_quality_downscales; |
691 stats_.cpu_limited_resolution = false; | 688 stats_.bw_limited_resolution = quality_downscales_ > 0; |
692 quality_downscales_ = -1; | |
693 } | |
694 } | 689 } |
695 | 690 |
696 void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( | 691 void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( |
697 bool cpu_restricted_resolution) { | 692 bool cpu_restricted_resolution) { |
698 rtc::CritScope lock(&crit_); | 693 rtc::CritScope lock(&crit_); |
699 stats_.cpu_limited_resolution = cpu_restricted_resolution; | 694 stats_.cpu_limited_resolution = cpu_restricted_resolution; |
700 ++stats_.number_of_cpu_adapt_changes; | 695 ++stats_.number_of_cpu_adapt_changes; |
701 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); | 696 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); |
702 } | 697 } |
703 | 698 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 } | 844 } |
850 | 845 |
851 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 846 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
852 int64_t min_required_samples, | 847 int64_t min_required_samples, |
853 float multiplier) const { | 848 float multiplier) const { |
854 if (num_samples < min_required_samples || num_samples == 0) | 849 if (num_samples < min_required_samples || num_samples == 0) |
855 return -1; | 850 return -1; |
856 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 851 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
857 } | 852 } |
858 } // namespace webrtc | 853 } // namespace webrtc |
OLD | NEW |