| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 15 #include "content/browser/renderer_host/media/video_capture_controller.h" | 15 #include "content/browser/renderer_host/media/video_capture_controller.h" |
| 16 #include "content/browser/renderer_host/media/video_capture_controller_event_han
dler.h" | 16 #include "content/browser/renderer_host/media/video_capture_controller_event_han
dler.h" |
| 17 #include "content/browser/renderer_host/media/web_contents_video_capture_device.
h" | 17 #include "content/browser/renderer_host/media/web_contents_video_capture_device.
h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
| 20 #include "content/public/common/desktop_media_id.h" | 20 #include "content/public/common/desktop_media_id.h" |
| 21 #include "content/public/common/media_stream_request.h" | 21 #include "content/public/common/media_stream_request.h" |
| 22 #include "media/base/scoped_histogram_timer.h" | 22 #include "media/base/scoped_histogram_timer.h" |
| 23 #include "media/video/capture/fake_video_capture_device.h" | 23 #include "media/video/capture/fake_video_capture_device.h" |
| 24 #include "media/video/capture/video_capture_device.h" | 24 #include "media/video/capture/video_capture_device.h" |
| 25 | 25 |
| 26 #if defined(ENABLE_SCREEN_CAPTURE) | 26 #if defined(ENABLE_SCREEN_CAPTURE) |
| 27 #include "content/browser/renderer_host/media/desktop_capture_device.h" | 27 #include "content/browser/renderer_host/media/desktop_capture_device.h" |
| 28 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 29 #include "content/browser/renderer_host/media/desktop_capture_device_ash.h" | 29 #include "content/browser/renderer_host/media/desktop_capture_device_aura.h" |
| 30 #endif | 30 #endif |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 | 34 |
| 35 VideoCaptureManager::DeviceEntry::DeviceEntry( | 35 VideoCaptureManager::DeviceEntry::DeviceEntry( |
| 36 MediaStreamType stream_type, | 36 MediaStreamType stream_type, |
| 37 const std::string& id, | 37 const std::string& id, |
| 38 scoped_ptr<VideoCaptureController> controller) | 38 scoped_ptr<VideoCaptureController> controller) |
| 39 : stream_type(stream_type), | 39 : stream_type(stream_type), |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 video_capture_device.reset( | 160 video_capture_device.reset( |
| 161 WebContentsVideoCaptureDevice::Create(entry->id)); | 161 WebContentsVideoCaptureDevice::Create(entry->id)); |
| 162 break; | 162 break; |
| 163 } | 163 } |
| 164 case MEDIA_DESKTOP_VIDEO_CAPTURE: { | 164 case MEDIA_DESKTOP_VIDEO_CAPTURE: { |
| 165 #if defined(ENABLE_SCREEN_CAPTURE) | 165 #if defined(ENABLE_SCREEN_CAPTURE) |
| 166 DesktopMediaID id = DesktopMediaID::Parse(entry->id); | 166 DesktopMediaID id = DesktopMediaID::Parse(entry->id); |
| 167 if (id.type != DesktopMediaID::TYPE_NONE) { | 167 if (id.type != DesktopMediaID::TYPE_NONE) { |
| 168 #if defined(OS_CHROMEOS) | 168 #if defined(OS_CHROMEOS) |
| 169 // TODO(hshi): enable this path for Ash windows in metro mode. | 169 // TODO(hshi): enable this path for Ash windows in metro mode. |
| 170 video_capture_device.reset(DesktopCaptureDeviceAsh::Create(id)); | 170 video_capture_device.reset(DesktopCaptureDeviceAura::Create(id)); |
| 171 #else | 171 #else |
| 172 video_capture_device = DesktopCaptureDevice::Create(id); | 172 video_capture_device = DesktopCaptureDevice::Create(id); |
| 173 #endif | 173 #endif |
| 174 } | 174 } |
| 175 #endif // defined(ENABLE_SCREEN_CAPTURE) | 175 #endif // defined(ENABLE_SCREEN_CAPTURE) |
| 176 break; | 176 break; |
| 177 } | 177 } |
| 178 default: { | 178 default: { |
| 179 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
| 180 break; | 180 break; |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 scoped_ptr<VideoCaptureController> video_capture_controller( | 415 scoped_ptr<VideoCaptureController> video_capture_controller( |
| 416 new VideoCaptureController()); | 416 new VideoCaptureController()); |
| 417 DeviceEntry* new_device = new DeviceEntry(device_info.type, | 417 DeviceEntry* new_device = new DeviceEntry(device_info.type, |
| 418 device_info.id, | 418 device_info.id, |
| 419 video_capture_controller.Pass()); | 419 video_capture_controller.Pass()); |
| 420 devices_.insert(new_device); | 420 devices_.insert(new_device); |
| 421 return new_device; | 421 return new_device; |
| 422 } | 422 } |
| 423 | 423 |
| 424 } // namespace content | 424 } // namespace content |
| OLD | NEW |