Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: media/video/capture/win/video_capture_device_win.cc

Issue 262383003: Add Intel Perceptual Computing SDK based depth video capture for Windows Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/video/capture/win/video_capture_device_pxc_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
}
« no previous file with comments | « media/video/capture/win/video_capture_device_pxc_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698