Index: media/video/capture/win/video_capture_device_win.cc |
diff --git a/media/video/capture/win/video_capture_device_win.cc b/media/video/capture/win/video_capture_device_win.cc |
index 2afb96860177ea648017597a2ce05ee34c0a5316..37400009ca6492b8f81b8228ae1fe566fb440cce 100644 |
--- a/media/video/capture/win/video_capture_device_win.cc |
+++ b/media/video/capture/win/video_capture_device_win.cc |
@@ -16,6 +16,8 @@ |
#include "base/win/windows_version.h" |
#include "media/base/media_switches.h" |
#include "media/video/capture/win/video_capture_device_mf_win.h" |
+#include "media/video/capture/win/video_capture_device_pxc_win.h" |
+ |
using base::win::ScopedCoMem; |
using base::win::ScopedComPtr; |
@@ -220,6 +222,11 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) { |
VideoCaptureDeviceMFWin::GetDeviceNames(device_names); |
} else { |
VideoCaptureDeviceWin::GetDeviceNames(device_names); |
+ if (cmd_line->HasSwitch(switches::kEnableDepthCamera)) { |
+ if (VideoCaptureDevicePXCWin::PlatformSupported()) { |
+ VideoCaptureDevicePXCWin::AppendDeviceNames(device_names); |
+ } |
+ } |
} |
} |
@@ -237,12 +244,19 @@ void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device, |
cmd_line->HasSwitch(switches::kForceMediaFoundationVideoCapture))) { |
VideoCaptureDeviceMFWin::GetDeviceSupportedFormats(device, formats); |
} else { |
+ if (cmd_line->HasSwitch(switches::kEnableDepthCamera)) { |
+ if (VideoCaptureDevicePXCWin::IsDepthDevice(device)) { |
+ VideoCaptureDevicePXCWin::GetDeviceSupportedFormats(device, formats); |
+ return; |
+ } |
+ } |
VideoCaptureDeviceWin::GetDeviceSupportedFormats(device, formats); |
} |
} |
// static |
VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { |
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
VideoCaptureDevice* ret = NULL; |
if (device_name.capture_api_type() == Name::MEDIA_FOUNDATION) { |
DCHECK(VideoCaptureDeviceMFWin::PlatformSupported()); |
@@ -257,7 +271,15 @@ VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { |
DVLOG(1) << " DirectShow Device: " << device_name.name(); |
if (device->Init()) |
ret = device.release(); |
- } else{ |
+ } else if (cmd_line->HasSwitch(switches::kEnableDepthCamera) && |
+ device_name.capture_api_type() == Name::PXC_CAPTURE) { |
+ DCHECK(VideoCaptureDevicePXCWin::PlatformSupported()); |
+ scoped_ptr<VideoCaptureDevicePXCWin> device( |
+ new VideoCaptureDevicePXCWin(device_name)); |
+ DVLOG(1) << " PxcCapture Device: " << device_name.name(); |
+ if (device->Init()) |
+ ret = device.release(); |
+ } else { |
NOTREACHED() << " Couldn't recognize VideoCaptureDevice type"; |
} |