CMFormatDescription

A media format descriptor that describes the samples in a sample buffer.

Overview

CMFormatDescriptions are immutable Core Foundation objects that describe media data of various types, including audio, video, and muxed media data. There are two types of API: media-type-agnostic APIs (supported by all CMFormatDescriptions) and media-type-specific APIs. The media-type-agnostic APIs are prefixed with CMFormatDescription, and the media-type-specific APIs are prefixed with CMAudioFormatDescription, CMVideoFormatDescription, and so on.

Topics

Common Functions

CMFormatDescriptionCreate

Creates a generic CMFormatDescription object. You should not call this method for the media types that has specific create functions such as audio, video, text, muxed, metaData and timeCode.

CMFormatDescriptionEqual

Compares two CMFormatDescription objects for equality.

CMFormatDescriptionEqualIgnoringExtensionKeys

Compares two CMFormatDescription objects for equality, ignoring differences in the specified lists of format description extension keys and sample description extension keys.

CMFormatDescriptionGetExtension

Returns the specified extension of a CMFormatDescription.

CMFormatDescriptionGetExtensions

Returns an immutable dictionary containing all the extensions of a CMFormatDescription.

CMFormatDescriptionGetMediaSubType

Returns the media subtype of a CMFormatDescription.

CMFormatDescriptionGetMediaType

Returns the media type of a CMFormatDescription.

CMFormatDescriptionGetTypeID

Returns the CFTypeID of CMFormatDescription objects.

Audio-Specific Functions

CMAudioFormatDescriptionCreateSummary

Creates a summary audio format description from an array of audio format descriptions.

CMAudioFormatDescriptionCreate

Creates a format description for an audio media stream.

CMAudioFormatDescriptionEqual

Evaluates equality for the specified parts of two audio format descriptions.

CMAudioFormatDescriptionGetChannelLayout

Returns a read-only pointer to (and size of) the AudioChannelLayout inside an audio CMFormatDescription.

CMAudioFormatDescriptionGetFormatList

Returns a read-only pointer to (and size of) the array of AudioFormatListItem structs inside an audio CMFormatDescription.

CMAudioFormatDescriptionGetMagicCookie

Returns a read-only pointer to (and size of) the magic cookie inside an audio CMFormatDescription.

CMAudioFormatDescriptionGetMostCompatibleFormat

Returns a read-only pointer to the appropriate AudioFormatListItem inside an audio CMFormatDescription.

CMAudioFormatDescriptionGetRichestDecodableFormat

Returns a read-only pointer to the appropriate AudioFormatListItem inside an audio CMFormatDescription.

CMAudioFormatDescriptionGetStreamBasicDescription

Returns a read-only pointer to the AudioStreamBasicDescription inside an audio CMFormatDescription.

CMDoesBigEndianSoundDescriptionRequireLegacyCBRSampleTableLayout

Examine a big-endian SoundDescription data structure in a CMBlockBuffer, and report whether the sample tables will need to use the legacy CBR layout.

CMSwapBigEndianSoundDescriptionToHost

Converts a SoundDescription data structure from big-endian to host-endian in place.

CMSwapHostEndianSoundDescriptionToBig

Converts a SoundDescription data structure from host-endian to big-endian in place.

CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionData

Creates a CMAudioFormatDescription from a big-endian SoundDescription data structure.

CMAudioFormatDescriptionCreateFromBigEndianSoundDescriptionBlockBuffer

Creates a CMAudioFormatDescription from a big-endian SoundDescription data structure in a CMBlockBuffer.

CMAudioFormatDescriptionCopyAsBigEndianSoundDescriptionBlockBuffer

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

Video-Specific Functions

CMVideoFormatDescriptionCreate

Creates a format description for a video media stream.

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.

Muxed-Specific Function

CMMuxedFormatDescriptionCreate

Creates a format description for a muxed media stream.

Metadata-Specific Functions

CMMetadataFormatDescriptionCreateWithKeys

Creates a metadata format description object specified by the key.

CMMetadataFormatDescriptionGetKeyWithLocalID

Returns the key associated with the metadata for the given local id.

CMMetadataFormatDescriptionCopyAsBigEndianMetadataDescriptionBlockBuffer

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

CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionBlockBuffer

Creates a CMMetadataFormatDescription from a big-endian MetadataDescription data structure in a CMBlockBuffer.

CMMetadataFormatDescriptionCreateFromBigEndianMetadataDescriptionData

Creates a CMMetadataFormatDescription from a big-endian MetadataDescription data structure.

CMMetadataFormatDescriptionCreateWithMetadataSpecifications

Creates a new CMMetadataFormatDescription.

CMSwapBigEndianMetadataDescriptionToHost

Converts a MetadataDescription data structure from big-endian to host-endian in place.

CMSwapHostEndianMetadataDescriptionToBig

Converts a MetadataDescription data structure from host-endian to big-endian in place.

CMMetadataFormatDescriptionGetIdentifiers

Gets an array of metadata identifiers from a metadata format description.

Text-Specific Functions

