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

Unified Diff: media/video/capture/video_capture_device.h

Issue 17402002: Reconnect support for DirectShow video capture devices in parallel to MediaFoundation ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added check for Windows version in unittests, Capture Driver Api is DS if Windows version < 7 Created 7 years, 5 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 | « no previous file | media/video/capture/video_capture_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/video_capture_device.h
diff --git a/media/video/capture/video_capture_device.h b/media/video/capture/video_capture_device.h
index e5be4139e7056256a478a9be1169ed44229aa2dd..f571a766085e3178ff4483b2bf0f67292c5d61b0 100644
--- a/media/video/capture/video_capture_device.h
+++ b/media/video/capture/video_capture_device.h
@@ -15,6 +15,7 @@
#include <list>
#include <string>
+#include "base/logging.h"
#include "base/time/time.h"
#include "media/base/media_export.h"
#include "media/video/capture/video_capture_types.h"
@@ -36,6 +37,20 @@ class MEDIA_EXPORT VideoCaptureDevice {
Name() {}
Name(const std::string& name, const std::string& id)
: device_name_(name), unique_id_(id) {}
+
+#if defined(OS_WIN)
+ // Windows targets Capture Api type: it can only be set on construction.
+ enum CaptureApiType {
+ MEDIA_FOUNDATION,
+ DIRECT_SHOW,
+ API_TYPE_UNKNOWN
+ };
+
+ Name(const std::string& name,
+ const std::string& id,
+ const CaptureApiType api_type)
+ : device_name_(name), unique_id_(id), capture_api_class_(api_type) {}
+#endif // if defined(OS_WIN)
~Name() {}
// Friendly name of a device
@@ -55,9 +70,33 @@ class MEDIA_EXPORT VideoCaptureDevice {
return unique_id_ < other.id();
}
+#if defined(OS_WIN)
+ CaptureApiType capture_api_type() const {
+ return capture_api_class_.capture_api_type();
+ }
+#endif // if defined(OS_WIN)
+
private:
std::string device_name_;
std::string unique_id_;
+#if defined(OS_WIN)
+ // This class wraps the CaptureApiType, so it has a by default value if not
+ // inititalized, and I (mcasas) do a DCHECK on reading its value.
+ class CaptureApiClass{
+ public:
+ CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {}
+ CaptureApiClass(const CaptureApiType api_type)
+ : capture_api_type_(api_type) {}
+ CaptureApiType capture_api_type() const {
+ DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN);
+ return capture_api_type_;
+ }
+ private:
+ CaptureApiType capture_api_type_;
+ };
+
+ CaptureApiClass capture_api_class_;
+#endif // if defined(OS_WIN)
// Allow generated copy constructor and assignment.
};
« no previous file with comments | « no previous file | media/video/capture/video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698