| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // VideoCaptureDeviceQTKit implements all QTKit related code for | 5 // VideoCaptureDeviceQTKit implements all QTKit related code for |
| 6 // communicating with a QTKit capture device. | 6 // communicating with a QTKit capture device. |
| 7 | 7 |
| 8 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ | 8 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ |
| 9 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ | 9 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ |
| 10 | 10 |
| 11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
| 12 | 12 |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #import "media/video/capture/mac/platform_video_capturing_mac.h" | 15 #import "media/video/capture/mac/platform_video_capturing_mac.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 class VideoCaptureDeviceMac; | 18 class VideoCaptureDeviceMac; |
| 19 } | 19 } |
| 20 | 20 |
| 21 @class QTCaptureDeviceInput; | 21 @class QTCaptureDeviceInput; |
| 22 @class QTCaptureSession; | 22 @class QTCaptureSession; |
| 23 | 23 |
| 24 @interface VideoCaptureDeviceQTKit : NSObject<PlatformVideoCapturingMac> { | 24 @interface VideoCaptureDeviceQTKit : NSObject<PlatformVideoCapturingMac> { |
| 25 @private | 25 @private |
| 26 // Settings. | 26 // Settings. |
| 27 int frameRate_; | 27 float frameRate_; |
| 28 | 28 |
| 29 NSLock *lock_; | 29 NSLock *lock_; |
| 30 media::VideoCaptureDeviceMac *frameReceiver_; | 30 media::VideoCaptureDeviceMac *frameReceiver_; |
| 31 | 31 |
| 32 // QTKit variables. | 32 // QTKit variables. |
| 33 QTCaptureSession *captureSession_; | 33 QTCaptureSession *captureSession_; |
| 34 QTCaptureDeviceInput *captureDeviceInput_; | 34 QTCaptureDeviceInput *captureDeviceInput_; |
| 35 | 35 |
| 36 // Buffer for adjusting frames which do not fit receiver | 36 // Buffer for adjusting frames which do not fit receiver |
| 37 // assumptions. scoped_array<> might make more sense, if the size | 37 // assumptions. scoped_array<> might make more sense, if the size |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 // Initializes the instance and registers the frame receiver. | 51 // Initializes the instance and registers the frame receiver. |
| 52 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 52 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
| 53 | 53 |
| 54 // Set the frame receiver. | 54 // Set the frame receiver. |
| 55 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 55 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
| 56 | 56 |
| 57 // Sets which capture device to use. Returns YES on sucess, NO otherwise. | 57 // Sets which capture device to use. Returns YES on sucess, NO otherwise. |
| 58 - (BOOL)setCaptureDevice:(NSString*)deviceId; | 58 - (BOOL)setCaptureDevice:(NSString*)deviceId; |
| 59 | 59 |
| 60 // Configures the capture properties. | 60 // Configures the capture properties. |
| 61 - (BOOL)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate; | 61 - (BOOL)setCaptureHeight:(int)height |
| 62 width:(int)width |
| 63 frameRate:(float)frameRate; |
| 62 | 64 |
| 63 // Start video capturing. Returns YES on sucess, NO otherwise. | 65 // Start video capturing. Returns YES on sucess, NO otherwise. |
| 64 - (BOOL)startCapture; | 66 - (BOOL)startCapture; |
| 65 | 67 |
| 66 // Stops video capturing. | 68 // Stops video capturing. |
| 67 - (void)stopCapture; | 69 - (void)stopCapture; |
| 68 | 70 |
| 69 // Handle any QTCaptureSessionRuntimeErrorNotifications. | 71 // Handle any QTCaptureSessionRuntimeErrorNotifications. |
| 70 - (void)handleNotification:(NSNotification*)errorNotification; | 72 - (void)handleNotification:(NSNotification*)errorNotification; |
| 71 | 73 |
| 72 @end | 74 @end |
| 73 | 75 |
| 74 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ | 76 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ |
| OLD | NEW |