Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / media / capture / video / mac / video_capture_device_qtkit_mac.h
bloba96dd6cf0915c526fea242d0b18e6b95914dd8c7
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // VideoCaptureDeviceQTKit implements all QTKit related code for
6 // communicating with a QTKit capture device.
8 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_
9 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_
11 #import <Foundation/Foundation.h>
13 #include <vector>
15 #import "media/capture/video/mac/platform_video_capturing_mac.h"
17 namespace media {
18 class VideoCaptureDeviceMac;
21 @class QTCaptureDeviceInput;
22 @class QTCaptureSession;
24 @interface VideoCaptureDeviceQTKit : NSObject<PlatformVideoCapturingMac> {
25 @private
26 // Settings.
27 float frameRate_;
29 NSLock* lock_;
30 media::VideoCaptureDeviceMac* frameReceiver_;
32 // QTKit variables.
33 QTCaptureSession* captureSession_;
34 QTCaptureDeviceInput* captureDeviceInput_;
36 // Buffer for adjusting frames which do not fit receiver
37 // assumptions. scoped_array<> might make more sense, if the size
38 // can be proven invariant.
39 std::vector<UInt8> adjustedFrame_;
42 // Fills up the |deviceNames| dictionary of capture devices with friendly name
43 // and unique id. No thread assumptions, but this method should run in UI
44 // thread, see http://crbug.com/139164
45 + (void)getDeviceNames:(NSMutableDictionary*)deviceNames;
47 // Returns a dictionary of capture devices with friendly name and unique id, via
48 // runing +getDeviceNames: on Main Thread.
49 + (NSDictionary*)deviceNames;
51 // Initializes the instance and registers the frame receiver.
52 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver;
54 // Set the frame receiver.
55 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver;
57 // Sets which capture device to use. Returns YES on sucess, NO otherwise.
58 - (BOOL)setCaptureDevice:(NSString*)deviceId;
60 // Configures the capture properties.
61 - (BOOL)setCaptureHeight:(int)height
62 width:(int)width
63 frameRate:(float)frameRate;
65 // Start video capturing. Returns YES on sucess, NO otherwise.
66 - (BOOL)startCapture;
68 // Stops video capturing.
69 - (void)stopCapture;
71 // Handle any QTCaptureSessionRuntimeErrorNotifications.
72 - (void)handleNotification:(NSNotification*)errorNotification;
74 @end
76 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_