---
title: VTDecompressionOutputCallback
framework: videotoolbox
role: symbol
role_heading: Type Alias
path: videotoolbox/vtdecompressionoutputcallback
---

# VTDecompressionOutputCallback

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

## Declaration

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

## Parameters

- `decompressionOutputRefCon`: The callback’s reference value, copied from the decompressionOutputRefCon field of the doc://com.apple.videotoolbox/documentation/VideoToolbox/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 doc://com.apple.videotoolbox/documentation/VideoToolbox/VTDecodeInfoFlags/asynchronous bit may be set if the decode ran asynchronously. The doc://com.apple.videotoolbox/documentation/VideoToolbox/VTDecodeInfoFlags/frameDropped bit may be set if the frame was dropped. If the doc://com.apple.videotoolbox/documentation/VideoToolbox/VTDecodeInfoFlags/imageBufferModifiable bit is set, it is safe for the client to modify the imageBuffer.
- `imageBuffer`: The decompressed frame, if decompression was successful; otherwise, NULL. important: The video decompressor may still be referencing the imageBuffer returned in this callback if the doc://com.apple.videotoolbox/documentation/VideoToolbox/VTDecodeInfoFlags/imageBufferModifiable flag is not set. Unless this flag is set, it is not safe to modify the returned imageBuffer.
- `presentationTimeStamp`: The frame’s presentation timestamp, which is determined by calling doc://com.apple.documentation/documentation/CoreMedia/CMSampleBufferGetOutputPresentationTimeStamp(_:); otherwise, kCMTimeInvalid if the timestamp is not available.
- `presentationDuration`: The frame’s presentation duration, which is determined by calling doc://com.apple.documentation/documentation/CoreMedia/CMSampleBufferGetOutputDuration(_:); otherwise, kCMTimeInvalid if the timestamp is not available.

## Discussion

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

- [VTDecompressionSession](videotoolbox/vtdecompressionsession.md)
- [VTDecodeFrameFlags](videotoolbox/vtdecodeframeflags.md)
- [VTDecodeInfoFlags](videotoolbox/vtdecodeinfoflags.md)
- [VTDecompressionOutputCallbackRecord](videotoolbox/vtdecompressionoutputcallbackrecord.md)
- [VTDecompressionOutputHandler](videotoolbox/vtdecompressionoutputhandler.md)
