Contents

VTDecompressionOutputCallback

The prototype for the callback invoked when frame decompression is complete.

Declaration

typealias VTDecompressionOutputCallback = (UnsafeMutableRawPointer?, UnsafeMutableRawPointer?, OSStatus, VTDecodeInfoFlags, CVImageBuffer?, CMTime, CMTime) -> Void

Parameters

  • decompressionOutputRefCon:

    The callback’s reference value, copied from the decompressionOutputRefCon field of the Vtdecompressionoutputcallbackrecord structure.

  • sourceFrameRefCon:

    The frame’s reference value, copied from the sourceFrameRefCon argument to VTDecompressionSessionDecodeFrame.

  • status:

    noErr if 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, kCMTimeInvalid if the timestamp is not available.

  • presentationDuration:

    The frame’s presentation duration, which is determined by calling Cmsamplebuffergetoutputduration(_:); otherwise, kCMTimeInvalid if 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.

See Also

Data Types