Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/media/capture/desktop_capture_device.h" | 5 #include "content/browser/media/capture/desktop_capture_device.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 void DesktopCaptureDevice::Core::RefreshCaptureFormat( | 299 void DesktopCaptureDevice::Core::RefreshCaptureFormat( |
| 300 const webrtc::DesktopSize& frame_size) { | 300 const webrtc::DesktopSize& frame_size) { |
| 301 if (previous_frame_size_.equals(frame_size)) | 301 if (previous_frame_size_.equals(frame_size)) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 // Clear the output frame, if any, since it will either need resizing, or | 304 // Clear the output frame, if any, since it will either need resizing, or |
| 305 // clearing of stale data in letterbox areas, anyway. | 305 // clearing of stale data in letterbox areas, anyway. |
| 306 output_frame_.reset(); | 306 output_frame_.reset(); |
| 307 | 307 |
| 308 if (previous_frame_size_.is_empty() || | 308 if (previous_frame_size_.is_empty() || |
| 309 requested_params_.allow_resolution_change) { | 309 requested_params_.resolution_change_policy == |
| 310 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT) { | |
|
perkj_chrome
2014/09/07 14:07:09
dito
| |
| 310 // If this is the first frame, or the receiver supports variable resolution | 311 // If this is the first frame, or the receiver supports variable resolution |
| 311 // then determine the output size by treating the requested width & height | 312 // then determine the output size by treating the requested width & height |
| 312 // as maxima. | 313 // as maxima. |
| 313 if (frame_size.width() > | 314 if (frame_size.width() > |
| 314 requested_params_.requested_format.frame_size.width() || | 315 requested_params_.requested_format.frame_size.width() || |
| 315 frame_size.height() > | 316 frame_size.height() > |
| 316 requested_params_.requested_format.frame_size.height()) { | 317 requested_params_.requested_format.frame_size.height()) { |
| 317 output_rect_ = ComputeLetterboxRect( | 318 output_rect_ = ComputeLetterboxRect( |
| 318 webrtc::DesktopSize( | 319 webrtc::DesktopSize( |
| 319 requested_params_.requested_format.frame_size.width(), | 320 requested_params_.requested_format.frame_size.width(), |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 #else | 465 #else |
| 465 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 466 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
| 466 #endif | 467 #endif |
| 467 | 468 |
| 468 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 469 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
| 469 | 470 |
| 470 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type)); | 471 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type)); |
| 471 } | 472 } |
| 472 | 473 |
| 473 } // namespace content | 474 } // namespace content |
| OLD | NEW |