VTDecompressionSession

A session object that manages the decompression of incoming video data.

Overview

A decompression session supports the decompression of a sequence of video frames. Here's the basic workflow:

  1. Create a decompression session by calling VTDecompressionSessionCreate(allocator:formatDescription:decoderSpecification:imageBufferAttributes:outputCallback:decompressionSessionOut:).

  2. Optionally, configure the session with your desired Decompression Properties by calling VTSessionSetProperty(_:key:value:) or VTSessionSetProperties(_:propertyDictionary:).

  3. Decode video frames using VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:).

  4. When you finish with the decompression session, call VTDecompressionSessionInvalidate(_:) to tear it down, and call CFRelease to free its memory.

Topics

Configuring Sessions

Decompression Properties

Properties used to configure a VideoToolbox decompression session.

Inspecting Sessions

func VTDecompressionSessionGetTypeID() -> CFTypeID

Retrieves the Core Foundation type identifier for the decompression session.

Ending Sessions

Data Types

class VTDecompressionSession

A reference to a VideoToolbox decompression session.

typealias VTDecompressionOutputCallback

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

typealias VTDecompressionOutputHandler

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

Enumerations

struct VTDecodeFrameFlags

Directives for the decompression session and the video decoder, passed into decodeFlags parameter of VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:).

struct VTDecodeInfoFlags

Informational flags that describe the status of a decode operation.