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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const webrtc::DesktopSize& frame_size) { | 318 const webrtc::DesktopSize& frame_size) { |
319 if (previous_frame_size_.equals(frame_size)) | 319 if (previous_frame_size_.equals(frame_size)) |
320 return; | 320 return; |
321 | 321 |
322 // Clear the output frame, if any, since it will either need resizing, or | 322 // Clear the output frame, if any, since it will either need resizing, or |
323 // clearing of stale data in letterbox areas, anyway. | 323 // clearing of stale data in letterbox areas, anyway. |
324 output_frame_.reset(); | 324 output_frame_.reset(); |
325 | 325 |
326 if (previous_frame_size_.is_empty() || | 326 if (previous_frame_size_.is_empty() || |
327 requested_params_.resolution_change_policy == | 327 requested_params_.resolution_change_policy == |
328 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT) { | 328 media::RESOLUTION_POLICY_ANY_WITHIN_LIMIT) { |
329 // If this is the first frame, or the receiver supports variable resolution | 329 // If this is the first frame, or the receiver supports variable resolution |
330 // then determine the output size by treating the requested width & height | 330 // then determine the output size by treating the requested width & height |
331 // as maxima. | 331 // as maxima. |
332 if (frame_size.width() > | 332 if (frame_size.width() > |
333 requested_params_.requested_format.frame_size.width() || | 333 requested_params_.requested_format.frame_size.width() || |
334 frame_size.height() > | 334 frame_size.height() > |
335 requested_params_.requested_format.frame_size.height()) { | 335 requested_params_.requested_format.frame_size.height()) { |
336 output_rect_ = ComputeLetterboxRect( | 336 output_rect_ = ComputeLetterboxRect( |
337 webrtc::DesktopSize( | 337 webrtc::DesktopSize( |
338 requested_params_.requested_format.frame_size.width(), | 338 requested_params_.requested_format.frame_size.width(), |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 #else | 488 #else |
489 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; | 489 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; |
490 #endif | 490 #endif |
491 | 491 |
492 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); | 492 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); |
493 | 493 |
494 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); | 494 core_.reset(new Core(thread_.task_runner(), capturer.Pass(), type)); |
495 } | 495 } |
496 | 496 |
497 } // namespace content | 497 } // namespace content |
OLD | NEW |