| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 scale.denominator * required_resolution_alignment_, in_width); | 211 scale.denominator * required_resolution_alignment_, in_width); |
| 212 *cropped_height = | 212 *cropped_height = |
| 213 roundUp(*cropped_height, | 213 roundUp(*cropped_height, |
| 214 scale.denominator * required_resolution_alignment_, in_height); | 214 scale.denominator * required_resolution_alignment_, in_height); |
| 215 RTC_DCHECK_EQ(0, *cropped_width % scale.denominator); | 215 RTC_DCHECK_EQ(0, *cropped_width % scale.denominator); |
| 216 RTC_DCHECK_EQ(0, *cropped_height % scale.denominator); | 216 RTC_DCHECK_EQ(0, *cropped_height % scale.denominator); |
| 217 | 217 |
| 218 // Calculate final output size. | 218 // Calculate final output size. |
| 219 *out_width = *cropped_width / scale.denominator * scale.numerator; | 219 *out_width = *cropped_width / scale.denominator * scale.numerator; |
| 220 *out_height = *cropped_height / scale.denominator * scale.numerator; | 220 *out_height = *cropped_height / scale.denominator * scale.numerator; |
| 221 RTC_DCHECK_EQ(0, *out_height % required_resolution_alignment_); | 221 RTC_DCHECK_EQ(0, *out_width % required_resolution_alignment_); |
| 222 RTC_DCHECK_EQ(0, *out_height % required_resolution_alignment_); | 222 RTC_DCHECK_EQ(0, *out_height % required_resolution_alignment_); |
| 223 | 223 |
| 224 ++frames_out_; | 224 ++frames_out_; |
| 225 if (scale.numerator != scale.denominator) | 225 if (scale.numerator != scale.denominator) |
| 226 ++frames_scaled_; | 226 ++frames_scaled_; |
| 227 | 227 |
| 228 if (previous_width_ && (previous_width_ != *out_width || | 228 if (previous_width_ && (previous_width_ != *out_width || |
| 229 previous_height_ != *out_height)) { | 229 previous_height_ != *out_height)) { |
| 230 ++adaption_changes_; | 230 ++adaption_changes_; |
| 231 LOG(LS_INFO) << "Frame size changed: scaled " << frames_scaled_ << " / out " | 231 LOG(LS_INFO) << "Frame size changed: scaled " << frames_scaled_ << " / out " |
| (...skipping 21 matching lines...) Expand all Loading... |
| 253 const rtc::Optional<int>& target_pixel_count, | 253 const rtc::Optional<int>& target_pixel_count, |
| 254 const rtc::Optional<int>& max_pixel_count) { | 254 const rtc::Optional<int>& max_pixel_count) { |
| 255 rtc::CritScope cs(&critical_section_); | 255 rtc::CritScope cs(&critical_section_); |
| 256 resolution_request_max_pixel_count_ = | 256 resolution_request_max_pixel_count_ = |
| 257 max_pixel_count.value_or(std::numeric_limits<int>::max()); | 257 max_pixel_count.value_or(std::numeric_limits<int>::max()); |
| 258 resolution_request_target_pixel_count_ = | 258 resolution_request_target_pixel_count_ = |
| 259 target_pixel_count.value_or(resolution_request_max_pixel_count_); | 259 target_pixel_count.value_or(resolution_request_max_pixel_count_); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace cricket | 262 } // namespace cricket |
| OLD | NEW |