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

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

Issue 438073002: Enable the magnification desktop capturer on Windows by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/field_trial.h"
11 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
12 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
13 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
14 #include "base/threading/thread.h" 13 #include "base/threading/thread.h"
15 #include "base/timer/timer.h" 14 #include "base/timer/timer.h"
16 #include "content/browser/media/capture/desktop_capture_device_uma_types.h" 15 #include "content/browser/media/capture/desktop_capture_device_uma_types.h"
17 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/desktop_media_id.h" 17 #include "content/public/browser/desktop_media_id.h"
19 #include "media/base/video_util.h" 18 #include "media/base/video_util.h"
20 #include "third_party/libyuv/include/libyuv/scale_argb.h" 19 #include "third_party/libyuv/include/libyuv/scale_argb.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 webrtc::DesktopCaptureOptions options = 381 webrtc::DesktopCaptureOptions options =
383 webrtc::DesktopCaptureOptions::CreateDefault(); 382 webrtc::DesktopCaptureOptions::CreateDefault();
384 // Leave desktop effects enabled during WebRTC captures. 383 // Leave desktop effects enabled during WebRTC captures.
385 options.set_disable_effects(false); 384 options.set_disable_effects(false);
386 385
387 scoped_ptr<webrtc::DesktopCapturer> capturer; 386 scoped_ptr<webrtc::DesktopCapturer> capturer;
388 387
389 switch (source.type) { 388 switch (source.type) {
390 case DesktopMediaID::TYPE_SCREEN: { 389 case DesktopMediaID::TYPE_SCREEN: {
391 #if defined(OS_WIN) 390 #if defined(OS_WIN)
392 if (base::FieldTrialList::FindFullName("ScreenCaptureUseMagnification") == 391 options.set_allow_use_magnification_api(true);
393 "Enabled") {
394 options.set_allow_use_magnification_api(true);
395 }
396 #endif 392 #endif
397
398 scoped_ptr<webrtc::ScreenCapturer> screen_capturer( 393 scoped_ptr<webrtc::ScreenCapturer> screen_capturer(
399 webrtc::ScreenCapturer::Create(options)); 394 webrtc::ScreenCapturer::Create(options));
400 if (screen_capturer && screen_capturer->SelectScreen(source.id)) { 395 if (screen_capturer && screen_capturer->SelectScreen(source.id)) {
401 capturer.reset(new webrtc::DesktopAndCursorComposer( 396 capturer.reset(new webrtc::DesktopAndCursorComposer(
402 screen_capturer.release(), 397 screen_capturer.release(),
403 webrtc::MouseCursorMonitor::CreateForScreen(options, source.id))); 398 webrtc::MouseCursorMonitor::CreateForScreen(options, source.id)));
404 IncrementDesktopCaptureCounter(SCREEN_CAPTURER_CREATED); 399 IncrementDesktopCaptureCounter(SCREEN_CAPTURER_CREATED);
405 } 400 }
406 break; 401 break;
407 } 402 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 #else 464 #else
470 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT; 465 base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT;
471 #endif 466 #endif
472 467
473 thread_.StartWithOptions(base::Thread::Options(thread_type, 0)); 468 thread_.StartWithOptions(base::Thread::Options(thread_type, 0));
474 469
475 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type)); 470 core_.reset(new Core(thread_.message_loop_proxy(), capturer.Pass(), type));
476 } 471 }
477 472
478 } // namespace content 473 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698