| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 stats_proxy_->OnCpuRestrictedResolutionChanged(true); | 710 stats_proxy_->OnCpuRestrictedResolutionChanged(true); |
| 711 break; | 711 break; |
| 712 } | 712 } |
| 713 max_pixel_count_ = rtc::Optional<int>(current_pixel_count); | 713 max_pixel_count_ = rtc::Optional<int>(current_pixel_count); |
| 714 max_pixel_count_step_up_ = rtc::Optional<int>(); | 714 max_pixel_count_step_up_ = rtc::Optional<int>(); |
| 715 ++scale_counter_[reason]; | 715 ++scale_counter_[reason]; |
| 716 source_proxy_->RequestResolutionLowerThan(current_pixel_count); | 716 source_proxy_->RequestResolutionLowerThan(current_pixel_count); |
| 717 LOG(LS_INFO) << "Scaling down resolution."; | 717 LOG(LS_INFO) << "Scaling down resolution."; |
| 718 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 718 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
| 719 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 719 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
| 720 << " times for reason: " << (i ? "quality" : "cpu"); | 720 << " times for reason: " << (i ? "cpu" : "quality"); |
| 721 } | 721 } |
| 722 } | 722 } |
| 723 | 723 |
| 724 void ViEEncoder::ScaleUp(ScaleReason reason) { | 724 void ViEEncoder::ScaleUp(ScaleReason reason) { |
| 725 RTC_DCHECK_RUN_ON(&encoder_queue_); | 725 RTC_DCHECK_RUN_ON(&encoder_queue_); |
| 726 if (scale_counter_[reason] == 0 || !scaling_enabled_) | 726 if (scale_counter_[reason] == 0 || !scaling_enabled_) |
| 727 return; | 727 return; |
| 728 // Only scale if resolution is higher than last time | 728 // Only scale if resolution is higher than last time |
| 729 // we requested higher resolution. | 729 // we requested higher resolution. |
| 730 int current_pixel_count = last_frame_height_ * last_frame_width_; | 730 int current_pixel_count = last_frame_height_ * last_frame_width_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 746 --scale_counter_[reason]; | 746 --scale_counter_[reason]; |
| 747 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 747 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
| 748 LOG(LS_INFO) << "Scaling up resolution."; | 748 LOG(LS_INFO) << "Scaling up resolution."; |
| 749 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 749 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
| 750 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 750 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
| 751 << " times for reason: " << (i ? "quality" : "cpu"); | 751 << " times for reason: " << (i ? "quality" : "cpu"); |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 } // namespace webrtc | 755 } // namespace webrtc |
| OLD | NEW |