Decompresses a video frame and invokes the output callback when the decompression completes.


func VTDecompressionSessionDecodeFrame(_ session: VTDecompressionSession, sampleBuffer: CMSampleBuffer, flags decodeFlags: VTDecodeFrameFlags, infoFlagsOut: UnsafeMutablePointer<VTDecodeInfoFlags>?, outputHandler: @escaping VTDecompressionOutputHandler) -> OSStatus



The decompression session.


A CMSampleBuffer object containing one or more video frames.


A bitfield of directives to the decompression session and decoder.

The kVTDecodeFrame_EnableAsynchronousDecompression bit indicates whether the video decoder may decompress the frame asynchronously.

The kVTDecodeFrame_EnableTemporalProcessing bit indicates whether the decoder may delay calls to the output callback so as to enable processing in temporal (display) order.

If both flags are clear, the decompression shall complete and your output callback function will be called before VTDecompressionSessionDecodeFrame returns. If either flag is set, VTDecompressionSessionDecodeFrame may return before the output callback function is called.


A VTEncodeInfoFlags pointer to receive information about the decode operation.

The asynchronous bit may be set if the decode is (or was) running asynchronously.

The frameDropped bit may be set if the frame was dropped (synchronously).

Pass NULL if you do not want to receive this information.


The block to be called when decoding the frame is completed.


This function cannot be called with a session created with a VTDecompressionOutputCallbackRecord.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software