Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: content/browser/media/capture/desktop_capture_device.cc

Issue 1124263004: New resolution change policies for desktop and tab capture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from mcasas. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698