| 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/browser/desktop_media_id.h" |
| 19 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.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_ash.h" |
| 30 #endif | 30 #endif |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 break; | 157 break; |
| 158 } | 158 } |
| 159 case MEDIA_TAB_VIDEO_CAPTURE: { | 159 case MEDIA_TAB_VIDEO_CAPTURE: { |
| 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 defined(USE_AURA) |
| 168 #if defined(OS_CHROMEOS) | 168 if (id.type == DesktopMediaID::TYPE_AURA_WINDOW) { |
| 169 // TODO(hshi): enable this path for Ash windows in metro mode. | |
| 170 video_capture_device.reset(DesktopCaptureDeviceAsh::Create(id)); | 169 video_capture_device.reset(DesktopCaptureDeviceAsh::Create(id)); |
| 171 #else | 170 } else |
| 171 #endif |
| 172 if (id.type != DesktopMediaID::TYPE_NONE && |
| 173 id.type != DesktopMediaID::TYPE_AURA_WINDOW) { |
| 172 video_capture_device = DesktopCaptureDevice::Create(id); | 174 video_capture_device = DesktopCaptureDevice::Create(id); |
| 173 #endif | |
| 174 } | 175 } |
| 175 #endif // defined(ENABLE_SCREEN_CAPTURE) | 176 #endif // defined(ENABLE_SCREEN_CAPTURE) |
| 176 break; | 177 break; |
| 177 } | 178 } |
| 178 default: { | 179 default: { |
| 179 NOTIMPLEMENTED(); | 180 NOTIMPLEMENTED(); |
| 180 break; | 181 break; |
| 181 } | 182 } |
| 182 } | 183 } |
| 183 | 184 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 scoped_ptr<VideoCaptureController> video_capture_controller( | 416 scoped_ptr<VideoCaptureController> video_capture_controller( |
| 416 new VideoCaptureController()); | 417 new VideoCaptureController()); |
| 417 DeviceEntry* new_device = new DeviceEntry(device_info.type, | 418 DeviceEntry* new_device = new DeviceEntry(device_info.type, |
| 418 device_info.id, | 419 device_info.id, |
| 419 video_capture_controller.Pass()); | 420 video_capture_controller.Pass()); |
| 420 devices_.insert(new_device); | 421 devices_.insert(new_device); |
| 421 return new_device; | 422 return new_device; |
| 422 } | 423 } |
| 423 | 424 |
| 424 } // namespace content | 425 } // namespace content |
| OLD | NEW |