OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/media/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "content/public/browser/desktop_media_id.h" | 23 #include "content/public/browser/desktop_media_id.h" |
24 #include "content/public/common/media_stream_request.h" | 24 #include "content/public/common/media_stream_request.h" |
25 #include "media/base/bind_to_current_loop.h" | 25 #include "media/base/bind_to_current_loop.h" |
26 #include "media/video/capture/video_capture_device.h" | 26 #include "media/video/capture/video_capture_device.h" |
27 #include "media/video/capture/video_capture_device_factory.h" | 27 #include "media/video/capture/video_capture_device_factory.h" |
28 | 28 |
29 #if defined(ENABLE_SCREEN_CAPTURE) | 29 #if defined(ENABLE_SCREEN_CAPTURE) |
30 #include "content/browser/media/capture/desktop_capture_device.h" | 30 #include "content/browser/media/capture/desktop_capture_device.h" |
31 #if defined(USE_AURA) | 31 #if defined(USE_AURA) |
32 #include "content/browser/media/capture/desktop_capture_device_aura.h" | 32 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
| 33 #if defined(OS_CHROMEOS) |
| 34 #include "content/browser/media/capture/virtual_display_capturer.h" |
| 35 #endif |
33 #endif | 36 #endif |
34 #endif | 37 #endif |
35 | 38 |
36 namespace { | 39 namespace { |
37 | 40 |
38 // Compares two VideoCaptureFormat by checking smallest frame_size area, then | 41 // Compares two VideoCaptureFormat by checking smallest frame_size area, then |
39 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that | 42 // by _largest_ frame_rate. Used to order a VideoCaptureFormats vector so that |
40 // the first entry for a given resolution has the largest frame rate, as needed | 43 // the first entry for a given resolution has the largest frame rate, as needed |
41 // by the ConsolidateCaptureFormats() method. | 44 // by the ConsolidateCaptureFormats() method. |
42 bool IsCaptureFormatSmaller(const media::VideoCaptureFormat& format1, | 45 bool IsCaptureFormatSmaller(const media::VideoCaptureFormat& format1, |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 WebContentsVideoCaptureDevice::Create(id)); | 410 WebContentsVideoCaptureDevice::Create(id)); |
408 break; | 411 break; |
409 } | 412 } |
410 case MEDIA_DESKTOP_VIDEO_CAPTURE: { | 413 case MEDIA_DESKTOP_VIDEO_CAPTURE: { |
411 #if defined(ENABLE_SCREEN_CAPTURE) | 414 #if defined(ENABLE_SCREEN_CAPTURE) |
412 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); | 415 DesktopMediaID desktop_id = DesktopMediaID::Parse(id); |
413 #if defined(USE_AURA) | 416 #if defined(USE_AURA) |
414 if (desktop_id.type == DesktopMediaID::TYPE_AURA_WINDOW) { | 417 if (desktop_id.type == DesktopMediaID::TYPE_AURA_WINDOW) { |
415 video_capture_device.reset( | 418 video_capture_device.reset( |
416 DesktopCaptureDeviceAura::Create(desktop_id)); | 419 DesktopCaptureDeviceAura::Create(desktop_id)); |
| 420 #if defined(OS_CHROMEOS) |
| 421 } else if (desktop_id.type == DesktopMediaID::TYPE_AURA_VIRTUAL_SCREEN) { |
| 422 video_capture_device.reset( |
| 423 VirtualDisplayCapturer::Create(device_task_runner_, desktop_id)); |
| 424 #endif // defined(OS_CHROMEOS) |
417 } else | 425 } else |
418 #endif | 426 #endif // defined(USE_AURA) |
419 if (desktop_id.type != DesktopMediaID::TYPE_NONE && | 427 if (desktop_id.type != DesktopMediaID::TYPE_NONE && |
420 desktop_id.type != DesktopMediaID::TYPE_AURA_WINDOW) { | 428 desktop_id.type != DesktopMediaID::TYPE_AURA_WINDOW) { |
421 video_capture_device = DesktopCaptureDevice::Create(desktop_id); | 429 video_capture_device = DesktopCaptureDevice::Create(desktop_id); |
422 } | 430 } |
423 #endif // defined(ENABLE_SCREEN_CAPTURE) | 431 #endif // defined(ENABLE_SCREEN_CAPTURE) |
424 break; | 432 break; |
425 } | 433 } |
426 default: { | 434 default: { |
427 NOTIMPLEMENTED(); | 435 NOTIMPLEMENTED(); |
428 break; | 436 break; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 DCHECK(IsOnDeviceThread()); | 866 DCHECK(IsOnDeviceThread()); |
859 #if defined(ENABLE_SCREEN_CAPTURE) | 867 #if defined(ENABLE_SCREEN_CAPTURE) |
860 DesktopCaptureDevice* desktop_device = | 868 DesktopCaptureDevice* desktop_device = |
861 static_cast<DesktopCaptureDevice*>(device); | 869 static_cast<DesktopCaptureDevice*>(device); |
862 desktop_device->SetNotificationWindowId(window_id); | 870 desktop_device->SetNotificationWindowId(window_id); |
863 VLOG(2) << "Screen capture notification window passed on device thread."; | 871 VLOG(2) << "Screen capture notification window passed on device thread."; |
864 #endif | 872 #endif |
865 } | 873 } |
866 | 874 |
867 } // namespace content | 875 } // namespace content |
OLD | NEW |