Chromium Code Reviews| 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 48dd3daadc0a4b1646bb59ec8d6e482117ffe873..3900ae74dea4741503384e07df8a3168a70b6b56 100644 |
| --- a/media/video/capture/win/video_capture_device_win.cc |
| +++ b/media/video/capture/win/video_capture_device_win.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/win/metro.h" |
| #include "base/win/scoped_co_mem.h" |
| #include "base/win/scoped_variant.h" |
| +#include "base/win/windows_version.h" |
| #include "media/base/media_switches.h" |
| #include "media/video/capture/win/video_capture_device_mf_win.h" |
| @@ -167,7 +168,19 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) { |
| // static |
| void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device, |
| VideoCaptureFormats* formats) { |
| - NOTIMPLEMENTED(); |
| + const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
| + // Use Media Foundation for Metro processes (after and including Win8) and |
| + // DirectShow for any other versions, unless forced via flag. Media Foundation |
| + // can also be forced if appropriate flag is set and we are in Windows 7 or |
| + // 8 in non-Metro mode. |
| + if ((base::win::IsMetroProcess() && |
| + !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) || |
| + (base::win::GetVersion() >= base::win::VERSION_WIN7 && |
| + cmd_line->HasSwitch(switches::kForceMediaFoundationVideoCapture))) { |
| + VideoCaptureDeviceMFWin::GetDeviceSupportedFormats(device, formats); |
| + } else { |
| + VideoCaptureDeviceWin::GetDeviceSupportedFormats(device, formats); |
| + } |
| } |
| // static |
| @@ -263,6 +276,12 @@ void VideoCaptureDeviceWin::GetDeviceNames(Names* device_names) { |
| } |
| } |
| +//static |
|
tommi (sloooow) - chröme
2014/01/30 13:25:17
// static
mcasas
2014/01/30 16:29:23
Done.
|
| +void VideoCaptureDeviceWin::GetDeviceSupportedFormats(const Name& device, |
| + VideoCaptureFormats* formats) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name) |
| : device_name_(device_name), |
| state_(kIdle) { |