<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 10.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoToolbox",
  "identifier" : "/documentation/VideoToolbox/VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Video Toolbox"
    ],
    "preciseIdentifier" : "c:@F@VTDecompressionSessionDecodeFrame"
  },
  "title" : "VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:)"
}
-->

# VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:)

Decompresses a video frame.

```
func VTDecompressionSessionDecodeFrame(_ session: VTDecompressionSession, sampleBuffer: CMSampleBuffer, flags decodeFlags: VTDecodeFrameFlags, frameRefcon sourceFrameRefCon: UnsafeMutableRawPointer?, infoFlagsOut: UnsafeMutablePointer<VTDecodeInfoFlags>?) -> OSStatus
```

## Parameters

`session`

The decompression session.

`sampleBuffer`

A <doc://com.apple.documentation/documentation/CoreMedia/CMSampleBuffer> object containing one or more video frames.

`decodeFlags`

A bitfield of directives to the decompression session and decoder.

    The [`kVTDecodeFrame_EnableAsynchronousDecompression`](/documentation/VideoToolbox/VTDecodeFrameFlags/kVTDecodeFrame_EnableAsynchronousDecompression)     bit indicates whether the video decoder may decompress the frame asynchronously.

    The [`kVTDecodeFrame_EnableTemporalProcessing`](/documentation/VideoToolbox/VTDecodeFrameFlags/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     `VTDecompressionSessionDecodeFrame`     returns. If either flag is set,     `VTDecompressionSessionDecodeFrame`     may return before the output callback function is called.

`sourceFrameRefCon`

Your reference value for the frame.  Note that if `sampleBuffer` contains multiple frames, the output callback function is called multiple times with this `sourceFrameRefCon` value.

`infoFlagsOut`

A [`VTEncodeInfoFlags`](/documentation/VideoToolbox/VTEncodeInfoFlags) pointer to receive information about the decode operation.

    The [`asynchronous`](/documentation/VideoToolbox/VTDecodeInfoFlags/asynchronous)     bit may be set if the decode is (or was) running asynchronously.

    The [`frameDropped`](/documentation/VideoToolbox/VTDecodeInfoFlags/frameDropped)     bit may be set if the frame was dropped (synchronously).

    Pass     `NULL`     if you do not want to receive this information.

## Return Value

An `OSStatus` value that indicates the result of the operation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)