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 (!IsScreencast() && video_adapter()) { |
| 341 video_adapter()->OnLimitResolution(wants.max_number_of_pixels); |
| 342 } |
337 } | 343 } |
338 | 344 |
339 void VideoCapturer::OnFrameCaptured(VideoCapturer*, | 345 void VideoCapturer::OnFrameCaptured(VideoCapturer*, |
340 const CapturedFrame* captured_frame) { | 346 const CapturedFrame* captured_frame) { |
341 if (muted_) { | 347 if (muted_) { |
342 if (black_frame_count_down_ == 0) { | 348 if (black_frame_count_down_ == 0) { |
343 thread_->Post(this, MSG_DO_PAUSE, NULL); | 349 thread_->Post(this, MSG_DO_PAUSE, NULL); |
344 } else { | 350 } else { |
345 --black_frame_count_down_; | 351 --black_frame_count_down_; |
346 } | 352 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 void VideoCapturer::GetVariableSnapshot( | 724 void VideoCapturer::GetVariableSnapshot( |
719 const rtc::RollingAccumulator<T>& data, | 725 const rtc::RollingAccumulator<T>& data, |
720 VariableInfo<T>* stats) { | 726 VariableInfo<T>* stats) { |
721 stats->max_val = data.ComputeMax(); | 727 stats->max_val = data.ComputeMax(); |
722 stats->mean = data.ComputeMean(); | 728 stats->mean = data.ComputeMean(); |
723 stats->min_val = data.ComputeMin(); | 729 stats->min_val = data.ComputeMin(); |
724 stats->variance = data.ComputeVariance(); | 730 stats->variance = data.ComputeVariance(); |
725 } | 731 } |
726 | 732 |
727 } // namespace cricket | 733 } // namespace cricket |
OLD | NEW |