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

Unified Diff: media/video/capture/mac/video_capture_device_mac.h

Issue 8177008: Adding VideoCaptureDevice for Mac. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 2 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/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..d1ccebd10fb88c459fb51e3c9eb4afbf8c5bc89e
--- /dev/null
+++ b/media/video/capture/mac/video_capture_device_mac.h
@@ -0,0 +1,62 @@
+// 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.
+
+#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>
+
+@class VideoCaptureDeviceMacQTKit;
+
+namespace media {
+
+// Called by Video
dmac 2011/10/06 23:36:22 can we give it a slightly better description?
mflodman_chromium_OOO 2011/10/07 13:03:51 I got interrupted when writing that comment and mi
+class VideoCaptureDeviceMac : public VideoCaptureDevice {
+ public:
+ explicit VideoCaptureDeviceMac(const Name& device_name);
+ virtual ~VideoCaptureDeviceMac();
+
+ // VideoCaptureDevice implementation.
+ virtual void Allocate(int width,
dmac 2011/10/06 23:36:22 Mark the overridden virtuals with OVERRIDE
mflodman_chromium_OOO 2011/10/07 13:03:51 Done.
+ int height,
+ int frame_rate,
+ VideoCaptureDevice::EventHandler* observer);
+ virtual void Start();
+ virtual void Stop();
+ virtual void DeAllocate();
+ virtual const Name& device_name();
+
+ bool Init();
+
+ // Called to deliver captured video frames.
+ int IncomingFrame(void* video_frame, int video_frame_length,
+ const Capability& frame_info);
+
+ private:
+ void SetErrorState(const std::string& reason);
+
+ // Flag indicating the internal state.
+ enum InternalState {
+ 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_

Powered by Google App Engine
This is Rietveld 408576698