Function

CMVideoFormatDescriptionCreate(allocator:codecType:width:height:extensions:formatDescriptionOut:)

Creates a format description for a video media stream.

Declaration

func CMVideoFormatDescriptionCreate(allocator: CFAllocator?, codecType: CMVideoCodecType, width: Int32, height: Int32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMVideoFormatDescription?>) -> OSStatus

Parameters

allocator

CFAllocator to be used. Pass kCFAllocatorDefault or NULL to use the default allocator.

codecType

The type of video compression.

width

The width of encoded video.

height

The height of encoded video.

extensions

Dictionary of extension key/value pairs. Keys are always CFString. Values are always property list objects (ie. CFData, CFString, CFArray, CFDictionary, CFDate, CFBoolean, or CFNumber). Can be NULL.

outDesc

On output, returns newly created video CMFormatDescription

Return Value

A result code. Returns noErr if successful.

Discussion

The caller owns the returned CMFormatDescription, and must release it when done with it. All input parameters are copied (the extensions are deep-copied). The caller can deallocate them or re-use them after making this call.

See Also

Video-Specific Functions

func CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers() -> CFArray

Returns an array of the keys that are used both as CMVideoFormatDescription extensions and CVImageBuffer attachments and attributes.

func CMVideoFormatDescriptionGetPresentationDimensions(CMVideoFormatDescription, usePixelAspectRatio: Bool, useCleanAperture: Bool) -> CGSize

Returns the dimensions, adjusted to take pixel aspect ratio and/or clean aperture into account.

func CMSwapBigEndianImageDescriptionToHost(UnsafeMutablePointer<UInt8>, Int) -> OSStatus

Converts an ImageDescription data structure from big-endian to host-endian in place.

func CMSwapHostEndianImageDescriptionToBig(UnsafeMutablePointer<UInt8>, Int) -> OSStatus

Converts an ImageDescription data structure from host-endian to big-endian in place.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software