OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ |
6 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ | 6 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // the VideoCaptureDeviceAVFoundation object. | 55 // the VideoCaptureDeviceAVFoundation object. |
56 // | 56 // |
57 // | 57 // |
58 @interface VideoCaptureDeviceAVFoundation | 58 @interface VideoCaptureDeviceAVFoundation |
59 : NSObject<CrAVCaptureVideoDataOutputSampleBufferDelegate, | 59 : NSObject<CrAVCaptureVideoDataOutputSampleBufferDelegate, |
60 PlatformVideoCapturingMac> { | 60 PlatformVideoCapturingMac> { |
61 @private | 61 @private |
62 // The following attributes are set via -setCaptureHeight:width:frameRate:. | 62 // The following attributes are set via -setCaptureHeight:width:frameRate:. |
63 int frameWidth_; | 63 int frameWidth_; |
64 int frameHeight_; | 64 int frameHeight_; |
65 int frameRate_; | 65 float frameRate_; |
66 | 66 |
67 base::Lock lock_; // Protects concurrent setting and using of frameReceiver_. | 67 base::Lock lock_; // Protects concurrent setting and using of frameReceiver_. |
68 media::VideoCaptureDeviceMac* frameReceiver_; // weak. | 68 media::VideoCaptureDeviceMac* frameReceiver_; // weak. |
69 | 69 |
70 base::scoped_nsobject<CrAVCaptureSession> captureSession_; | 70 base::scoped_nsobject<CrAVCaptureSession> captureSession_; |
71 | 71 |
72 // |captureDevice_| is an object coming from AVFoundation, used only to be | 72 // |captureDevice_| is an object coming from AVFoundation, used only to be |
73 // plugged in |captureDeviceInput_| and to query for session preset support. | 73 // plugged in |captureDeviceInput_| and to query for session preset support. |
74 CrAVCaptureDevice* captureDevice_; | 74 CrAVCaptureDevice* captureDevice_; |
75 // |captureDeviceInput_| is owned by |captureSession_|. | 75 // |captureDeviceInput_| is owned by |captureSession_|. |
(...skipping 22 matching lines...) Expand all Loading... |
98 // the deviceId is known, the library objects are created if needed and | 98 // the deviceId is known, the library objects are created if needed and |
99 // connected for the capture, and a by default resolution is set. If deviceId is | 99 // connected for the capture, and a by default resolution is set. If deviceId is |
100 // nil, then the eventual capture is stopped and library objects are | 100 // nil, then the eventual capture is stopped and library objects are |
101 // disconnected. Returns YES on sucess, NO otherwise. This method should not be | 101 // disconnected. Returns YES on sucess, NO otherwise. This method should not be |
102 // called during capture. | 102 // called during capture. |
103 - (BOOL)setCaptureDevice:(NSString*)deviceId; | 103 - (BOOL)setCaptureDevice:(NSString*)deviceId; |
104 | 104 |
105 // Configures the capture properties for the capture session and the video data | 105 // Configures the capture properties for the capture session and the video data |
106 // output; this means it MUST be called after setCaptureDevice:. Return YES on | 106 // output; this means it MUST be called after setCaptureDevice:. Return YES on |
107 // success, else NO. | 107 // success, else NO. |
108 - (BOOL)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate; | 108 - (BOOL)setCaptureHeight:(int)height |
| 109 width:(int)width |
| 110 frameRate:(float)frameRate; |
109 | 111 |
110 // Starts video capturing and register the notification listeners. Must be | 112 // Starts video capturing and register the notification listeners. Must be |
111 // called after setCaptureDevice:, and, eventually, also after | 113 // called after setCaptureDevice:, and, eventually, also after |
112 // setCaptureHeight:width:frameRate:. Returns YES on sucess, NO otherwise. | 114 // setCaptureHeight:width:frameRate:. Returns YES on sucess, NO otherwise. |
113 - (BOOL)startCapture; | 115 - (BOOL)startCapture; |
114 | 116 |
115 // Stops video capturing and stops listening to notifications. | 117 // Stops video capturing and stops listening to notifications. |
116 - (void)stopCapture; | 118 - (void)stopCapture; |
117 | 119 |
118 @end | 120 @end |
119 | 121 |
120 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ | 122 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_ |
OLD | NEW |