VTDecompressionOutputCallback
The prototype for the callback invoked when frame decompression is complete.
Declaration
typealias VTDecompressionOutputCallback = (UnsafeMutableRawPointer?, UnsafeMutableRawPointer?, OSStatus, VTDecodeInfoFlags, CVImageBuffer?, CMTime, CMTime) -> VoidParameters
- decompressionOutputRefCon:
The callback’s reference value, copied from the
decompressionOutputRefConfield of the Vtdecompressionoutputcallbackrecord structure. - sourceFrameRefCon:
The frame’s reference value, copied from the
sourceFrameRefConargument toVTDecompressionSessionDecodeFrame. - status:
noErrif decompression was successful; an error code if decompression was not successful. - infoFlags:
Information about the decode operation.
The Asynchronous bit may be set if the decode ran asynchronously.
The Framedropped bit may be set if the frame was dropped.
If the Imagebuffermodifiable bit is set, it is safe for the client to modify the imageBuffer.
- imageBuffer:
The decompressed frame, if decompression was successful; otherwise,
NULL. - presentationTimeStamp:
The frame’s presentation timestamp, which is determined by calling Cmsamplebuffergetoutputpresentationtimestamp(_:); otherwise,
kCMTimeInvalidif the timestamp is not available. - presentationDuration:
The frame’s presentation duration, which is determined by calling Cmsamplebuffergetoutputduration(_:); otherwise,
kCMTimeInvalidif the timestamp is not available.
Discussion
When you create a decompression session, you pass in a callback function to be called for decompressed frames. This function is not necessarily called in display order.