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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 const rtc::VideoSinkWants& wants) { | 327 const rtc::VideoSinkWants& wants) { |
328 broadcaster_.AddOrUpdateSink(sink, wants); | 328 broadcaster_.AddOrUpdateSink(sink, wants); |
329 OnSinkWantsChanged(broadcaster_.wants()); | 329 OnSinkWantsChanged(broadcaster_.wants()); |
330 } | 330 } |
331 | 331 |
332 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { | 332 void VideoCapturer::OnSinkWantsChanged(const rtc::VideoSinkWants& wants) { |
333 apply_rotation_ = wants.rotation_applied; | 333 apply_rotation_ = wants.rotation_applied; |
334 if (frame_factory_) { | 334 if (frame_factory_) { |
335 frame_factory_->SetApplyRotation(apply_rotation_); | 335 frame_factory_->SetApplyRotation(apply_rotation_); |
336 } | 336 } |
| 337 |
| 338 // Do not adapt resolution for screen content as this will likely result in |
| 339 // blurry and unreadable text. |
| 340 if (wants.resolution_request.change != |
| 341 rtc::VideoSinkWants::ResolutionRequest::NONE && |
| 342 !IsScreencast() && video_adapter()) { |
| 343 video_adapter()->OnCpuResolutionRequest( |
| 344 wants.resolution_request.change == |
| 345 rtc::VideoSinkWants::ResolutionRequest::DOWN |
| 346 ? CoordinatedVideoAdapter::DOWNGRADE |
| 347 : CoordinatedVideoAdapter::UPGRADE); |
| 348 } |
337 } | 349 } |
338 | 350 |
339 void VideoCapturer::OnFrameCaptured(VideoCapturer*, | 351 void VideoCapturer::OnFrameCaptured(VideoCapturer*, |
340 const CapturedFrame* captured_frame) { | 352 const CapturedFrame* captured_frame) { |
341 if (muted_) { | 353 if (muted_) { |
342 if (black_frame_count_down_ == 0) { | 354 if (black_frame_count_down_ == 0) { |
343 thread_->Post(this, MSG_DO_PAUSE, NULL); | 355 thread_->Post(this, MSG_DO_PAUSE, NULL); |
344 } else { | 356 } else { |
345 --black_frame_count_down_; | 357 --black_frame_count_down_; |
346 } | 358 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 void VideoCapturer::GetVariableSnapshot( | 730 void VideoCapturer::GetVariableSnapshot( |
719 const rtc::RollingAccumulator<T>& data, | 731 const rtc::RollingAccumulator<T>& data, |
720 VariableInfo<T>* stats) { | 732 VariableInfo<T>* stats) { |
721 stats->max_val = data.ComputeMax(); | 733 stats->max_val = data.ComputeMax(); |
722 stats->mean = data.ComputeMean(); | 734 stats->mean = data.ComputeMean(); |
723 stats->min_val = data.ComputeMin(); | 735 stats->min_val = data.ComputeMin(); |
724 stats->variance = data.ComputeVariance(); | 736 stats->variance = data.ComputeVariance(); |
725 } | 737 } |
726 | 738 |
727 } // namespace cricket | 739 } // namespace cricket |
OLD | NEW |