Index: media/video/capture/mac/video_capture_device_mac.h |
diff --git a/media/video/capture/mac/video_capture_device_mac.h b/media/video/capture/mac/video_capture_device_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a76ffe17334d8ffeeab560f94827007d9d546435 |
--- /dev/null |
+++ b/media/video/capture/mac/video_capture_device_mac.h |
@@ -0,0 +1,66 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// OS X implementaion of VideoCaptureDevice, using QTKit as native capture API. |
dmac
2011/10/07 17:38:55
s/implemmentaion/implementation/
mflodman_chromium_OOO
2011/10/10 12:56:52
Done.
|
+ |
+#ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
+#define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
+ |
+#include "media/video/capture/video_capture_device.h" |
+ |
+#include <string> |
scherkus (not reviewing)
2011/10/07 17:17:55
include order here shouuld be:
#include <stl head
mflodman_chromium_OOO
2011/10/10 12:56:52
Done.
|
+ |
+#include "base/compiler_specific.h" |
+ |
+@class VideoCaptureDeviceMacQTKit; |
+ |
+namespace media { |
+ |
+// Called by VideoCaptureManager to open, close and start, stop video capture |
+// devices. |
+class VideoCaptureDeviceMac : public VideoCaptureDevice { |
+ public: |
+ explicit VideoCaptureDeviceMac(const Name& device_name); |
+ virtual ~VideoCaptureDeviceMac(); |
+ |
+ // VideoCaptureDevice implementation. |
+ virtual void Allocate(int width, |
+ int height, |
+ int frame_rate, |
+ VideoCaptureDevice::EventHandler* observer) OVERRIDE; |
+ virtual void Start() OVERRIDE; |
+ virtual void Stop() OVERRIDE; |
+ virtual void DeAllocate() OVERRIDE; |
+ virtual const Name& device_name() OVERRIDE; |
+ |
+ bool Init(); |
+ |
+ // Called to deliver captured video frames. |
+ int IncomingFrame(void* video_frame, int video_frame_length, |
scherkus (not reviewing)
2011/10/07 17:17:55
nit: this doesn't read as a verb
given you refer
mflodman_chromium_OOO
2011/10/10 12:56:52
Changed to ReceiveFrame.
|
+ const Capability& frame_info); |
+ |
+ private: |
+ void SetErrorState(const std::string& reason); |
+ |
+ // Flag indicating the internal state. |
+ enum InternalState { |
+ kNotInitialized, |
+ kIdle, |
+ kAllocated, |
+ kCapturing, |
+ kError |
+ }; |
+ |
+ VideoCaptureDevice::Name device_name_; |
+ VideoCaptureDevice::EventHandler* observer_; |
+ InternalState state_; |
+ |
+ VideoCaptureDeviceMacQTKit* capture_device_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |