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 // AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one | 5 // AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one |
Robert Sesek
2016/07/08 19:31:04
Chrome now supports only 10.9+ so I think all this
mcasas
2016/07/08 21:39:28
Hmmm there is already one, and I thought perkj@
wa
Robert Sesek
2016/07/11 15:20:43
It seems counter-productive to add code that just
mcasas
2016/07/11 23:29:59
Acknowledged.
| |
6 // build of Chromium, so the (potential) linking with AVFoundation has to happen | 6 // build of Chromium, so the (potential) linking with AVFoundation has to happen |
7 // in runtime. For this to be clean, an AVFoundationGlue class is defined to try | 7 // in runtime. For this to be clean, an AVFoundationGlue class is defined to try |
8 // and load these AVFoundation system libraries. If it succeeds, subsequent | 8 // and load these AVFoundation system libraries. If it succeeds, subsequent |
9 // clients can use AVFoundation via the rest of the classes declared in this | 9 // clients can use AVFoundation via the rest of the classes declared in this |
10 // file. | 10 // file. |
11 | 11 |
12 #ifndef MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ | 12 #ifndef MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ |
13 #define MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ | 13 #define MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ |
14 | 14 |
15 #if defined(__OBJC__) | 15 #if defined(__OBJC__) |
(...skipping 28 matching lines...) Expand all Loading... | |
44 static NSString* AVCaptureSessionRuntimeErrorNotification(); | 44 static NSString* AVCaptureSessionRuntimeErrorNotification(); |
45 static NSString* AVCaptureSessionDidStopRunningNotification(); | 45 static NSString* AVCaptureSessionDidStopRunningNotification(); |
46 static NSString* AVCaptureSessionErrorKey(); | 46 static NSString* AVCaptureSessionErrorKey(); |
47 | 47 |
48 // Originally from AVVideoSettings.h but in global namespace. | 48 // Originally from AVVideoSettings.h but in global namespace. |
49 static NSString* AVVideoScalingModeKey(); | 49 static NSString* AVVideoScalingModeKey(); |
50 static NSString* AVVideoScalingModeResizeAspectFill(); | 50 static NSString* AVVideoScalingModeResizeAspectFill(); |
51 | 51 |
52 static Class AVCaptureSessionClass(); | 52 static Class AVCaptureSessionClass(); |
53 static Class AVCaptureVideoDataOutputClass(); | 53 static Class AVCaptureVideoDataOutputClass(); |
54 static Class AVCaptureStillImageOutputClass(); | |
54 #endif // defined(__OBJC__) | 55 #endif // defined(__OBJC__) |
55 | 56 |
56 private: | 57 private: |
57 DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue); |
58 }; | 59 }; |
59 | 60 |
60 #if defined(__OBJC__) | 61 #if defined(__OBJC__) |
61 | 62 |
62 // Originally AVCaptureDevice and coming from AVCaptureDevice.h | 63 // Originally AVCaptureDevice and coming from AVCaptureDevice.h |
63 MEDIA_EXPORT | 64 MEDIA_EXPORT |
(...skipping 24 matching lines...) Expand all Loading... | |
88 - (Float64)maxFrameRate; | 89 - (Float64)maxFrameRate; |
89 | 90 |
90 @end | 91 @end |
91 | 92 |
92 MEDIA_EXPORT | 93 MEDIA_EXPORT |
93 @interface CrAVCaptureInput : NSObject // Originally from AVCaptureInput.h. | 94 @interface CrAVCaptureInput : NSObject // Originally from AVCaptureInput.h. |
94 @end | 95 @end |
95 | 96 |
96 MEDIA_EXPORT | 97 MEDIA_EXPORT |
97 @interface CrAVCaptureOutput : NSObject // Originally from AVCaptureOutput.h. | 98 @interface CrAVCaptureOutput : NSObject // Originally from AVCaptureOutput.h. |
99 | |
100 - (NSArray*)connections; | |
101 | |
98 @end | 102 @end |
99 | 103 |
100 // Originally AVCaptureSession and coming from AVCaptureSession.h. | 104 // Originally AVCaptureSession and coming from AVCaptureSession.h. |
101 MEDIA_EXPORT | 105 MEDIA_EXPORT |
102 @interface CrAVCaptureSession : NSObject | 106 @interface CrAVCaptureSession : NSObject |
103 | 107 |
104 - (void)release; | 108 - (void)release; |
105 - (void)addInput:(CrAVCaptureInput*)input; | 109 - (void)addInput:(CrAVCaptureInput*)input; |
106 - (void)removeInput:(CrAVCaptureInput*)input; | 110 - (void)removeInput:(CrAVCaptureInput*)input; |
111 - (NSArray*)outputs; | |
107 - (void)addOutput:(CrAVCaptureOutput*)output; | 112 - (void)addOutput:(CrAVCaptureOutput*)output; |
108 - (void)removeOutput:(CrAVCaptureOutput*)output; | 113 - (void)removeOutput:(CrAVCaptureOutput*)output; |
109 - (BOOL)isRunning; | 114 - (BOOL)isRunning; |
110 - (void)startRunning; | 115 - (void)startRunning; |
111 - (void)stopRunning; | 116 - (void)stopRunning; |
112 | 117 |
113 @end | 118 @end |
114 | 119 |
115 // Originally AVCaptureConnection and coming from AVCaptureSession.h. | 120 // Originally AVCaptureConnection and coming from AVCaptureSession.h. |
116 MEDIA_EXPORT | 121 MEDIA_EXPORT |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 - (void)setSampleBufferDelegate:(id)sampleBufferDelegate | 154 - (void)setSampleBufferDelegate:(id)sampleBufferDelegate |
150 queue:(dispatch_queue_t)sampleBufferCallbackQueue; | 155 queue:(dispatch_queue_t)sampleBufferCallbackQueue; |
151 | 156 |
152 - (void)setAlwaysDiscardsLateVideoFrames:(BOOL)flag; | 157 - (void)setAlwaysDiscardsLateVideoFrames:(BOOL)flag; |
153 - (void)setVideoSettings:(NSDictionary*)videoSettings; | 158 - (void)setVideoSettings:(NSDictionary*)videoSettings; |
154 - (NSDictionary*)videoSettings; | 159 - (NSDictionary*)videoSettings; |
155 - (CrAVCaptureConnection*)connectionWithMediaType:(NSString*)mediaType; | 160 - (CrAVCaptureConnection*)connectionWithMediaType:(NSString*)mediaType; |
156 | 161 |
157 @end | 162 @end |
158 | 163 |
164 // Originally AVCaptureStillImageOutput and coming from AVCaptureOutput.h. | |
165 MEDIA_EXPORT | |
166 @interface CrAVCaptureStillImageOutput : CrAVCaptureOutput | |
167 | |
168 typedef void (^CompletionHandler)(CoreMediaGlue::CMSampleBufferRef, NSError*); | |
169 - (void) | |
170 captureStillImageAsynchronouslyFromConnection:(CrAVCaptureConnection*)connection | |
171 completionHandler:(CompletionHandler)handler; | |
172 | |
173 @end | |
174 | |
159 // Class to provide access to class methods of AVCaptureDevice. | 175 // Class to provide access to class methods of AVCaptureDevice. |
160 MEDIA_EXPORT | 176 MEDIA_EXPORT |
161 @interface AVCaptureDeviceGlue : NSObject | 177 @interface AVCaptureDeviceGlue : NSObject |
162 | 178 |
163 + (NSArray*)devices; | 179 + (NSArray*)devices; |
164 | 180 |
165 + (CrAVCaptureDevice*)deviceWithUniqueID:(NSString*)deviceUniqueID; | 181 + (CrAVCaptureDevice*)deviceWithUniqueID:(NSString*)deviceUniqueID; |
166 | 182 |
167 @end | 183 @end |
168 | 184 |
169 // Class to provide access to class methods of AVCaptureDeviceInput. | 185 // Class to provide access to class methods of AVCaptureDeviceInput. |
170 MEDIA_EXPORT | 186 MEDIA_EXPORT |
171 @interface AVCaptureDeviceInputGlue : NSObject | 187 @interface AVCaptureDeviceInputGlue : NSObject |
172 | 188 |
173 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device | 189 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device |
174 error:(NSError**)outError; | 190 error:(NSError**)outError; |
175 | 191 |
176 @end | 192 @end |
177 | 193 |
178 #endif // defined(__OBJC__) | 194 #endif // defined(__OBJC__) |
179 | 195 |
180 #endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ | 196 #endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ |
OLD | NEW |