| 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 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 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 |
| 38 // can be proven invariant. | 38 // can be proven invariant. |
| 39 std::vector<UInt8> adjustedFrame_; | 39 std::vector<UInt8> adjustedFrame_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 // Returns a dictionary of capture devices with friendly name and unique id. | 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; |
| 46 |
| 47 // Returns a dictionary of capture devices with friendly name and unique id, via |
| 48 // runing +getDeviceNames: on Main Thread. |
| 43 + (NSDictionary*)deviceNames; | 49 + (NSDictionary*)deviceNames; |
| 44 | 50 |
| 45 // Initializes the instance and registers the frame receiver. | 51 // Initializes the instance and registers the frame receiver. |
| 46 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 52 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
| 47 | 53 |
| 48 // Set the frame receiver. | 54 // Set the frame receiver. |
| 49 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 55 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
| 50 | 56 |
| 51 // 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. |
| 52 - (BOOL)setCaptureDevice:(NSString*)deviceId; | 58 - (BOOL)setCaptureDevice:(NSString*)deviceId; |
| 53 | 59 |
| 54 // Configures the capture properties. | 60 // Configures the capture properties. |
| 55 - (BOOL)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate; | 61 - (BOOL)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate; |
| 56 | 62 |
| 57 // Start video capturing. Returns YES on sucess, NO otherwise. | 63 // Start video capturing. Returns YES on sucess, NO otherwise. |
| 58 - (BOOL)startCapture; | 64 - (BOOL)startCapture; |
| 59 | 65 |
| 60 // Stops video capturing. | 66 // Stops video capturing. |
| 61 - (void)stopCapture; | 67 - (void)stopCapture; |
| 62 | 68 |
| 63 // Handle any QTCaptureSessionRuntimeErrorNotifications. | 69 // Handle any QTCaptureSessionRuntimeErrorNotifications. |
| 64 - (void)handleNotification:(NSNotification*)errorNotification; | 70 - (void)handleNotification:(NSNotification*)errorNotification; |
| 65 | 71 |
| 66 @end | 72 @end |
| 67 | 73 |
| 68 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ | 74 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_QTKIT_MAC_H_ |
| OLD | NEW |