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

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

Issue 229063003: Mac AVFoundation: use QTKit for cameras not working with AVF (Blackmagic). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: //static Created 6 years, 8 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
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.
};

Powered by Google App Engine
This is Rietveld 408576698