CMTextFormatDescriptionGetDefaultStyle

Returns the default style.

CMTextFormatDescriptionGetDefaultTextBox

Returns the default text box.

CMTextFormatDescriptionGetDisplayFlags

Returns the displayFlags.

CMTextFormatDescriptionGetFontName

Returns the font name for a local font ID.

CMTextFormatDescriptionGetJustification

Returns horizontal and vertical justification.

CMTextFormatDescriptionCopyAsBigEndianTextDescriptionBlockBuffer

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

CMTextFormatDescriptionCreateFromBigEndianTextDescriptionBlockBuffer

Creates a CMTextFormatDescription from a big-endian TextDescription data structure in a CMBlockBuffer.

CMTextFormatDescriptionCreateFromBigEndianTextDescriptionData

Creates a CMTextFormatDescription from a big-endian TextDescription data structure.

CMSwapBigEndianTextDescriptionToHost

Converts a TextDescription data structure from big-endian to host-endian in place.

CMSwapHostEndianTextDescriptionToBig

Converts a TextDescription data structure from host-endian to big-endian in place.

TimeCode-Specific Functions

CMTimeCodeFormatDescriptionCreate

Creates a format description for a timecode media.

CMTimeCodeFormatDescriptionGetFrameDuration

Returns the duration of each frame (for example 100/2997).

CMTimeCodeFormatDescriptionGetFrameQuanta

Returns the frames/sec for timecode (for example, 30) or frames/tick for counter mode.

CMTimeCodeFormatDescriptionGetTimeCodeFlags

Returns the flags for kCMTimeCodeFlag_DropFrame, kCMTimeCodeFlag_24HourMax, kCMTimeCodeFlag_NegTimesOK

CMTimeCodeFormatDescriptionCopyAsBigEndianTimeCodeDescriptionBlockBuffer

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

CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionBlockBuffer

Creates a CMTimeCodeFormatDescription from a big-endian TimeCodeDescription data structure in a CMBlockBuffer.

CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionData

Creates a CMTimeCodeFormatDescription from a big-endian TimeCodeDescription data structure.

CMSwapBigEndianTimeCodeDescriptionToHost

Converts a TimeCodeDescription data structure from big-endian to host-endian in place.

CMSwapHostEndianTimeCodeDescriptionToBig

Converts a TimeCodeDescription data structure from host-endian to big-endian in place.

Closed Captioning-Functions

CMClosedCaptionFormatDescriptionCopyAsBigEndianClosedCaptionDescriptionBlockBuffer

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

CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionBlockBuffer

Creates a CMClosedCaptionFormatDescription from a big-endian ClosedCaptionDescription data structure in a CMBlockBuffer.

CMClosedCaptionFormatDescriptionCreateFromBigEndianClosedCaptionDescriptionData

Creates a CMClosedCaptionFormatDescription from a big-endian ClosedCaptionDescription data structure.

CMSwapHostEndianClosedCaptionDescriptionToBig

Converts a ClosedCaptionDescription data structure from host-endian to big-endian in place.

CMSwapBigEndianClosedCaptionDescriptionToHost

Converts a ClosedCaptionDescription data structure from big-endian to host-endian in place.

Format Description Types

CMFormatDescriptionRef

A reference to a CMFormatDescription object.

CMAudioFormatDescriptionRef

A synonym type used for manipulating audio CMFormatDescriptions.

CMClosedCaptionFormatDescriptionRef

A synonym type used for manipulating closed-caption media CMFormatDescriptions.

CMMetadataFormatDescriptionRef

A synonym type used for manipulating metadata CMFormatDescriptions.

CMMuxedFormatDescriptionRef

A synonym type used for manipulating muxed media CMFormatDescriptions.

CMTimeCodeFormatDescriptionRef

A synonym type used for manipulating TimeCode CMFormatDescriptions.

CMVideoFormatDescriptionRef

A synonym type used for manipulating video CMFormatDescriptions.

Data Types

CMAudioFormatDescriptionRef

A synonym type used for manipulating audio CMFormatDescriptions.

CMAudioFormatDescriptionMask

A type for mask bits passed to (and returned from) CMFormatDescription, representing various parts of an audio format description.

CMVideoDimensions

Type used for video dimensions.

CMMediaType

The type of media described by a CMFormatDescription.

CMTimeCodeFormatType

The types of time Code.

CMTextFormatType

Text media format/subtype.

CMAudioCodecType

Codes to identify audio codecs.

CMClosedCaptionFormatType

Four-character codes identifying closed-caption media format types.

CMPixelFormatType

Four-character codes identifying pixel formats.

CMVideoCodecType

Four-character codes identifying the video codec.

CMMetadataFormatType

The types of TimedMetadata.

CMTextDisplayFlags

Display mode flags for text media.

CMTextJustificationValue

Justification modes for text media.

See Also

Sample Processing

CMSampleBuffer

An object containing zero or more media samples of a uniform media type.

CMBlockBuffer

An object used to move blocks of memory through a processing system.

CMAttachment

An API for attaching additional metadata to a sample buffer.