Function

CMVideoFormatDescriptionCreate

Creates a format description for a video media stream.

Declaration

OSStatus CMVideoFormatDescriptionCreate(CFAllocatorRef allocator, CMVideoCodecType codecType, int32_t width, int32_t height, CFDictionaryRef extensions, CMVideoFormatDescriptionRef  _Nullable *formatDescriptionOut);

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

CMVideoFormatDescriptionCreateForImageBuffer

Creates a format description for a video media stream contained in CVImageBuffers of the type provided.

CMVideoFormatDescriptionGetCleanAperture

Returns the clean aperture.

CMVideoFormatDescriptionGetDimensions

Returns the video dimensions (in encoded pixels).

CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers

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

CMVideoFormatDescriptionGetPresentationDimensions

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

CMVideoFormatDescriptionMatchesImageBuffer

Checks to see if a given format description matches an image buffer.

CMVideoFormatDescriptionCreateFromH264ParameterSets

Creates a format description for a video media stream described by H.264 parameter set NAL units.

CMVideoFormatDescriptionGetH264ParameterSetAtIndex

Returns a parameter set contained in a H.264 format description.

CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer

Copies the contents of a CMVideoFormatDescription to a CMBlockBuffer in big-endian byte ordering.

CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer

Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure in a CMBlockBuffer.

CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData

Creates a CMVideoFormatDescription from a big-endian ImageDescription data structure.

CMSwapBigEndianImageDescriptionToHost

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

CMSwapHostEndianImageDescriptionToBig

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