Type Alias

VTCompressionOutputCallback

Prototype for the callback invoked when frame compression is complete.

Declaration

typealias VTCompressionOutputCallback = (UnsafeMutableRawPointer?, UnsafeMutableRawPointer?, OSStatus, VTEncodeInfoFlags, CMSampleBuffer?) -> Void

Parameters

outputCallbackRefCon

The callback's reference value.

sourceFrameRefCon
status

noErr if compression was successful; an error code if compression was not successful.

infoFlags

Contains information about the encode operation.

The asynchronous bit may be set if the encode ran asynchronously.

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

sampleBuffer

Contains the compressed frame if compression was successful and the frame was not dropped; otherwise, NULL.

Discussion

When you create a compression session, you pass in a callback function to be called for compressed frames. This function is called in decode order (which is not necessarily the same as display order).