CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)
Returns a Boolean value that indicates whether a format description matches an image buffer.
Declaration
func CMVideoFormatDescriptionMatchesImageBuffer(_ desc: CMVideoFormatDescription, imageBuffer: CVImageBuffer) -> BoolParameters
- desc:
CMVideoFormatDescription to validate.
- imageBuffer:
Image buffer to validate against.
Return Value
A Boolean indicating whether the format description matches the image buffer.
Discussion
This function uses the keys returned by CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers to compare the extensions of the given format description to the attachments of the given image buffer (if an attachment is absent in either it must be absent in both). It also checks kCMFormatDescriptionExtension_BytesPerRow against CVPixelBufferGetBytesPerRow, if applicable.
See Also
Working with Video Descriptions
CMImageDescriptionFlavorCMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:)CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)CMVideoFormatDescriptionGetCleanAperture(_:originIsAtTopLeft:)CMVideoFormatDescriptionGetDimensions(_:)CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers()CMVideoFormatDescriptionGetPresentationDimensions(_:usePixelAspectRatio:useCleanAperture:)CMVideoFormatDescriptionCreateFromH264ParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:formatDescriptionOut:)CMVideoFormatDescriptionCreateFromHEVCParameterSets(allocator:parameterSetCount:parameterSetPointers:parameterSetSizes:nalUnitHeaderLength:extensions:formatDescriptionOut:)CMVideoFormatDescriptionGetH264ParameterSetAtIndex(_:parameterSetIndex:parameterSetPointerOut:parameterSetSizeOut:parameterSetCountOut:nalUnitHeaderLengthOut:)CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer(allocator:videoFormatDescription:stringEncoding:flavor:blockBufferOut:)CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer(allocator:bigEndianImageDescriptionBlockBuffer:stringEncoding:flavor:formatDescriptionOut:)CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData(allocator:bigEndianImageDescriptionData:size:stringEncoding:flavor:formatDescriptionOut:)CMSwapBigEndianImageDescriptionToHost(_:_:)CMSwapHostEndianImageDescriptionToBig(_:_:)