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 4e060a1dcbe416ec8790edb6414748989742f011..8229716022a9bf261cfc4c7bd31481de6eb6edc4 100644 |
--- a/media/video/capture/video_capture_device.h |
+++ b/media/video/capture/video_capture_device.h |
@@ -48,12 +48,21 @@ class MEDIA_EXPORT VideoCaptureDevice { |
DIRECT_SHOW, |
API_TYPE_UNKNOWN |
}; |
- |
+#endif |
+#if defined(OS_MACOSX) |
+ // Mac targets Capture Api type: it can only be set on construction. |
+ enum CaptureApiType { |
+ AVFOUNDATION, |
+ QTKIT, |
+ API_TYPE_UNKNOWN |
+ }; |
+#endif |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
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) |
+#endif |
~Name() {} |
// Friendly name of a device |
@@ -63,7 +72,7 @@ class MEDIA_EXPORT VideoCaptureDevice { |
// friendly name connected to the computer this will be unique. |
const std::string& id() const { return unique_id_; } |
- // The unique hardware model identifier of the capture device. Returns |
+ // The unique hardware model identifier of the capture device. Returns |
// "[vid]:[pid]" when a USB device is detected, otherwise "". |
// The implementation of this method is platform-dependent. |
const std::string GetModel() const; |
@@ -81,7 +90,7 @@ class MEDIA_EXPORT VideoCaptureDevice { |
return unique_id_ < other.id(); |
} |
-#if defined(OS_WIN) |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
CaptureApiType capture_api_type() const { |
return capture_api_class_.capture_api_type(); |
} |
@@ -90,16 +99,16 @@ class MEDIA_EXPORT VideoCaptureDevice { |
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. |
+#if defined(OS_WIN) || defined(OS_MACOSX) |
+ // This class wraps the CaptureApiType to give it a by default value if not |
+ // initialized. |
class CaptureApiClass { |
public: |
- CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {} |
+ CaptureApiClass(): capture_api_type_(API_TYPE_UNKNOWN) {} |
CaptureApiClass(const CaptureApiType api_type) |
- : capture_api_type_(api_type) {} |
+ : capture_api_type_(api_type) {} |
CaptureApiType capture_api_type() const { |
- DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); |
+ DCHECK_NE(capture_api_type_, API_TYPE_UNKNOWN); |
return capture_api_type_; |
} |
private: |
@@ -107,7 +116,7 @@ class MEDIA_EXPORT VideoCaptureDevice { |
}; |
CaptureApiClass capture_api_class_; |
-#endif // if defined(OS_WIN) |
+#endif |
// Allow generated copy constructor and assignment. |
}; |