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 "media/video/capture/screen/screen_capture_device.h" | 5 #include "media/video/capture/screen/screen_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/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 DCHECK(task_runner_->RunsTasksOnCurrentThread()); | 269 DCHECK(task_runner_->RunsTasksOnCurrentThread()); |
270 | 270 |
271 frame_rate_ = frame_rate; | 271 frame_rate_ = frame_rate; |
272 | 272 |
273 // Create and start frame capturer. | 273 // Create and start frame capturer. |
274 #if defined(OS_CHROMEOS) | 274 #if defined(OS_CHROMEOS) |
275 // ScreenCapturerX11 polls by default, due to poor driver support for DAMAGE. | 275 // ScreenCapturerX11 polls by default, due to poor driver support for DAMAGE. |
276 // ChromeOS' drivers [can be patched to] support DAMAGE properly, so use it. | 276 // ChromeOS' drivers [can be patched to] support DAMAGE properly, so use it. |
277 if (!screen_capturer_) | 277 if (!screen_capturer_) |
278 screen_capturer_ = ScreenCapturer::CreateWithXDamage(true); | 278 screen_capturer_ = ScreenCapturer::CreateWithXDamage(true); |
| 279 #elif defined(OS_WIN) |
| 280 // ScreenCapturerWin disables Aero by default. We don't want it disabled for |
| 281 // WebRTC screen capture, though. |
| 282 if (!screen_capturer_) |
| 283 screen_capturer_ = ScreenCapturer::CreateWithDisableAero(false); |
279 #else | 284 #else |
280 if (!screen_capturer_) | 285 if (!screen_capturer_) |
281 screen_capturer_ = ScreenCapturer::Create(); | 286 screen_capturer_ = ScreenCapturer::Create(); |
282 #endif | 287 #endif |
283 if (screen_capturer_) | 288 if (screen_capturer_) |
284 screen_capturer_->Start(this); | 289 screen_capturer_->Start(this); |
285 | 290 |
286 // Capture first frame, so that we can call OnFrameInfo() callback. | 291 // Capture first frame, so that we can call OnFrameInfo() callback. |
287 waiting_for_frame_size_ = true; | 292 waiting_for_frame_size_ = true; |
288 DoCapture(); | 293 DoCapture(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 383 |
379 void ScreenCaptureDevice::DeAllocate() { | 384 void ScreenCaptureDevice::DeAllocate() { |
380 core_->DeAllocate(); | 385 core_->DeAllocate(); |
381 } | 386 } |
382 | 387 |
383 const VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() { | 388 const VideoCaptureDevice::Name& ScreenCaptureDevice::device_name() { |
384 return name_; | 389 return name_; |
385 } | 390 } |
386 | 391 |
387 } // namespace media | 392 } // namespace media |
OLD | NEW |