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

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

Issue 149443003: Add GetDeviceSupportedFormats to VideoCaptureDeviceMFWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scherkus@ nit Created 6 years, 11 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_win.h ('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 48dd3daadc0a4b1646bb59ec8d6e482117ffe873..479ffd4a294f39ec29b6ebf07485de29bad9bc0c 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"
@@ -154,10 +155,14 @@ void DeleteMediaType(AM_MEDIA_TYPE* mt) {
// static
void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
- // Use Media Foundation for Metro processes (after and including Win8)
- // and DirectShow for any other platforms.
- if (base::win::IsMetroProcess() &&
- !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) {
+ // 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::GetDeviceNames(device_names);
} else {
VideoCaptureDeviceWin::GetDeviceNames(device_names);
@@ -167,7 +172,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 +280,12 @@ void VideoCaptureDeviceWin::GetDeviceNames(Names* device_names) {
}
}
+// static
+void VideoCaptureDeviceWin::GetDeviceSupportedFormats(const Name& device,
+ VideoCaptureFormats* formats) {
+ NOTIMPLEMENTED();
+}
+
VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name)
: device_name_(device_name),
state_(kIdle) {
« no previous file with comments | « media/video/capture/win/video_capture_device_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698