CMVideoFormatDescriptionCreateForImageBuffer(allocator:imageBuffer:formatDescriptionOut:)
Creates a format description for a video media stream by using an image buffer.
Declaration
func CMVideoFormatDescriptionCreateForImageBuffer(allocator: CFAllocator?, imageBuffer: CVImageBuffer, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatusParameters
- allocator:
CFAllocatorto be used when creating theCMFormatDescription. PassNULLto use the default allocator. - imageBuffer:
Image buffer for which we are creating the format description.
- formatDescriptionOut:
On output, returns newly created video
CMFormatDescription.
Return Value
A result code. Returns noErr if successful.
Discussion
This convenience function is equivalent to:
CMVideoFormatDescriptionCreate ( allocator, ( CVPixelBufferGetTypeID() == CFGetTypeID( imageBuffer ) ? CVPixelBufferGetPixelFormatType( imageBuffer ) : 0, width of image, height of image, extensions );
extensions is a CFDictionary of attachments to image buffer with keys specified by CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers, and also kCMFormatDescriptionExtension_BytesPerRow if applicable.
See Also
Working with Video Descriptions
CMImageDescriptionFlavorCMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:)CMVideoFormatDescriptionGetCleanAperture(_:originIsAtTopLeft:)CMVideoFormatDescriptionGetDimensions(_:)CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers()CMVideoFormatDescriptionGetPresentationDimensions(_:usePixelAspectRatio:useCleanAperture:)CMVideoFormatDescriptionMatchesImageBuffer(_:imageBuffer:)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(_:_:)