objc2_av_foundation/generated/AVCaptureStillImageOutput.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-media")]
7use objc2_core_media::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 /// AVCaptureStillImageOutput is a concrete subclass of AVCaptureOutput that can be used to capture high-quality still images with accompanying metadata.
14 ///
15 ///
16 /// Instances of AVCaptureStillImageOutput can be used to capture, on demand, high quality snapshots from a realtime capture source. Clients can request a still image for the current time using the captureStillImageAsynchronouslyFromConnection:completionHandler: method. Clients can also configure still image outputs to produce still images in specific image formats.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturestillimageoutput?language=objc)
19 #[unsafe(super(AVCaptureOutput, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "AVCaptureOutputBase")]
22 #[deprecated = "Use AVCapturePhotoOutput instead."]
23 pub struct AVCaptureStillImageOutput;
24);
25
26#[cfg(feature = "AVCaptureOutputBase")]
27unsafe impl NSObjectProtocol for AVCaptureStillImageOutput {}
28
29#[cfg(feature = "AVCaptureOutputBase")]
30impl AVCaptureStillImageOutput {
31 extern_methods!(
32 #[deprecated = "Use AVCapturePhotoOutput instead."]
33 #[unsafe(method(init))]
34 #[unsafe(method_family = init)]
35 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
36
37 #[unsafe(method(new))]
38 #[unsafe(method_family = new)]
39 pub unsafe fn new() -> Retained<Self>;
40
41 /// Specifies the options the receiver uses to encode still images before they are delivered.
42 ///
43 ///
44 /// See AVVideoSettings.h for more information on how to construct an output settings dictionary.
45 ///
46 /// On iOS, the only currently supported keys are AVVideoCodecKey and kCVPixelBufferPixelFormatTypeKey. Use -availableImageDataCVPixelFormatTypes and -availableImageDataCodecTypes to determine what codec keys and pixel formats are supported. AVVideoQualityKey is supported on iOS 6.0 and later and may only be used when AVVideoCodecKey is set to AVVideoCodecTypeJPEG.
47 #[deprecated = "Use AVCapturePhotoOutput instead."]
48 #[unsafe(method(outputSettings))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn outputSettings(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
51
52 /// Setter for [`outputSettings`][Self::outputSettings].
53 #[deprecated = "Use AVCapturePhotoOutput instead."]
54 #[unsafe(method(setOutputSettings:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn setOutputSettings(&self, output_settings: &NSDictionary<NSString, AnyObject>);
57
58 /// Indicates the supported image pixel formats that can be specified in outputSettings.
59 ///
60 ///
61 /// The value of this property is an NSArray of NSNumbers that can be used as values for the kCVPixelBufferPixelFormatTypeKey in the receiver's outputSettings property. The first format in the returned list is the most efficient output format.
62 #[deprecated = "Use AVCapturePhotoOutput instead."]
63 #[unsafe(method(availableImageDataCVPixelFormatTypes))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn availableImageDataCVPixelFormatTypes(&self) -> Retained<NSArray<NSNumber>>;
66
67 #[cfg(feature = "AVVideoSettings")]
68 /// Indicates the supported image codec formats that can be specified in outputSettings.
69 ///
70 ///
71 /// The value of this property is an NSArray of AVVideoCodecTypes that can be used as values for the AVVideoCodecKey in the receiver's outputSettings property.
72 #[deprecated = "Use AVCapturePhotoOutput instead."]
73 #[unsafe(method(availableImageDataCodecTypes))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn availableImageDataCodecTypes(&self) -> Retained<NSArray<AVVideoCodecType>>;
76
77 /// Indicates whether the receiver supports still image stabilization.
78 ///
79 ///
80 /// The receiver's automaticallyEnablesStillImageStabilizationWhenAvailable property can only be set if this property returns YES. Its value may change as the session's -sessionPreset or input device's -activeFormat changes.
81 #[unsafe(method(isStillImageStabilizationSupported))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn isStillImageStabilizationSupported(&self) -> bool;
84
85 /// Indicates whether the receiver should automatically use still image stabilization when necessary.
86 ///
87 ///
88 /// On a receiver where -isStillImageStabilizationSupported returns YES, image stabilization may be applied to reduce blur commonly found in low light photos. When stabilization is enabled, still image captures incur additional latency. The default value is YES when supported, NO otherwise. Setting this property throws an NSInvalidArgumentException if -isStillImageStabilizationSupported returns NO.
89 #[unsafe(method(automaticallyEnablesStillImageStabilizationWhenAvailable))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn automaticallyEnablesStillImageStabilizationWhenAvailable(&self) -> bool;
92
93 /// Setter for [`automaticallyEnablesStillImageStabilizationWhenAvailable`][Self::automaticallyEnablesStillImageStabilizationWhenAvailable].
94 #[unsafe(method(setAutomaticallyEnablesStillImageStabilizationWhenAvailable:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setAutomaticallyEnablesStillImageStabilizationWhenAvailable(
97 &self,
98 automatically_enables_still_image_stabilization_when_available: bool,
99 );
100
101 /// Indicates whether still image stabilization is in use for the current capture.
102 ///
103 ///
104 /// On a receiver where -isStillImageStabilizationSupported returns YES, and automaticallyEnablesStillImageStabilizationWhenAvailable is set to YES, this property may be key-value observed, or queried from inside your key-value observation callback for the
105 /// "
106 /// capturingStillImage" property, to find out if still image stabilization is being applied to the current capture.
107 #[unsafe(method(isStillImageStabilizationActive))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn isStillImageStabilizationActive(&self) -> bool;
110
111 /// Indicates whether the receiver should emit still images at the highest resolution supported by its source AVCaptureDevice's activeFormat.
112 ///
113 ///
114 /// By default, AVCaptureStillImageOutput emits images with the same dimensions as its source AVCaptureDevice's activeFormat.formatDescription. However, if you set this property to YES, the receiver emits still images at its source AVCaptureDevice's activeFormat.highResolutionStillImageDimensions. Note that if you enable video stabilization (see AVCaptureConnection's preferredVideoStabilizationMode) for any output, the high resolution still images emitted by AVCaptureStillImageOutput may be smaller by 10 or more percent.
115 #[unsafe(method(isHighResolutionStillImageOutputEnabled))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn isHighResolutionStillImageOutputEnabled(&self) -> bool;
118
119 /// Setter for [`isHighResolutionStillImageOutputEnabled`][Self::isHighResolutionStillImageOutputEnabled].
120 #[unsafe(method(setHighResolutionStillImageOutputEnabled:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setHighResolutionStillImageOutputEnabled(
123 &self,
124 high_resolution_still_image_output_enabled: bool,
125 );
126
127 /// A boolean value that becomes true when a still image is being captured.
128 ///
129 ///
130 /// The value of this property is a BOOL that becomes true when a still image is being captured, and false when no still image capture is underway. This property is key-value observable.
131 #[unsafe(method(isCapturingStillImage))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn isCapturingStillImage(&self) -> bool;
134
135 #[cfg(all(
136 feature = "AVCaptureSession",
137 feature = "block2",
138 feature = "objc2-core-media"
139 ))]
140 /// Initiates an asynchronous still image capture, returning the result to a completion handler.
141 ///
142 ///
143 /// Parameter `connection`: The AVCaptureConnection object from which to capture the still image.
144 ///
145 /// Parameter `handler`: A block that will be called when the still image capture is complete. The block will be passed a CMSampleBuffer object containing the image data or an NSError object if an image could not be captured.
146 ///
147 ///
148 /// This method will return immediately after it is invoked, later calling the provided completion handler block when image data is ready. If the request could not be completed, the error parameter will contain an NSError object describing the failure.
149 ///
150 /// Attachments to the image data sample buffer may contain metadata appropriate to the image data format. For instance, a sample buffer containing JPEG data may carry a kCGImagePropertyExifDictionary as an attachment. See
151 /// <ImageIO
152 /// /CGImageProperties.h> for a list of keys and value types.
153 ///
154 /// Clients should not assume that the completion handler will be called on a specific thread.
155 ///
156 /// Calls to captureStillImageAsynchronouslyFromConnection:completionHandler: are not synchronized with AVCaptureDevice manual control completion handlers. Setting a device manual control, waiting for its completion, then calling captureStillImageAsynchronouslyFromConnection:completionHandler: DOES NOT ensure that the still image returned reflects your manual control change. It may be from an earlier time. You can compare your manual control completion handler sync time to the returned still image's presentation time. You can retrieve the sample buffer's pts using CMSampleBufferGetPresentationTimestamp(). If the still image has an earlier timestamp, your manual control command does not apply to it.
157 #[deprecated = "Use AVCapturePhotoOutput instead."]
158 #[unsafe(method(captureStillImageAsynchronouslyFromConnection:completionHandler:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn captureStillImageAsynchronouslyFromConnection_completionHandler(
161 &self,
162 connection: &AVCaptureConnection,
163 handler: &block2::Block<dyn Fn(*mut CMSampleBuffer, *mut NSError)>,
164 );
165
166 #[cfg(feature = "objc2-core-media")]
167 /// Converts the still image data and metadata attachments in a JPEG sample buffer to an NSData representation.
168 ///
169 ///
170 /// Parameter `jpegSampleBuffer`: The sample buffer carrying JPEG image data, optionally with Exif metadata sample buffer attachments. This method throws an NSInvalidArgumentException if jpegSampleBuffer is NULL or not in the JPEG format.
171 ///
172 ///
173 /// This method returns an NSData representation of a JPEG still image sample buffer, merging the image data and Exif metadata sample buffer attachments without recompressing the image. The returned NSData is suitable for writing to disk.
174 #[deprecated = "Use AVCapturePhotoOutput instead."]
175 #[unsafe(method(jpegStillImageNSDataRepresentation:))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn jpegStillImageNSDataRepresentation(
178 jpeg_sample_buffer: &CMSampleBuffer,
179 ) -> Option<Retained<NSData>>;
180 );
181}
182
183extern_class!(
184 /// AVCaptureBracketedStillImageSettings is an abstract base class that defines an interface for settings pertaining to a bracketed capture.
185 ///
186 ///
187 /// AVCaptureBracketedStillImageSettings may not be instantiated directly.
188 ///
189 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturebracketedstillimagesettings?language=objc)
190 #[unsafe(super(NSObject))]
191 #[derive(Debug, PartialEq, Eq, Hash)]
192 pub struct AVCaptureBracketedStillImageSettings;
193);
194
195unsafe impl NSObjectProtocol for AVCaptureBracketedStillImageSettings {}
196
197impl AVCaptureBracketedStillImageSettings {
198 extern_methods!(
199 #[unsafe(method(init))]
200 #[unsafe(method_family = init)]
201 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
202
203 #[unsafe(method(new))]
204 #[unsafe(method_family = new)]
205 pub unsafe fn new() -> Retained<Self>;
206 );
207}
208
209extern_class!(
210 /// AVCaptureManualExposureBracketedStillImageSettings is a concrete subclass of AVCaptureBracketedStillImageSettings to be used when bracketing exposure duration and ISO.
211 ///
212 ///
213 /// An AVCaptureManualExposureBracketedStillImageSettings instance defines the exposure duration and ISO settings that should be applied to one image in a bracket. An array of settings objects is passed to -[AVCaptureStillImageOutput captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:]. Min and max duration and ISO values are queryable properties of the AVCaptureDevice supplying data to an AVCaptureStillImageOutput instance. If you wish to leave exposureDuration unchanged for this bracketed still image, you may pass the special value AVCaptureExposureDurationCurrent. To keep ISO unchanged, you may pass AVCaptureISOCurrent (see AVCaptureDevice.h).
214 ///
215 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturemanualexposurebracketedstillimagesettings?language=objc)
216 #[unsafe(super(AVCaptureBracketedStillImageSettings, NSObject))]
217 #[derive(Debug, PartialEq, Eq, Hash)]
218 pub struct AVCaptureManualExposureBracketedStillImageSettings;
219);
220
221unsafe impl NSObjectProtocol for AVCaptureManualExposureBracketedStillImageSettings {}
222
223impl AVCaptureManualExposureBracketedStillImageSettings {
224 extern_methods!(
225 #[cfg(feature = "objc2-core-media")]
226 /// Creates an AVCaptureManualExposureBracketedStillImageSettings using the specified exposure duration and ISO.
227 ///
228 ///
229 /// Parameter `duration`: The exposure duration in seconds. Pass AVCaptureExposureDurationCurrent to leave the duration unchanged for this bracketed image.
230 ///
231 /// Parameter `ISO`: The ISO. Pass AVCaptureISOCurrent to leave the ISO unchanged for this bracketed image.
232 ///
233 /// Returns: An initialized AVCaptureManualExposureBracketedStillImageSettings instance.
234 #[unsafe(method(manualExposureSettingsWithExposureDuration:ISO:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn manualExposureSettingsWithExposureDuration_ISO(
237 duration: CMTime,
238 iso: c_float,
239 ) -> Retained<Self>;
240
241 #[cfg(feature = "objc2-core-media")]
242 /// The exposure duration for the still image.
243 #[unsafe(method(exposureDuration))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn exposureDuration(&self) -> CMTime;
246
247 /// The ISO for the still image.
248 #[unsafe(method(ISO))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn ISO(&self) -> c_float;
251 );
252}
253
254/// Methods declared on superclass `AVCaptureBracketedStillImageSettings`.
255impl AVCaptureManualExposureBracketedStillImageSettings {
256 extern_methods!(
257 #[unsafe(method(init))]
258 #[unsafe(method_family = init)]
259 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
260
261 #[unsafe(method(new))]
262 #[unsafe(method_family = new)]
263 pub unsafe fn new() -> Retained<Self>;
264 );
265}
266
267extern_class!(
268 /// AVCaptureAutoExposureBracketedStillImageSettings is a concrete subclass of AVCaptureBracketedStillImageSettings to be used when bracketing exposure target bias.
269 ///
270 ///
271 /// An AVCaptureAutoExposureBracketedStillImageSettings instance defines the exposure target bias setting that should be applied to one image in a bracket. An array of settings objects is passed to -[AVCaptureStillImageOutput captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:]. Min and max exposure target bias are queryable properties of the AVCaptureDevice supplying data to an AVCaptureStillImageOutput instance. If you wish to leave exposureTargetBias unchanged for this bracketed still image, you may pass the special value AVCaptureExposureTargetBiasCurrent (see AVCaptureDevice.h).
272 ///
273 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcaptureautoexposurebracketedstillimagesettings?language=objc)
274 #[unsafe(super(AVCaptureBracketedStillImageSettings, NSObject))]
275 #[derive(Debug, PartialEq, Eq, Hash)]
276 pub struct AVCaptureAutoExposureBracketedStillImageSettings;
277);
278
279unsafe impl NSObjectProtocol for AVCaptureAutoExposureBracketedStillImageSettings {}
280
281impl AVCaptureAutoExposureBracketedStillImageSettings {
282 extern_methods!(
283 /// Creates an AVCaptureAutoExposureBracketedStillImageSettings using the specified exposure target bias.
284 ///
285 ///
286 /// Parameter `exposureTargetBias`: The exposure target bias. Pass AVCaptureExposureTargetBiasCurrent to leave the exposureTargetBias unchanged for this image.
287 ///
288 /// Returns: An initialized AVCaptureAutoExposureBracketedStillImageSettings instance.
289 #[unsafe(method(autoExposureSettingsWithExposureTargetBias:))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn autoExposureSettingsWithExposureTargetBias(
292 exposure_target_bias: c_float,
293 ) -> Retained<Self>;
294
295 /// The exposure bias for the auto exposure bracketed settings
296 #[unsafe(method(exposureTargetBias))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn exposureTargetBias(&self) -> c_float;
299 );
300}
301
302/// Methods declared on superclass `AVCaptureBracketedStillImageSettings`.
303impl AVCaptureAutoExposureBracketedStillImageSettings {
304 extern_methods!(
305 #[unsafe(method(init))]
306 #[unsafe(method_family = init)]
307 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
308
309 #[unsafe(method(new))]
310 #[unsafe(method_family = new)]
311 pub unsafe fn new() -> Retained<Self>;
312 );
313}
314
315/// AVCaptureStillImageOutputBracketedCapture.
316/// A category of methods for bracketed still image capture.
317///
318///
319/// A "still image bracket" is a batch of images taken as quickly as possible in succession, optionally with different settings from picture to picture.
320///
321/// In a bracketed capture, AVCaptureDevice flashMode property is ignored (flash is forced off), as is AVCaptureStillImageOutput's automaticallyEnablesStillImageStabilizationWhenAvailable property (stabilization is forced off).
322#[cfg(feature = "AVCaptureOutputBase")]
323impl AVCaptureStillImageOutput {
324 extern_methods!(
325 /// Specifies the maximum number of still images that may be taken in a single bracket.
326 ///
327 ///
328 /// AVCaptureStillImageOutput can only satisfy a limited number of image requests in a single bracket without exhausting system resources. The maximum number of still images that may be taken in a single bracket depends on the size of the images being captured, and consequently may vary with AVCaptureSession -sessionPreset and AVCaptureDevice -activeFormat. Some formats do not support bracketed capture and return a maxBracketedCaptureStillImageCount of 0. This read-only property is key-value observable. If you exceed -maxBracketedCaptureStillImageCount, then -captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler: fails and the completionHandler is called [settings count] times with a NULL sample buffer and AVErrorMaximumStillImageCaptureRequestsExceeded.
329 #[deprecated = "Use AVCapturePhotoOutput maxBracketedCapturePhotoCount instead."]
330 #[unsafe(method(maxBracketedCaptureStillImageCount))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn maxBracketedCaptureStillImageCount(&self) -> NSUInteger;
333
334 /// Indicates whether the receiver supports lens stabilization during bracketed captures.
335 ///
336 ///
337 /// The receiver's lensStabilizationDuringBracketedCaptureEnabled property can only be set if this property returns YES. Its value may change as the session's -sessionPreset or input device's -activeFormat changes. This read-only property is key-value observable.
338 #[deprecated = "Use AVCapturePhotoOutput lensStabilizationDuringBracketedCaptureSupported instead."]
339 #[unsafe(method(isLensStabilizationDuringBracketedCaptureSupported))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn isLensStabilizationDuringBracketedCaptureSupported(&self) -> bool;
342
343 /// Indicates whether the receiver should use lens stabilization during bracketed captures.
344 ///
345 ///
346 /// On a receiver where -isLensStabilizationDuringBracketedCaptureSupported returns YES, lens stabilization may be applied to the bracket to reduce blur commonly found in low light photos. When lens stabilization is enabled, bracketed still image captures incur additional latency. Lens stabilization is more effective with longer-exposure captures, and offers limited or no benefit for exposure durations shorter than 1/30 of a second. It is possible that during the bracket, the lens stabilization module may run out of correction range and therefore will not be active for every frame in the bracket. Each emitted CMSampleBuffer from the bracket will have an attachment of kCMSampleBufferAttachmentKey_StillImageLensStabilizationInfo indicating additional information about stabilization was applied to the buffer, if any. The default value of -isLensStabilizationDuringBracketedCaptureEnabled is NO. This value will be set to NO when -isLensStabilizationDuringBracketedCaptureSupported changes to NO. Setting this property throws an NSInvalidArgumentException if -isLensStabilizationDuringBracketedCaptureSupported returns NO. This property is key-value observable.
347 #[deprecated = "Use AVCapturePhotoOutput with AVCapturePhotoBracketSettings instead."]
348 #[unsafe(method(isLensStabilizationDuringBracketedCaptureEnabled))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn isLensStabilizationDuringBracketedCaptureEnabled(&self) -> bool;
351
352 /// Setter for [`isLensStabilizationDuringBracketedCaptureEnabled`][Self::isLensStabilizationDuringBracketedCaptureEnabled].
353 #[deprecated = "Use AVCapturePhotoOutput with AVCapturePhotoBracketSettings instead."]
354 #[unsafe(method(setLensStabilizationDuringBracketedCaptureEnabled:))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn setLensStabilizationDuringBracketedCaptureEnabled(
357 &self,
358 lens_stabilization_during_bracketed_capture_enabled: bool,
359 );
360
361 #[cfg(all(feature = "AVCaptureSession", feature = "block2"))]
362 /// Allows the receiver to prepare resources in advance of capturing a still image bracket.
363 ///
364 ///
365 /// Parameter `connection`: The connection through which the still image bracket should be captured.
366 ///
367 /// Parameter `settings`: An array of AVCaptureBracketedStillImageSettings objects. All must be of the same kind of AVCaptureBracketedStillImageSettings subclass, or an NSInvalidArgumentException is thrown.
368 ///
369 /// Parameter `handler`: A user provided block that will be called asynchronously once resources have successfully been allocated for the specified bracketed capture operation. If sufficient resources could not be allocated, the "prepared" parameter contains NO, and "error" parameter contains a non-nil error value. If [settings count] exceeds -maxBracketedCaptureStillImageCount, then AVErrorMaximumStillImageCaptureRequestsExceeded is returned. You should not assume that the completion handler will be called on a specific thread.
370 ///
371 ///
372 /// -maxBracketedCaptureStillImageCount tells you the maximum number of images that may be taken in a single bracket given the current AVCaptureDevice/AVCaptureSession/AVCaptureStillImageOutput configuration. But before taking a still image bracket, additional resources may need to be allocated. By calling -prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler: first, you are able to deterministically know when the receiver is ready to capture the bracket with the specified settings array.
373 #[deprecated = "Use AVCapturePhotoOutput setPreparedPhotoSettingsArray:completionHandler: instead."]
374 #[unsafe(method(prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler:))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn prepareToCaptureStillImageBracketFromConnection_withSettingsArray_completionHandler(
377 &self,
378 connection: &AVCaptureConnection,
379 settings: &NSArray<AVCaptureBracketedStillImageSettings>,
380 handler: &block2::Block<dyn Fn(Bool, *mut NSError)>,
381 );
382
383 #[cfg(all(
384 feature = "AVCaptureSession",
385 feature = "block2",
386 feature = "objc2-core-media"
387 ))]
388 /// Captures a still image bracket.
389 ///
390 ///
391 /// Parameter `connection`: The connection through which the still image bracket should be captured.
392 ///
393 /// Parameter `settings`: An array of AVCaptureBracketedStillImageSettings objects. All must be of the same kind of AVCaptureBracketedStillImageSettings subclass, or an NSInvalidArgumentException is thrown.
394 ///
395 /// Parameter `handler`: A user provided block that will be called asynchronously as each still image in the bracket is captured. If the capture request is successful, the "sampleBuffer" parameter contains a valid CMSampleBuffer, the "stillImageSettings" parameter contains the settings object corresponding to this still image, and a nil "error" parameter. If the bracketed capture fails, sample buffer is NULL and error is non-nil. If [settings count] exceeds -maxBracketedCaptureStillImageCount, then AVErrorMaximumStillImageCaptureRequestsExceeded is returned. You should not assume that the completion handler will be called on a specific thread.
396 ///
397 ///
398 /// If you have not called -prepareToCaptureStillImageBracketFromConnection:withSettingsArray:completionHandler: for this still image bracket request, the bracket may not be taken immediately, as the receiver may internally need to prepare resources.
399 #[deprecated = "Use AVCapturePhotoOutput capturePhotoWithSettings:delegate: instead."]
400 #[unsafe(method(captureStillImageBracketAsynchronouslyFromConnection:withSettingsArray:completionHandler:))]
401 #[unsafe(method_family = none)]
402 pub unsafe fn captureStillImageBracketAsynchronouslyFromConnection_withSettingsArray_completionHandler(
403 &self,
404 connection: &AVCaptureConnection,
405 settings: &NSArray<AVCaptureBracketedStillImageSettings>,
406 handler: &block2::Block<
407 dyn Fn(
408 *mut CMSampleBuffer,
409 *mut AVCaptureBracketedStillImageSettings,
410 *mut NSError,
411 ),
412 >,
413 );
414 );
415}