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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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::SetResolutionRestrictionStats( |
| 681 bool scaling_enabled, | 681 bool cpu_scaling_enabled, |
| 682 bool quality_scaling_enabled, | |
| 682 bool cpu_restricted, | 683 bool cpu_restricted, |
| 683 int num_quality_downscales) { | 684 int num_quality_downscales) { |
| 684 rtc::CritScope lock(&crit_); | 685 rtc::CritScope lock(&crit_); |
| 685 if (scaling_enabled) { | 686 if (cpu_scaling_enabled) { |
| 687 stats_.cpu_limited_resolution = cpu_restricted; | |
| 688 } else { | |
| 689 stats_.cpu_limited_resolution = false; | |
| 690 } | |
| 691 | |
| 692 if (quality_scaling_enabled) { | |
| 686 quality_downscales_ = num_quality_downscales; | 693 quality_downscales_ = num_quality_downscales; |
| 687 stats_.bw_limited_resolution = quality_downscales_ > 0; | 694 stats_.bw_limited_resolution = quality_downscales_ > 0; |
| 688 stats_.cpu_limited_resolution = cpu_restricted; | |
| 689 } else { | 695 } else { |
| 696 quality_downscales_ = -1; | |
| 690 stats_.bw_limited_resolution = false; | 697 stats_.bw_limited_resolution = false; |
| 691 stats_.cpu_limited_resolution = false; | |
| 692 quality_downscales_ = -1; | |
| 693 } | 698 } |
|
kthelgason
2017/03/31 07:57:38
I think the amount of parameters and conditions he
åsapersson
2017/03/31 09:53:38
Done.
| |
| 694 } | 699 } |
| 695 | 700 |
| 696 void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( | 701 void SendStatisticsProxy::OnCpuRestrictedResolutionChanged( |
| 697 bool cpu_restricted_resolution) { | 702 bool cpu_restricted_resolution) { |
| 698 rtc::CritScope lock(&crit_); | 703 rtc::CritScope lock(&crit_); |
| 699 stats_.cpu_limited_resolution = cpu_restricted_resolution; | 704 stats_.cpu_limited_resolution = cpu_restricted_resolution; |
| 700 ++stats_.number_of_cpu_adapt_changes; | 705 ++stats_.number_of_cpu_adapt_changes; |
| 701 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); | 706 TRACE_EVENT_INSTANT0("webrtc_stats", "WebRTC.Video.AdaptationChanges"); |
| 702 } | 707 } |
| 703 | 708 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 849 } | 854 } |
| 850 | 855 |
| 851 int SendStatisticsProxy::BoolSampleCounter::Fraction( | 856 int SendStatisticsProxy::BoolSampleCounter::Fraction( |
| 852 int64_t min_required_samples, | 857 int64_t min_required_samples, |
| 853 float multiplier) const { | 858 float multiplier) const { |
| 854 if (num_samples < min_required_samples || num_samples == 0) | 859 if (num_samples < min_required_samples || num_samples == 0) |
| 855 return -1; | 860 return -1; |
| 856 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); | 861 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); |
| 857 } | 862 } |
| 858 } // namespace webrtc | 863 } // namespace webrtc |
| OLD | NEW |