VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:)
Decompresses a video frame.
Declaration
func VTDecompressionSessionDecodeFrame(_ session: VTDecompressionSession, sampleBuffer: CMSampleBuffer, flags decodeFlags: VTDecodeFrameFlags, frameRefcon sourceFrameRefCon: UnsafeMutableRawPointer?, infoFlagsOut: UnsafeMutablePointer<VTDecodeInfoFlags>?) -> OSStatusParameters
- session:
The decompression session.
- sampleBuffer:
A Cmsamplebuffer object containing one or more video frames.
- decodeFlags:
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 completes and your output callback function will be called before
VTDecompressionSessionDecodeFramereturns. If either flag is set,VTDecompressionSessionDecodeFramemay return before the output callback function is called. - sourceFrameRefCon:
Your reference value for the frame. Note that if
sampleBuffercontains multiple frames, the output callback function is called multiple times with thissourceFrameRefConvalue. - infoFlagsOut:
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
NULLif you do not want to receive this information.
Return Value
An OSStatus value that indicates the result of the operation.
See Also
Decoding Frames
VTDecompressionSessionCanAcceptFormatDescription(_:formatDescription:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameOptions:frameRefcon:infoFlagsOut:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:infoFlagsOut:outputHandler:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameOptions:infoFlagsOut:outputHandler:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:infoFlagsOut:completionHandler:)VTDecompressionSessionFinishDelayedFrames(_:)VTDecompressionSessionWaitForAsynchronousFrames(_:)VTDecompressionSessionCopyBlackPixelBuffer(_:pixelBufferOut:)