objc2_video_toolbox/generated/VTDecompressionSession.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10#[cfg(feature = "objc2-core-media")]
11use objc2_core_media::*;
12#[cfg(feature = "objc2-core-video")]
13use objc2_core_video::*;
14
15use crate::*;
16
17/// A reference to a Video Toolbox Decompression Session.
18///
19/// A decompression session supports the decompression of a sequence of video frames.
20/// The session reference is a reference-counted CF object.
21/// To create a decompression session, call VTDecompressionSessionCreate;
22/// then you can optionally configure the session using VTSessionSetProperty;
23/// then to decode frames, call VTDecompressionSessionDecodeFrame.
24/// When you are done with the session, you should call VTDecompressionSessionInvalidate
25/// to tear it down and CFRelease to release your object reference.
26///
27/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionsession?language=objc)
28#[repr(C)]
29pub struct VTDecompressionSession {
30 inner: [u8; 0],
31 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
32}
33
34cf_type!(
35 #[encoding_name = "OpaqueVTDecompressionSession"]
36 unsafe impl VTDecompressionSession {}
37);
38
39/// Prototype for callback invoked when frame decompression is complete.
40///
41/// When you create a decompression session, you pass in a callback function to be called
42/// for decompressed frames. This function will not necessarily be called in display order.
43///
44/// Parameter `decompressionOutputRefCon`: The callback's reference value, copied from the decompressionOutputRefCon field of the
45/// VTDecompressionOutputCallbackRecord structure.
46///
47/// Parameter `sourceFrameRefCon`: The frame's reference value, copied from the sourceFrameRefCon argument to
48/// VTDecompressionSessionDecodeFrame.
49///
50/// Parameter `status`: noErr if decompression was successful; an error code if decompression was not successful.
51///
52/// Parameter `infoFlags`: Contains information about the decode operation.
53/// The kVTDecodeInfo_Asynchronous bit may be set if the decode ran asynchronously.
54/// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped.
55/// If the kVTDecodeInfo_ImageBufferModifiable bit is set, it is safe for the client to modify the imageBuffer.
56///
57/// Parameter `imageBuffer`: Contains the decompressed frame, if decompression was successful; otherwise, NULL.
58/// IMPORTANT: The video decompressor may still be referencing the imageBuffer returned in this
59/// callback if the kVTDecodeInfo_ImageBufferModifiable flag is not set. Unless this flag
60/// is set, it is not safe to modify the returned imageBuffer.
61///
62/// Parameter `presentationTimeStamp`: The frame's presentation timestamp, which will be determined by calling
63/// CMSampleBufferGetOutputPresentationTimeStamp; kCMTimeInvalid if not available.
64///
65/// Parameter `presentationDuration`: The frame's presentation duration, which will be determined by calling
66/// CMSampleBufferGetOutputDuration; kCMTimeInvalid if not available.
67///
68/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionoutputcallback?language=objc)
69#[cfg(all(
70 feature = "VTErrors",
71 feature = "objc2-core-media",
72 feature = "objc2-core-video"
73))]
74pub type VTDecompressionOutputCallback = Option<
75 unsafe extern "C-unwind" fn(
76 *mut c_void,
77 *mut c_void,
78 OSStatus,
79 VTDecodeInfoFlags,
80 *mut CVImageBuffer,
81 CMTime,
82 CMTime,
83 ),
84>;
85
86/// [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionoutputcallbackrecord?language=objc)
87#[cfg(all(
88 feature = "VTErrors",
89 feature = "objc2-core-media",
90 feature = "objc2-core-video"
91))]
92#[repr(C)]
93#[derive(Clone, Copy, Debug, PartialEq)]
94pub struct VTDecompressionOutputCallbackRecord {
95 pub decompressionOutputCallback: VTDecompressionOutputCallback,
96 pub decompressionOutputRefCon: *mut c_void,
97}
98
99#[cfg(all(
100 feature = "VTErrors",
101 feature = "objc2",
102 feature = "objc2-core-media",
103 feature = "objc2-core-video"
104))]
105unsafe impl Encode for VTDecompressionOutputCallbackRecord {
106 const ENCODING: Encoding = Encoding::Struct(
107 "VTDecompressionOutputCallbackRecord",
108 &[
109 <VTDecompressionOutputCallback>::ENCODING,
110 <*mut c_void>::ENCODING,
111 ],
112 );
113}
114
115#[cfg(all(
116 feature = "VTErrors",
117 feature = "objc2",
118 feature = "objc2-core-media",
119 feature = "objc2-core-video"
120))]
121unsafe impl RefEncode for VTDecompressionOutputCallbackRecord {
122 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
123}
124
125extern "C-unwind" {
126 /// Creates a session for decompressing video frames.
127 ///
128 /// Decompressed frames will be emitted through calls to outputCallback.
129 ///
130 /// Parameter `allocator`: An allocator for the session. Pass NULL to use the default allocator.
131 ///
132 /// Parameter `videoFormatDescription`: Describes the source video frames.
133 ///
134 /// Parameter `videoDecoderSpecification`: Specifies a particular video decoder that must be used.
135 /// Pass NULL to let the video toolbox choose a decoder.
136 ///
137 /// Parameter `destinationImageBufferAttributes`: Describes requirements for emitted pixel buffers.
138 /// Pass NULL to set no requirements.
139 ///
140 /// Parameter `outputCallback`: The callback to be called with decompressed frames.
141 /// Pass NULL if and only if you will be calling VTDecompressionSessionDecodeFrameWithOutputHandler for decoding frames.
142 ///
143 /// Parameter `decompressionSessionOut`: Points to a variable to receive the new decompression session.
144 #[cfg(all(
145 feature = "VTErrors",
146 feature = "objc2-core-media",
147 feature = "objc2-core-video"
148 ))]
149 pub fn VTDecompressionSessionCreate(
150 allocator: Option<&CFAllocator>,
151 video_format_description: &CMVideoFormatDescription,
152 video_decoder_specification: Option<&CFDictionary>,
153 destination_image_buffer_attributes: Option<&CFDictionary>,
154 output_callback: *const VTDecompressionOutputCallbackRecord,
155 decompression_session_out: NonNull<*mut VTDecompressionSession>,
156 ) -> OSStatus;
157}
158
159extern "C-unwind" {
160 /// Tears down a decompression session.
161 ///
162 /// When you are done with a decompression session you created, call VTDecompressionSessionInvalidate
163 /// to tear it down and then CFRelease to release your object reference.
164 /// When a decompression session's retain count reaches zero, it is automatically invalidated, but
165 /// since sessions may be retained by multiple parties, it can be hard to predict when this will happen.
166 /// Calling VTDecompressionSessionInvalidate ensures a deterministic, orderly teardown.
167 pub fn VTDecompressionSessionInvalidate(session: &VTDecompressionSession);
168}
169
170unsafe impl ConcreteType for VTDecompressionSession {
171 /// Returns the CFTypeID for decompression sessions.
172 #[doc(alias = "VTDecompressionSessionGetTypeID")]
173 #[inline]
174 fn type_id() -> CFTypeID {
175 extern "C-unwind" {
176 fn VTDecompressionSessionGetTypeID() -> CFTypeID;
177 }
178 unsafe { VTDecompressionSessionGetTypeID() }
179 }
180}
181
182extern "C-unwind" {
183 /// Decompresses a video frame.
184 ///
185 /// If an error is returned from this function, there will be no callback. Otherwise
186 /// the callback provided during VTDecompressionSessionCreate will be called.
187 ///
188 /// Parameter `session`: The decompression session.
189 ///
190 /// Parameter `sampleBuffer`: A CMSampleBuffer containing one or more video frames.
191 ///
192 /// Parameter `decodeFlags`: A bitfield of directives to the decompression session and decoder.
193 /// The kVTDecodeFrame_EnableAsynchronousDecompression bit indicates whether the video decoder
194 /// may decompress the frame asynchronously.
195 /// The kVTDecodeFrame_EnableTemporalProcessing bit indicates whether the decoder may delay calls to the output callback
196 /// so as to enable processing in temporal (display) order.
197 /// If both flags are clear, the decompression shall complete and your output callback function will be called
198 /// before VTDecompressionSessionDecodeFrame returns.
199 /// If either flag is set, VTDecompressionSessionDecodeFrame may return before the output callback function is called.
200 ///
201 /// Parameter `sourceFrameRefCon`: Your reference value for the frame.
202 /// Note that if sampleBuffer contains multiple frames, the output callback function will be called
203 /// multiple times with this sourceFrameRefCon.
204 ///
205 /// Parameter `infoFlagsOut`: Points to a VTDecodeInfoFlags to receive information about the decode operation.
206 /// The kVTDecodeInfo_Asynchronous bit may be set if the decode is (or was) running
207 /// asynchronously.
208 /// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped (synchronously).
209 /// Pass NULL if you do not want to receive this information.
210 #[cfg(all(feature = "VTErrors", feature = "objc2-core-media"))]
211 pub fn VTDecompressionSessionDecodeFrame(
212 session: &VTDecompressionSession,
213 sample_buffer: &CMSampleBuffer,
214 decode_flags: VTDecodeFrameFlags,
215 source_frame_ref_con: *mut c_void,
216 info_flags_out: *mut VTDecodeInfoFlags,
217 ) -> OSStatus;
218}
219
220/// Prototype for block invoked when frame decompression is complete.
221///
222/// When you decode a frame, you pass in a callback block to be called
223/// for that decompressed frame. This block will not necessarily be called in display order.
224/// If the VTDecompressionSessionDecodeFrameWithOutputHandler call returns an error, the block
225/// will not be called.
226///
227/// Parameter `status`: noErr if decompression was successful; an error code if decompression was not successful.
228///
229/// Parameter `infoFlags`: Contains information about the decode operation.
230/// The kVTDecodeInfo_Asynchronous bit may be set if the decode ran asynchronously.
231/// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped.
232/// If the kVTDecodeInfo_ImageBufferModifiable bit is set, it is safe for the client to modify the imageBuffer.
233///
234/// Parameter `imageBuffer`: Contains the decompressed frame, if decompression was successful; otherwise, NULL.
235/// IMPORTANT: The video decompressor may still be referencing the imageBuffer returned in this
236/// callback if the kVTDecodeInfo_ImageBufferModifiable flag is not set. Unless this flag
237/// is set, it is not safe to modify the returned imageBuffer.
238///
239/// Parameter `presentationTimeStamp`: The frame's presentation timestamp; kCMTimeInvalid if not available.
240///
241/// Parameter `presentationDuration`: The frame's presentation duration; kCMTimeInvalid if not available.
242///
243/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionoutputhandler?language=objc)
244#[cfg(all(
245 feature = "VTErrors",
246 feature = "block2",
247 feature = "objc2-core-media",
248 feature = "objc2-core-video"
249))]
250pub type VTDecompressionOutputHandler =
251 *mut block2::Block<dyn Fn(OSStatus, VTDecodeInfoFlags, *mut CVImageBuffer, CMTime, CMTime)>;
252
253extern "C-unwind" {
254 /// Decompresses a video frame.
255 ///
256 /// Cannot be called with a session created with a VTDecompressionOutputCallbackRecord.
257 /// If the VTDecompressionSessionDecodeFrameWithOutputHandler call returns an error, the block
258 /// will not be called.
259 ///
260 /// Parameter `session`: The decompression session.
261 ///
262 /// Parameter `sampleBuffer`: A CMSampleBuffer containing one or more video frames.
263 ///
264 /// Parameter `decodeFlags`: A bitfield of directives to the decompression session and decoder.
265 /// The kVTDecodeFrame_EnableAsynchronousDecompression bit indicates whether the video decoder
266 /// may decompress the frame asynchronously.
267 /// The kVTDecodeFrame_EnableTemporalProcessing bit indicates whether the decoder may delay calls to the output callback
268 /// so as to enable processing in temporal (display) order.
269 /// If both flags are clear, the decompression shall complete and your output callback function will be called
270 /// before VTDecompressionSessionDecodeFrame returns.
271 /// If either flag is set, VTDecompressionSessionDecodeFrame may return before the output callback function is called.
272 ///
273 /// Parameter `infoFlagsOut`: Points to a VTDecodeInfoFlags to receive information about the decode operation.
274 /// The kVTDecodeInfo_Asynchronous bit may be set if the decode is (or was) running
275 /// asynchronously.
276 /// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped (synchronously).
277 /// Pass NULL if you do not want to receive this information.
278 ///
279 /// Parameter `outputHandler`: The block to be called when decoding the frame is completed. If the VTDecompressionSessionDecodeFrameWithOutputHandler
280 /// call returns an error, the block will not be called.
281 #[cfg(all(
282 feature = "VTErrors",
283 feature = "block2",
284 feature = "objc2-core-media",
285 feature = "objc2-core-video"
286 ))]
287 pub fn VTDecompressionSessionDecodeFrameWithOutputHandler(
288 session: &VTDecompressionSession,
289 sample_buffer: &CMSampleBuffer,
290 decode_flags: VTDecodeFrameFlags,
291 info_flags_out: *mut VTDecodeInfoFlags,
292 output_handler: VTDecompressionOutputHandler,
293 ) -> OSStatus;
294}
295
296extern "C-unwind" {
297 /// Directs the decompression session to emit all delayed frames.
298 ///
299 /// By default, the decompression session may not delay frames indefinitely;
300 /// frames may only be indefinitely delayed if the client opts in via
301 /// kVTDecodeFrame_EnableTemporalProcessing.
302 /// IMPORTANT NOTE: This function may return before all delayed frames are emitted.
303 /// To wait for them, call VTDecompressionSessionWaitForAsynchronousFrames instead.
304 pub fn VTDecompressionSessionFinishDelayedFrames(session: &VTDecompressionSession) -> OSStatus;
305}
306
307/// Indicates whether the session can decode frames with the given format description.
308///
309/// Some video decoders are able to accommodate minor changes in format without needing to be
310/// completely reset in a new session. This function can be used to test whether a format change
311/// is sufficiently minor.
312#[cfg(feature = "objc2-core-media")]
313#[inline]
314pub unsafe extern "C-unwind" fn VTDecompressionSessionCanAcceptFormatDescription(
315 session: &VTDecompressionSession,
316 new_format_desc: &CMFormatDescription,
317) -> bool {
318 extern "C-unwind" {
319 fn VTDecompressionSessionCanAcceptFormatDescription(
320 session: &VTDecompressionSession,
321 new_format_desc: &CMFormatDescription,
322 ) -> Boolean;
323 }
324 let ret = unsafe { VTDecompressionSessionCanAcceptFormatDescription(session, new_format_desc) };
325 ret != 0
326}
327
328extern "C-unwind" {
329 /// Waits for any and all outstanding asynchronous and delayed frames to complete, then returns.
330 ///
331 /// This function automatically calls VTDecompressionSessionFinishDelayedFrames,
332 /// so clients don't have to call both.
333 pub fn VTDecompressionSessionWaitForAsynchronousFrames(
334 session: &VTDecompressionSession,
335 ) -> OSStatus;
336}
337
338extern "C-unwind" {
339 /// Copies a black pixel buffer from the decompression session.
340 ///
341 /// The pixel buffer is in the same format that the session is decompressing to.
342 ///
343 /// Parameter `session`: The decompression session.
344 ///
345 /// Parameter `pixelBufferOut`: Points to a variable to receive the copied pixel buffer.
346 #[cfg(feature = "objc2-core-video")]
347 pub fn VTDecompressionSessionCopyBlackPixelBuffer(
348 session: &VTDecompressionSession,
349 pixel_buffer_out: NonNull<*mut CVPixelBuffer>,
350 ) -> OSStatus;
351}
352
353/// Indicates whether the current system supports hardware decode for a given codec
354///
355/// This routine reports whether the current system supports hardware decode. Using
356/// this information, clients can make informed decisions regarding remote assets to load,
357/// favoring alternate encodings when hardware decode is not supported.
358/// This call returning true does not guarantee that hardware decode resources will be
359/// available at all times.
360#[cfg(feature = "objc2-core-media")]
361#[inline]
362pub unsafe extern "C-unwind" fn VTIsHardwareDecodeSupported(codec_type: CMVideoCodecType) -> bool {
363 extern "C-unwind" {
364 fn VTIsHardwareDecodeSupported(codec_type: CMVideoCodecType) -> Boolean;
365 }
366 let ret = unsafe { VTIsHardwareDecodeSupported(codec_type) };
367 ret != 0
368}
369
370/// Indicates whether the current system supports stereo MV-HEVC decode.
371///
372/// This call returning true does not guarantee that decode resources will be available at all times.
373#[inline]
374pub unsafe extern "C-unwind" fn VTIsStereoMVHEVCDecodeSupported() -> bool {
375 extern "C-unwind" {
376 fn VTIsStereoMVHEVCDecodeSupported() -> Boolean;
377 }
378 let ret = unsafe { VTIsStereoMVHEVCDecodeSupported() };
379 ret != 0
380}
381
382/// Prototype for callback invoked when multi-image frame decompression is complete.
383///
384/// When you create a decompression session, you pass in a callback function to be called
385/// for decompressed frames. This function will not necessarily be called in display order.
386///
387/// Parameter `decompressionOutputMultiImageRefCon`: The callback's reference value, copied from the outputMultiImageRefcon passed to
388/// VTDecompressionSessionSetMultiImageCallback.
389///
390/// Parameter `sourceFrameRefCon`: The frame's reference value, copied from the sourceFrameRefCon argument to
391/// VTDecompressionSessionDecodeFrame.
392///
393/// Parameter `status`: noErr if decompression was successful; an error code if decompression was not successful.
394///
395/// Parameter `infoFlags`: Contains information about the decode operation.
396/// The kVTDecodeInfo_Asynchronous bit may be set if the decode ran asynchronously.
397/// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped.
398/// If the kVTDecodeInfo_ImageBufferModifiable bit is set, it is safe for the client to modify the imageBuffer.
399///
400/// Parameter `taggedBufferGroup`: Contains the decompressed frame's multiple images, if decompression was successful; otherwise, NULL.
401/// IMPORTANT: The video decompressor may still be referencing the pixelBuffers returned in this
402/// callback if the kVTDecodeInfo_ImageBufferModifiable flag is not set. Unless this flag
403/// is set, it is not safe to modify the returned pixelBuffers.
404///
405/// Parameter `presentationTimeStamp`: The frame's presentation timestamp, which will be determined by calling
406/// CMSampleBufferGetOutputPresentationTimeStamp; kCMTimeInvalid if not available.
407///
408/// Parameter `presentationDuration`: The frame's presentation duration, which will be determined by calling
409/// CMSampleBufferGetOutputDuration; kCMTimeInvalid if not available.
410///
411/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionoutputmultiimagecallback?language=objc)
412#[cfg(all(feature = "VTErrors", feature = "objc2-core-media"))]
413pub type VTDecompressionOutputMultiImageCallback = Option<
414 unsafe extern "C-unwind" fn(
415 *mut c_void,
416 *mut c_void,
417 OSStatus,
418 VTDecodeInfoFlags,
419 *mut CMTaggedBufferGroup,
420 CMTime,
421 CMTime,
422 ),
423>;
424
425extern "C-unwind" {
426 /// Provides a callback capable of receiving multiple images for individual DecodeFrame requests.
427 ///
428 /// The outputMultiImageCallback will be used when the video decoder outputs CMTaggedBufferGroups.
429 /// When installed, outputMultiImageCallback will also be used when DecodeFrame operations fail and return a nonzero status.
430 /// The original single-image callback will only be used in the case where the video decoder outputs a CVImageBuffer instead of a CMTaggedBufferGroup.
431 /// Terminology note: in multi-image decompression, a single video sample (from one CMSampleBuffer) contains a single frame (with one PTS) that is decoded to produce multiple images.
432 #[cfg(all(feature = "VTErrors", feature = "objc2-core-media"))]
433 pub fn VTDecompressionSessionSetMultiImageCallback(
434 decompression_session: &VTDecompressionSession,
435 output_multi_image_callback: VTDecompressionOutputMultiImageCallback,
436 output_multi_image_refcon: *mut c_void,
437 ) -> OSStatus;
438}
439
440/// Prototype for block invoked when frame decompression is complete.
441///
442/// When you decode a frame, you pass in a callback block to be called
443/// for that decompressed frame. This block will not necessarily be called in display order.
444/// If the VTDecompressionSessionDecodeFrameWithOutputHandler call returns an error, the block
445/// will not be called.
446///
447/// Parameter `status`: noErr if decompression was successful; an error code if decompression was not successful.
448///
449/// Parameter `infoFlags`: Contains information about the decode operation.
450/// The kVTDecodeInfo_Asynchronous bit may be set if the decode ran asynchronously.
451/// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped.
452/// If the kVTDecodeInfo_ImageBufferModifiable bit is set, it is safe for the client to modify the imageBuffer.
453///
454/// Parameter `imageBuffer`: Contains the decompressed frame, if decompression was successful and the CMSampleBuffer contained
455/// a single image frame; otherwise, NULL.
456/// IMPORTANT: The video decompressor may still be referencing the imageBuffer returned in this
457/// callback if the kVTDecodeInfo_ImageBufferModifiable flag is not set. Unless this flag
458/// is set, it is not safe to modify the returned imageBuffer.
459///
460/// Parameter `taggedBufferGroup`: Contains the decompressed frame's multiple images, if decompression was successful and the CMSampleBuffer
461/// contained a multi-image frame; otherwise, NULL.
462/// IMPORTANT: The video decompressor may still be referencing the pixelBuffers returned in this
463/// callback if the kVTDecodeInfo_ImageBufferModifiable flag is not set. Unless this flag
464/// is set, it is not safe to modify the returned pixelBuffers.
465///
466/// Parameter `presentationTimeStamp`: The frame's presentation timestamp; kCMTimeInvalid if not available.
467///
468/// Parameter `presentationDuration`: The frame's presentation duration; kCMTimeInvalid if not available.
469///
470/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecompressionmultiimagecapableoutputhandler?language=objc)
471#[cfg(all(
472 feature = "VTErrors",
473 feature = "block2",
474 feature = "objc2-core-media",
475 feature = "objc2-core-video"
476))]
477pub type VTDecompressionMultiImageCapableOutputHandler = *mut block2::Block<
478 dyn Fn(
479 OSStatus,
480 VTDecodeInfoFlags,
481 *mut CVImageBuffer,
482 *mut CMTaggedBufferGroup,
483 CMTime,
484 CMTime,
485 ),
486>;
487
488extern "C-unwind" {
489 /// Decompresses a video frame.
490 ///
491 /// Cannot be called with a session created with a VTDecompressionOutputCallbackRecord.
492 /// If the VTDecompressionSessionDecodeFrameWithOutputHandler call returns an error, the block
493 /// will not be called.
494 ///
495 /// Parameter `session`: The decompression session.
496 ///
497 /// Parameter `sampleBuffer`: A CMSampleBuffer containing one or more video frames.
498 ///
499 /// Parameter `decodeFlags`: A bitfield of directives to the decompression session and decoder.
500 /// The kVTDecodeFrame_EnableAsynchronousDecompression bit indicates whether the video decoder
501 /// may decompress the frame asynchronously.
502 /// The kVTDecodeFrame_EnableTemporalProcessing bit indicates whether the decoder may delay calls to the output callback
503 /// so as to enable processing in temporal (display) order.
504 /// If both flags are clear, the decompression shall complete and your output callback function will be called
505 /// before VTDecompressionSessionDecodeFrame returns.
506 /// If either flag is set, VTDecompressionSessionDecodeFrame may return before the output callback function is called.
507 ///
508 /// Parameter `infoFlagsOut`: Points to a VTDecodeInfoFlags to receive information about the decode operation.
509 /// The kVTDecodeInfo_Asynchronous bit may be set if the decode is (or was) running
510 /// asynchronously.
511 /// The kVTDecodeInfo_FrameDropped bit may be set if the frame was dropped (synchronously).
512 /// Pass NULL if you do not want to receive this information.
513 ///
514 /// Parameter `multiImageCapableHandler`: The block to be called when decoding the frame is completed. If the
515 /// VTDecompressionSessionDecodeFrameWithMultiImageCapableOutputHandler call returns an error,
516 /// the block will not be called.
517 #[cfg(all(
518 feature = "VTErrors",
519 feature = "block2",
520 feature = "objc2-core-media",
521 feature = "objc2-core-video"
522 ))]
523 pub fn VTDecompressionSessionDecodeFrameWithMultiImageCapableOutputHandler(
524 session: &VTDecompressionSession,
525 sample_buffer: &CMSampleBuffer,
526 decode_flags: VTDecodeFrameFlags,
527 info_flags_out: *mut VTDecodeInfoFlags,
528 multi_image_capable_output_handler: VTDecompressionMultiImageCapableOutputHandler,
529 ) -> OSStatus;
530}