VTDecompressionSession
An object that decompresses video data.
Overview
A decompression session supports the decompression of a sequence of video frames. Here’s the basic workflow:
Create a decompression session by calling VTDecompressionSessionCreate(allocator:formatDescription:decoderSpecification:imageBufferAttributes:outputCallback:decompressionSessionOut:).
Optionally, configure the session with your desired Decompression Properties by calling VTSessionSetProperty(_:key:value:) or VTSessionSetProperties(_:propertyDictionary:).
Decode video frames using VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:).
When you finish with the decompression session, call VTDecompressionSessionInvalidate(_:) to tear it down, and call CFRelease to free its memory.
Topics
Creating a Session
VTDecompressionSessionCreate(allocator:formatDescription:decoderSpecification:imageBufferAttributes:decompressionSessionOut:)VTDecompressionSessionCreate(allocator:formatDescription:decoderSpecification:imageBufferAttributes:outputCallback:decompressionSessionOut:)
Configuring a Session
Decoding Frames
VTDecompressionSessionCanAcceptFormatDescription(_:formatDescription:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameRefcon:infoFlagsOut:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameOptions:frameRefcon:infoFlagsOut:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:infoFlagsOut:outputHandler:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:frameOptions:infoFlagsOut:outputHandler:)VTDecompressionSessionDecodeFrame(_:sampleBuffer:flags:infoFlagsOut:completionHandler:)VTDecompressionSessionFinishDelayedFrames(_:)VTDecompressionSessionWaitForAsynchronousFrames(_:)VTDecompressionSessionCopyBlackPixelBuffer(_:pixelBufferOut:)