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

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

Issue 541163002: Clarify resolution change behaviors of video capture devices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 6 years, 3 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 | Annotate | Revision Log
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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 void DesktopCaptureDevice::Core::RefreshCaptureFormat( 308 void DesktopCaptureDevice::Core::RefreshCaptureFormat(
309 const webrtc::DesktopSize& frame_size) { 309 const webrtc::DesktopSize& frame_size) {
310 if (previous_frame_size_.equals(frame_size)) 310 if (previous_frame_size_.equals(frame_size))
311 return; 311 return;
312 312
313 // Clear the output frame, if any, since it will either need resizing, or 313 // Clear the output frame, if any, since it will either need resizing, or
314 // clearing of stale data in letterbox areas, anyway. 314 // clearing of stale data in letterbox areas, anyway.
315 output_frame_.reset(); 315 output_frame_.reset();
316 316
317 if (previous_frame_size_.is_empty() || 317 if (previous_frame_size_.is_empty() ||
318 requested_params_.allow_resolution_change) { 318 requested_params_.resolution_change_policy ==
319 media::RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT) {
319 // If this is the first frame, or the receiver supports variable resolution 320 // If this is the first frame, or the receiver supports variable resolution
320 // then determine the output size by treating the requested width & height 321 // then determine the output size by treating the requested width & height
321 // as maxima. 322 // as maxima.
322 if (frame_size.width() > 323 if (frame_size.width() >
323 requested_params_.requested_format.frame_size.width() || 324 requested_params_.requested_format.frame_size.width() ||
324 frame_size.height() > 325 frame_size.height() >
325 requested_params_.requested_format.frame_size.height()) { 326 requested_params_.requested_format.frame_size.height()) {
326 output_rect_ = ComputeLetterboxRect( 327 output_rect_ = ComputeLetterboxRect(
327 webrtc::DesktopSize( 328 webrtc::DesktopSize(
328 requested_params_.requested_format.frame_size.width(), 329 requested_params_.requested_format.frame_size.width(),
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 #else 474 #else
474 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; 475 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT;
475 #endif 476 #endif
476 477
477 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); 478 thread_.StartWithOptions(base::Thread::Options(thread_type, 0));
478 479
479 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type)); 480 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type));
480 } 481 }
481 482
482 } // namespace content 483 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698