Mac Developer Library

Developer

CoreMedia Framework Reference CMFormatDescription Reference

Options
Deployment Target:

On This Page
Language:

CMFormatDescription Reference

This document describes the API for creating and manipulating CMFormatDescription objects.

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.

Functions

  • 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.

    Declaration

    Swift

    func CMFormatDescriptionCreate(_ allocator: CFAllocator!, _ mediaType: CMMediaType, _ mediaSubtype: FourCharCode, _ extensions: CFDictionary!, _ descOut: UnsafeMutablePointer<Unmanaged<CMFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMFormatDescriptionCreate ( CFAllocatorRef allocator, CMMediaType mediaType, FourCharCode mediaSubtype, CFDictionaryRef extensions, CMFormatDescriptionRef *descOut );

    Parameters

    allocator

    Allocator to use when creating the CMFormatDescription. If NULL, the default allocator will be used.

    mediaType

    Four character code identifying the type of media associated with the CMFormatDescription.

    mediaSubtype

    Four character code identifying the sub-type of media.

    extensions

    Dictionary of extensions to be attached to the CMFormatDescription. May be NULL.

    descOut

    Receives the newly-created CMFormatDescription.

    Return Value

    A result code. See “Result Codes”.

    Discussion

    Use this call to create any CMFormatDescription that is composed solely of extensions, and for which CFEqual() of a the extensions dictionaries is a valid test for Format Description equality.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Compares two CMFormatDescription objects for equality.

    Declaration

    Swift

    func CMFormatDescriptionEqual(_ ffd1: CMFormatDescription!, _ ffd2: CMFormatDescription!) -> Boolean

    Objective-C

    Boolean CMFormatDescriptionEqual ( CMFormatDescriptionRef desc1, CMFormatDescriptionRef desc2 );

    Parameters

    ffd1

    The first formatDescription.

    ffd2

    The second formatDescription.

    Return Value

    A boolean indicating whether the format descriptions are equal or not.

    Discussion

    This calls CFEqual on the provided CMFormatDescription objects. In contrast to the Core Foundation call it is NULL safe.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the specified extension of a CMFormatDescription.

    Declaration

    Swift

    func CMFormatDescriptionGetExtension(_ desc: CMFormatDescription!, _ extensionKey: CFString!) -> Unmanaged<CFPropertyList>!

    Objective-C

    CFPropertyListRef CMFormatDescriptionGetExtension ( CMFormatDescriptionRef desc, CFStringRef extensionKey );

    Parameters

    desc

    CMFormatDescription being interrogated.

    extensionKey

    Key of extension to be returned. Cannot be NULL.

    Return Value

    The specified extension of the CMFormatDescription. May be NULL.

    Discussion

    If the named extension does not exist, NULL is returned. The extension is always a valid property list object. This means that it will be either a CFNumber, CFString, CFBoolean, CFArray, CFDictionary, CFDate, or CFData. If it is a CFDictionary, the keys will all be CFStrings. The returned extension is not retained by this call, so it is only valid as long as the CMFormatDescription is valid. Clients are required to retain it if they need to keep it longer.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMFormatDescriptionGetExtensions(_ desc: CMFormatDescription!) -> Unmanaged<CFDictionary>!

    Objective-C

    CFDictionaryRef CMFormatDescriptionGetExtensions ( CMFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated

    Return Value

    An immutable dictionary containing all the extensions of the CMFormatDescription. May be NULL.

    Discussion

    If there are no extensions, NULL is returned. Extensions dictionaries are valid property list objects. This means that dictionary keys are all CFStrings, and the values are all either CFNumber, CFString, CFBoolean, CFArray, CFDictionary, CFDate, or CFData. The returned dictionary is not retained by this call, so clients are required to retain it if they need to keep it longer.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the media subtype of a CMFormatDescription.

    Declaration

    Swift

    func CMFormatDescriptionGetMediaSubType(_ desc: CMFormatDescription!) -> FourCharCode

    Objective-C

    FourCharCode CMFormatDescriptionGetMediaSubType ( CMFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated

    Return Value

    Four-character code identifying the media subtype of the CMFormatDescription.

    Discussion

    The media subtype is defined in a media-specific way. For audio streams, the media subtype is the asbd.mFormatID. For video streams, the media subtype is the video codec type. For muxed streams, it is the format of the muxed stream.

    For example, 'aac ' is returned for a description of an AAC audio stream, 'avc1' is returned for a description of an H.264 video stream, and 'mp2t' is returned for a description of an MPEG-2 transport (muxed) stream. If a particular type of media stream does not have subtypes, this API may return 0.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the media type of a CMFormatDescription.

    Declaration

    Swift

    func CMFormatDescriptionGetMediaType(_ desc: CMFormatDescription!) -> CMMediaType

    Objective-C

    CMMediaType CMFormatDescriptionGetMediaType ( CMFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated

    Return Value

    The media type of the CMFormatDescription.

    Discussion

    For example, returns kCMMediaType_Audio for a description of an audio stream.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the CFTypeID of CMFormatDescription objects.

    Declaration

    Swift

    func CMFormatDescriptionGetTypeID() -> CFTypeID

    Objective-C

    CFTypeID CMFormatDescriptionGetTypeID ( void );

    Discussion

    You can check if a CFTypeRef object is actually a CMFormatDescription by comparing CFGetTypeID(object) with CMFormatDescriptionGetTypeID().

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Creates a format description for an audio media stream.

    Declaration

    Swift

    func CMAudioFormatDescriptionCreate(_ allocator: CFAllocator!, _ asbd: UnsafePointer<AudioStreamBasicDescription>, _ layoutSize: UInt, _ layout: UnsafePointer<AudioChannelLayout>, _ magicCookieSize: UInt, _ magicCookie: UnsafePointer<Void>, _ extensions: CFDictionary!, _ outDesc: UnsafeMutablePointer<Unmanaged<CMAudioFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMAudioFormatDescriptionCreate ( CFAllocatorRef allocator, const AudioStreamBasicDescription *asbd, size_t layoutSize, const AudioChannelLayout *layout, size_t magicCookieSize, const void *magicCookie, CFDictionaryRef extensions, CMAudioFormatDescriptionRef *outDesc );

    Parameters

    allocator

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

    asbd

    Audio format description (see CoreAudioTypes.h). This information is required.

    layoutSize

    Size, in bytes, of audio channel layout. 0 if layout is NULL.

    layout

    Audio channel layout (see CoreAudioTypes.h). Can be NULL.

    magicCookieSize

    Size, in bytes, of magic cookie. 0 if magicCookie is NULL.

    magicCookie

    Magic cookie. This information is required for some formats, and must be NULL for all others.

    extensions

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

    outDesc

    On Output, Returns newly created audio CMFormatDescription.

    Return Value

    A result code. See “Result Codes”

    Discussion

    The ASBD is required, the channel layout is optional, and the magic cookie is required for some compression formats (and must be NULL for all others). The caller owns the returned CMFormatDescription, and must release it when done with it. The ASBD, magic cookie, channel layout, and extensions are all copied (the extensions are deep-copied). The caller can deallocate them or re-use them after making this call.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionEqual(_ desc1: CMAudioFormatDescription!, _ desc2: CMAudioFormatDescription!, _ equalityMask: CMAudioFormatDescriptionMask, _ equalityMaskOut: UnsafeMutablePointer<CMAudioFormatDescriptionMask>) -> Boolean

    Objective-C

    Boolean CMAudioFormatDescriptionEqual ( CMAudioFormatDescriptionRef desc1, CMAudioFormatDescriptionRef desc2, CMAudioFormatDescriptionMask equalityMask, CMAudioFormatDescriptionMask *equalityMaskOut );

    Parameters

    desc1

    The CMAudioFormatDescription being compared.

    desc2

    The CMAudioFormatDescription to which it is being compared.

    equalityMask

    Mask specifying which parts of the descriptions to compare.

    equalityMaskOut

    Pointer to variable that will be written with the results that represent the parts that are equal. Can be NULL.

    Return Value

    The result of the comparison. True if all parts in which the caller is interested are equal. False if any of the parts in which the caller is interested are not equal.

    Discussion

    Bits in equalityMask specify the caller's interest in the equality of various parts of the descriptions. Bits set and returned in equalityMaskOut represent the subset of those parts that are equal. If there is any sort of error that prevents the comparison from occurring, false will be returned, and all bits in equalityMaskOut will be cleared. If you pass kCMAudioFormatDescriptionMask_All in equalityMask, and NULL for equalityMaskOut, this API is equivalent to CFEqual(desc1, desc2).

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetChannelLayout(_ desc: CMAudioFormatDescription!, _ layoutSize: UnsafeMutablePointer<UInt>) -> UnsafePointer<AudioChannelLayout>

    Objective-C

    const AudioChannelLayout * CMAudioFormatDescriptionGetChannelLayout ( CMAudioFormatDescriptionRef desc, size_t *layoutSize );

    Parameters

    desc

    CMFormatDescription being interrogated.

    layoutSize

    Pointer to variable that will be written with the size of the layout. Can be NULL.

    Return Value

    A read-only pointer to the AudioChannelLayout inside the audio format description.

    Discussion

    See CoreAudioTypes.h for the definition of AudioChannelLayout. AudioChannelLayouts are optional; this API will return NULL if one does not exist. This API is specific to audio format descriptions, and will return NULL if called with a non-audio format description.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetFormatList(_ desc: CMAudioFormatDescription!, _ formatListSize: UnsafeMutablePointer<UInt>) -> UnsafePointer<AudioFormatListItem>

    Objective-C

    const AudioFormatListItem * CMAudioFormatDescriptionGetFormatList ( CMAudioFormatDescriptionRef desc, size_t *formatListSize );

    Parameters

    desc

    CMFormatDescription being interrogated.

    formatListSize

    Pointer to variable that will be written with the size of the formatList.

    Return Value

    A read-only pointer to the array of AudioFormatListItem structs inside the audio format description.

    Discussion

    This property is analogous to kAudioFormatProperty_FormatList (See AudioFormat.h) and follows its conventions. Namely, formats are returned in order from the most to least “rich”, with channel count taking the highest precedence followed by sample rate. This API is specific to audio format descriptions, and will return NULL if called with a non-audio format description.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetMagicCookie(_ desc: CMAudioFormatDescription!, _ cookieSizeOut: UnsafeMutablePointer<UInt>) -> UnsafePointer<Void>

    Objective-C

    const void * CMAudioFormatDescriptionGetMagicCookie ( CMAudioFormatDescriptionRef desc, size_t *cookieSizeOut );

    Parameters

    desc

    CMFormatDescription being interrogated.

    cookieSizeOut

    Pointer to variable that will be written with the size of the cookie. Can be NULL.

    Return Value

    A read-only pointer to the magic cookie inside the audio format description.

    Discussion

    The magic cookie is a completely opaque piece of data, written and read only by the codec itself. A magic cookie is only present for codecs that require it; this API will return NULL if one does not exist. This API is specific to audio format descriptions, and will return NULL if called with a non-audio format description.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetMostCompatibleFormat(_ desc: CMAudioFormatDescription!) -> UnsafePointer<AudioFormatListItem>

    Objective-C

    const AudioFormatListItem * CMAudioFormatDescriptionGetMostCompatibleFormat ( CMAudioFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated.

    Return Value

    A read-only pointer to the appropriate AudioFormatListItem inside the audio format description.

    Discussion

    This property returns a pointer to the most compatible AudioFormatListItem in the kAudioFormatProperty_FormatList (see AudioFormat.h). This API is specific to audio format descriptions, and will return NULL if called with a non-audio format description.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetRichestDecodableFormat(_ desc: CMAudioFormatDescription!) -> UnsafePointer<AudioFormatListItem>

    Objective-C

    const AudioFormatListItem * CMAudioFormatDescriptionGetRichestDecodableFormat ( CMAudioFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated.

    Return Value

    A read-only pointer to the appropriate AudioFormatListItem inside the audio format description.

    Discussion

    This property performs validation on the formats represented by the audio in the description. It finds the first AudioFormatListItem for which the current system has a valid decoder. This API is specific to audio format descriptions, and will return NULL if called with a non-audio format description. It may also return NULL if there is no suitable decoder available on the current system for this audio format.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMAudioFormatDescriptionGetStreamBasicDescription(_ desc: CMAudioFormatDescription!) -> UnsafePointer<AudioStreamBasicDescription>

    Objective-C

    const AudioStreamBasicDescription * CMAudioFormatDescriptionGetStreamBasicDescription ( CMAudioFormatDescriptionRef desc );

    Parameters

    desc

    CMFormatDescription being interrogated.

    Discussion

    See CoreAudioTypes.h for the definition of AudioStreamBasicDescription. This API is specific to audio format descriptions, and will return NULL if used with a non-audio format descriptions.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Creates a format description for a video media stream.

    Declaration

    Swift

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

    Objective-C

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

    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 CFStrings. 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.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMVideoFormatDescriptionCreateForImageBuffer(_ allocator: CFAllocator!, _ imageBuffer: CVImageBuffer!, _ outDesc: UnsafeMutablePointer<Unmanaged<CMVideoFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMVideoFormatDescriptionCreateForImageBuffer ( CFAllocatorRef allocator, CVImageBufferRef imageBuffer, CMVideoFormatDescriptionRef *outDesc );

    Parameters

    allocator

    CFAllocator to be used when creating the CMFormatDescription. Pass NULL to use the default allocator.

    imageBuffer

    Image buffer for which we are creating the format description.

    outDesc

    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 );

    where extensions is a CFDictionary of attachments to image buffer with keys specified by CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers, and also kCMFormatDescriptionExtension_BytesPerRow if applicable.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the clean aperture.

    Declaration

    Swift

    func CMVideoFormatDescriptionGetCleanAperture(_ videoDesc: CMVideoFormatDescription!, _ originIsAtTopLeft: Boolean) -> CGRect

    Objective-C

    CGRect CMVideoFormatDescriptionGetCleanAperture ( CMVideoFormatDescriptionRef videoDesc, Boolean originIsAtTopLeft );

    Parameters

    videoDesc

    CMVideoFormatDescription being interrogated.

    originIsAtTopLeft

    Pass true if the CGRect will be used in an environment where (0,0) is at the top-left corner of an enclosing rectangle and y coordinates increase as you go down. Pass false if the CGRect will be used in an environment where (0,0) is at the bottom-left corner of an enclosing rectangle  and y coordinates increase as you go up.

    Discussion

    The clean aperture is a rectangle that defines the portion of the encoded pixel dimensions that represents image data valid for display.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the video dimensions (in encoded pixels).

    Declaration

    Swift

    func CMVideoFormatDescriptionGetDimensions(_ videoDesc: CMVideoFormatDescription!) -> CMVideoDimensions

    Objective-C

    CMVideoDimensions CMVideoFormatDescriptionGetDimensions ( CMVideoFormatDescriptionRef videoDesc );

    Parameters

    videoDesc

    CMVideoFormatDescription being interrogated.

    Return Value

    The video dimensions of the given video format.

    Discussion

    This does not take into account pixel aspect ratio or clean aperture tags.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers() -> Unmanaged<CFArray>!

    Objective-C

    CFArrayRef CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers ( void );

    Discussion

    When specifying a CMFormatDescription for a CMSampleBuffer, the format description must be consistent with formatting information attached to the CVImageBuffer. The width, height, and codecType must match (for CVPixelBuffers the codec type is given by CVPixelBufferGetPixelFormatType(pixelBuffer); for other CVImageBuffers, the codecType must be 0). The format description extensions must match the image buffer attachments for all the keys in the list returned by this function (if absent in either they must be absent in both). Currently, the list is:

    kCMFormatDescriptionExtension_CleanAperture

    kCMFormatDescriptionExtension_FieldCount

    kCMFormatDescriptionExtension_FieldDetail

    kCMFormatDescriptionExtension_PixelAspectRatio

    kCMFormatDescriptionExtension_ColorPrimaries

    kCMFormatDescriptionExtension_TransferFunction

    kCMFormatDescriptionExtension_GammaLevel

    kCMFormatDescriptionExtension_YCbCrMatrix

    kCMFormatDescriptionExtension_ICCProfile

    kCMFormatDescriptionExtension_ChromaLocationTopField

    kCMFormatDescriptionExtension_ChromaLocationBottomField

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMVideoFormatDescriptionGetPresentationDimensions(_ videoDesc: CMVideoFormatDescription!, _ usePixelAspectRatio: Boolean, _ useCleanAperture: Boolean) -> CGSize

    Objective-C

    CGSize CMVideoFormatDescriptionGetPresentationDimensions ( CMVideoFormatDescriptionRef videoDesc, Boolean usePixelAspectRatio, Boolean useCleanAperture );

    Parameters

    videoDesc

    CMVideoFormatDescription being interrogated.

    usePixelAspectRatio

    Compute the dimensions maintaining pixel aspect ratio.

    useCleanAperture

    Compute the dimensions using the clean aperture.

    Discussion

    Pixel aspect ratio is used to adjust the width, leaving the height alone.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMVideoFormatDescriptionMatchesImageBuffer(_ desc: CMVideoFormatDescription!, _ imageBuffer: CVImageBuffer!) -> Boolean

    Objective-C

    Boolean CMVideoFormatDescriptionMatchesImageBuffer ( CMVideoFormatDescriptionRef desc, CVImageBufferRef imageBuffer );

    Parameters

    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.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Creates a format description for a muxed media stream.

    Declaration

    Swift

    func CMMuxedFormatDescriptionCreate(_ allocator: CFAllocator!, _ muxType: CMMuxedStreamType, _ extensions: CFDictionary!, _ outDesc: UnsafeMutablePointer<Unmanaged<CMMuxedFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMMuxedFormatDescriptionCreate ( CFAllocatorRef allocator, CMMuxedStreamType muxType, CFDictionaryRef extensions, CMMuxedFormatDescriptionRef *outDesc );

    Parameters

    allocator

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

    muxType

    Type of the muxed stream (e.g. kCMMuxedStreamType_MPEG2Transport for MPEG-2 transport stream). This is the media subtype, and will be returned if you subsequently call CMFormatDescriptionGetMediaSubType (or CMMuxedFormatDescriptionGetStreamType).

    extensions

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

    outDesc

    On output, returns newly created muxed CMFormatDescription

    Return Value

    A result code. Returns noErr if successful.

    Discussion

    A muxed format description does not know the formats of the sub-streams within the muxed stream. That information will only be discoverable by the demuxer software (or other software which understands the details of the muxed bitstream) which will need to produce separate format descriptions for each of its output streams. 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.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Creates a metadata format description object specified by the key.

    Declaration

    Swift

    func CMMetadataFormatDescriptionCreateWithKeys(_ allocator: CFAllocator!, _ metadataType: CMMetadataFormatType, _ keys: CFArray!, _ outDesc: UnsafeMutablePointer<Unmanaged<CMMetadataFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMMetadataFormatDescriptionCreateWithKeys ( CFAllocatorRef allocator, CMMetadataFormatType metadataType, CFArrayRef keys, CMMetadataFormatDescriptionRef *outDesc );

    Parameters

    allocator

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

    metadataType

    The type of metadata (kCMMetadataFormatType_Boxed).

    keys

    Array of metadata keys. Each key is a dictionary of key properties. The required properties are:

    • kCMMetadataFormatDescriptionKey_Namespace

    • kCMMetadataFormatDescriptionKey_Value

    • kCMMetadataFormatDescriptionKey_LocalID

    outDesc

    Returns newly created metadata CMFormatDescription.

    Return Value

    A result code. Returns noErr if successful.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    func CMMetadataFormatDescriptionGetKeyWithLocalID(_ desc: CMMetadataFormatDescription!, _ localKeyID: OSType) -> Unmanaged<CFDictionary>!

    Objective-C

    CFDictionaryRef CMMetadataFormatDescriptionGetKeyWithLocalID ( CMMetadataFormatDescriptionRef desc, OSType localKeyID );

    Parameters

    desc

    Format description being interrogated.

    localKeyID

    Local Id identifying the key associated with the metadata description.

    Return Value

    A new dictionary containing the key specified by the localKeyID, or NULL if there is no key corresponding to the localKeyID.

    Discussion

    When writing a metadata track to a QuickTime movie, you can store many different kinds of metadata in one track. The format description for the track describes all of the kinds of metadata that might be present in that track. And each kind of metadata has an id assigned to it which is unique from the others in the group. So when individual samples of metadata are written (or read back later), they don't contain their full description, instead they just contain the unique id (called the local id) that was assigned to them. For instance, GPS might be local id 1, and face data might be local id 2. When someone pulls such a sample from a movie and wants to do a reverse lookup, they can call CMMetadataFormatDescriptionGetKeyWithLocalID, using the local id they've got, to get the Key associated with this metadata.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the default style.

    Declaration

    Swift

    func CMTextFormatDescriptionGetDefaultStyle(_ desc: CMFormatDescription!, _ outLocalFontID: UnsafeMutablePointer<UInt16>, _ outBold: UnsafeMutablePointer<Boolean>, _ outItalic: UnsafeMutablePointer<Boolean>, _ outUnderline: UnsafeMutablePointer<Boolean>, _ outFontSize: UnsafeMutablePointer<CGFloat>, _ CGFloat outColorComponents[4]: UnsafeMutablePointer<CGFloat>) -> OSStatus

    Objective-C

    OSStatus CMTextFormatDescriptionGetDefaultStyle ( CMFormatDescriptionRef desc, uint16_t *outLocalFontID, Boolean *outBold, Boolean *outItalic, Boolean *outUnderline, CGFloat *outFontSize, CGFloat outColorComponents[4] );

    Parameters

    desc

    CMFormatDescription being interrogated.

    outLocalFontID

    Font number, local to the FormatDescription. May be NULL.

    outBold

    Returned true if style includes Bold. May be NULL.

    outItalic

    On output, returns true if style includes Italic. May be NULL.

    outUnderline

    On output, returns true if style includes Underline. May be NULL.

    outFontSize

    FontSize in points. May be NULL.

    CGFloat outColorComponents[4]

    Color components in order red, green, blue, and alpha. May be NULL.

    Return Value

    A result code. Returns noErr if Successful.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the default text box.

    Declaration

    Swift

    func CMTextFormatDescriptionGetDefaultTextBox(_ desc: CMFormatDescription!, _ originIsAtTopLeft: Boolean, _ heightOfTextTrack: CGFloat, _ outDefaultTextBox: UnsafeMutablePointer<CGRect>) -> OSStatus

    Objective-C

    OSStatus CMTextFormatDescriptionGetDefaultTextBox ( CMFormatDescriptionRef desc, Boolean originIsAtTopLeft, CGFloat heightOfTextTrack, CGRect *outDefaultTextBox );

    Parameters

    desc

    FormatDescription being interrogated.

    originIsAtTopLeft

    Pass true if the CGRect will be used in an environment where (0,0) is at the top-left corner of an enclosing rectangle and y coordinates increase as you go down. Pass false if the CGRect will be used in an environment where (0,0) is at the bottom-left corner of an enclosing rectangle  and y coordinates increase as you go up.

    heightOfTextTrack

    If originIsAtTopLeft is false, pass the height of the enclosing text track or destination. This value will be used to properly compute the default text box for the given origin. Ignored if originIsAtTopLeft is true.

    outDefaultTextBox

    On output, receives the default text box.

    Return Value

    A result code. Returns noErr if successful.

    Discussion

    Within a text track, text is rendered within a text box. There is a default text box set, which can be over-ridden by a sample.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the displayFlags.

    Declaration

    Swift

    func CMTextFormatDescriptionGetDisplayFlags(_ desc: CMFormatDescription!, _ outDisplayFlags: UnsafeMutablePointer<CMTextDisplayFlags>) -> OSStatus

    Objective-C

    OSStatus CMTextFormatDescriptionGetDisplayFlags ( CMFormatDescriptionRef desc, CMTextDisplayFlags *outDisplayFlags );

    Parameters

    desc

    CMFormatDescription being interrogated.

    outDisplayFlags

    On output, receives the display flags.

    Return Value

    A result code. Returns noErr if successful.

    Discussion

    These are the flags that control how the text appears.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the font name for a local font ID.

    Declaration

    Swift

    func CMTextFormatDescriptionGetFontName(_ desc: CMFormatDescription!, _ localFontID: UInt16, _ outFontName: UnsafeMutablePointer<Unmanaged<CFString>?>) -> OSStatus

    Objective-C

    OSStatus CMTextFormatDescriptionGetFontName ( CMFormatDescriptionRef desc, uint16_t localFontID, CFStringRef *outFontName );

    Parameters

    desc

    CMFormatDescription being interrogated.

    localFontID

    Font number, local to the FormatDescription.

    outFontName

    On output, returns name of the font. The returned font is not retained by this call, so clients are required to retain it if they need to keep it longer.

    Return Value

    A result code. Returns noErr if successful.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns horizontal and vertical justification.

    Declaration

    Swift

    func CMTextFormatDescriptionGetJustification(_ desc: CMFormatDescription!, _ outHorizontalJust: UnsafeMutablePointer<CMTextJustificationValue>, _ outVerticalJust: UnsafeMutablePointer<CMTextJustificationValue>) -> OSStatus

    Objective-C

    OSStatus CMTextFormatDescriptionGetJustification ( CMFormatDescriptionRef desc, CMTextJustificationValue *outHorizontalJust, CMTextJustificationValue *outVerticalJust );

    Parameters

    desc

    CMFormatDescription being interrogated.

    outHorizontalJust

    Horizontal justification mode. May be NULL.

    outVerticalJust

    Vertical justification mode. May be NULL.

    Return Value

    A result code. Returns noErr if successful.

    Discussion

    For possible values see CMTextJustificationValue.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Creates a format description for a timecode media.

    Declaration

    Swift

    func CMTimeCodeFormatDescriptionCreate(_ allocator: CFAllocator!, _ timeCodeFormatType: CMTimeCodeFormatType, _ frameDuration: CMTime, _ frameQuanta: UInt32, _ tcFlags: UInt32, _ extensions: CFDictionary!, _ descOut: UnsafeMutablePointer<Unmanaged<CMTimeCodeFormatDescription>?>) -> OSStatus

    Objective-C

    OSStatus CMTimeCodeFormatDescriptionCreate ( CFAllocatorRef allocator, CMTimeCodeFormatType timeCodeFormatType, CMTime frameDuration, uint32_t frameQuanta, uint32_t tcFlags, CFDictionaryRef extensions, CMTimeCodeFormatDescriptionRef *descOut );

    Parameters

    allocator

    Allocator to be used for creating the CMFormatDescription object.

    timeCodeFormatType

    One of the CMTimeCodeFormatTypes.

    frameDuration

    Duration of each frame (e.g. 100/2997).

    frameQuanta

    Frames/sec for timecode (e.g.. 30) OR frames/tick for counter mode.

    tcFlags

    kCMTimeCodeFlag_DropFrame, kCMTimeCodeFlag_24HourMax, kCMTimeCodeFlag_NegTimesOK. For possible values, see Time Code Flags.

    extensions

    Keys are always CFStrings. Values are always property list objects (i.e. CFData). May be NULL.

    descOut

    Receives the newly-created 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.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the duration of each frame (e.g. 100/2997)

    Declaration

    Swift

    func CMTimeCodeFormatDescriptionGetFrameDuration(_ timeCodeFormatDescription: CMTimeCodeFormatDescription!) -> CMTime

    Objective-C

    CMTime CMTimeCodeFormatDescriptionGetFrameDuration ( CMTimeCodeFormatDescriptionRef timeCodeFormatDescription );

    Parameters

    timeCodeFormatDescription

    CMTimeCodeFormatDescription being interrogated.

    Return Value

    The duration of each frame represented in CMTime format.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the frames/sec for timecode (e.g. 30) OR frames/tick for counter mode.

    Declaration

    Swift

    func CMTimeCodeFormatDescriptionGetFrameQuanta(_ timeCodeFormatDescription: CMTimeCodeFormatDescription!) -> UInt32

    Objective-C

    uint32_t CMTimeCodeFormatDescriptionGetFrameQuanta ( CMTimeCodeFormatDescriptionRef timeCodeFormatDescription );

    Parameters

    timeCodeFormatDescription

    CMTimeCodeFormatDescription being interrogated.

    Discussion

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Returns the flags for kCMTimeCodeFlag_DropFrame, kCMTimeCodeFlag_24HourMax, kCMTimeCodeFlag_NegTimesOK

    Declaration

    Swift

    func CMTimeCodeFormatDescriptionGetTimeCodeFlags(_ desc: CMTimeCodeFormatDescription!) -> UInt32

    Objective-C

    uint32_t CMTimeCodeFormatDescriptionGetTimeCodeFlags ( CMTimeCodeFormatDescriptionRef desc );

    Parameters

    desc

    CMTimeCodeFormatDescription being interrogated.

    Discussion

    For possible time code flags see “Time Code Flags”.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

Data Types

Format Description Types

  • A reference to a CMFormatDescription object.

    Declaration

    Swift

    typealias CMFormatDescriptionRef = CMFormatDescription

    Objective-C

    typedef struct opaqueCMFormatDescription *CMFormatDescriptionRef;

    Discussion

    A CMFormatDescription object is a Core Foundation object describing media of a particular type (audio, video, muxed, and so on).

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • A synonym type used for manipulating audio CMFormatDescriptions.

    Declaration

    Swift

    typealias CMAudioFormatDescriptionRef = CMAudioFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMAudioFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • A synonym type used for manipulating video CMFormatDescriptions.

    Declaration

    Swift

    typealias CMVideoFormatDescriptionRef = CMVideoFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMVideoFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • A synonym type used for manipulating muxed media CMFormatDescriptions.

    Declaration

    Swift

    typealias CMMuxedFormatDescriptionRef = CMMuxedFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMMuxedFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    typealias CMClosedCaptionFormatDescriptionRef = CMClosedCaptionFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMClosedCaptionFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • A synonym type used for manipulating TimeCode CMFormatDescriptions.

    Declaration

    Swift

    typealias CMTimeCodeFormatDescriptionRef = CMTimeCodeFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMTimeCodeFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • A synonym type used for manipulating metadata CMFormatDescriptions.

    Declaration

    Swift

    typealias CMMetadataFormatDescriptionRef = CMMetadataFormatDescription

    Objective-C

    typedef CMFormatDescriptionRef CMMetadataFormatDescriptionRef;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

Media Types

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

    Declaration

    Swift

    typealias CMAudioFormatDescriptionMask = UInt32

    Objective-C

    typedef uint32_t CMAudioFormatDescriptionMask;

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Type used for video dimensions.

    Declaration

    Swift

    struct CMVideoDimensions { var width: Int32 var height: Int32 }

    Objective-C

    typedef struct { int32_t width; int32_t height; } CMVideoDimensions;

    Fields

    width

    The width of the video.

    height

    The height of the video.

    Discussion

    The units are pixels.

    Availability

    Available in OS X v10.7 and later.

Constants

  • The type of media described by a CMFormatDescription.

    Declaration

    Swift

    typealias CMMediaType = FourCharCode

    Objective-C

    enum { kCMMediaType_Video = 'vide', kCMMediaType_Audio = 'soun', kCMMediaType_Muxed = 'muxx', kCMMediaType_Text = 'text', kCMMediaType_ClosedCaption = 'clcp', kCMMediaType_Subtitle = 'sbtl', kCMMediaType_TimeCode = 'tmcd', kCMMediaType_TimedMetadata = 'tmet' kCMMediaType_Metadata = 'meta' }; typedef FourCharCode CMMediaType;

    Constants

    • kCMMediaType_Video

      kCMMediaType_Video

      Video media.

      Available in OS X v10.7 and later.

    • kCMMediaType_Audio

      kCMMediaType_Audio

      Audio media.

      Available in OS X v10.7 and later.

    • kCMMediaType_Muxed

      kCMMediaType_Muxed

      Muxed media.

      Available in OS X v10.7 and later.

    • kCMMediaType_Text

      kCMMediaType_Text

      Text media.

      Available in OS X v10.7 and later.

    • kCMMediaType_ClosedCaption

      kCMMediaType_ClosedCaption

      Closed-caption media.

      Available in OS X v10.7 and later.

    • kCMMediaType_Subtitle

      kCMMediaType_Subtitle

      Subtitle media.

      Available in OS X v10.7 and later.

    • kCMMediaType_TimeCode

      kCMMediaType_TimeCode

      Time code media.

      Available in OS X v10.7 and later.

    • kCMMediaType_TimedMetadata

      kCMMediaType_TimedMetadata

      Timed meta data.

      Available in OS X v10.7 through OS X v10.7.

    • kCMMediaType_Metadata

      kCMMediaType_Metadata

      Meta data.

      Available in OS X v10.8 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • OSStatus errors returned by CMFormatDescription APIs.

    Declaration

    Swift

    var kCMFormatDescriptionError_InvalidParameter: Int { get } var kCMFormatDescriptionError_AllocationFailed: Int { get }

    Objective-C

    enum { kCMFormatDescriptionError_InvalidParameter = -12710, kCMFormatDescriptionError_AllocationFailed = -12711, };

    Constants

    • kCMFormatDescriptionError_InvalidParameter

      kCMFormatDescriptionError_InvalidParameter

      Indicates a NULL or 0 was passed for a required parameter.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionError_AllocationFailed

      kCMFormatDescriptionError_AllocationFailed

      Returned when an allocation fails.

      Available in OS X v10.7 and later.

  • The types of time Code.

    Declaration

    Swift

    typealias CMTimeCodeFormatType = FourCharCode

    Objective-C

    enum { kCMTimeCodeFormatType_TimeCode32 = 'tmcd', kCMTimeCodeFormatType_TimeCode64 = 'tc64', kCMTimeCodeFormatType_Counter32 = 'cn32', kCMTimeCodeFormatType_Counter64 = 'cn64' }; typedef FourCharCode CMTimeCodeFormatType;

    Constants

    • kCMTimeCodeFormatType_TimeCode32

      kCMTimeCodeFormatType_TimeCode32

      32-bit timeCode sample.

      Available in OS X v10.7 and later.

    • kCMTimeCodeFormatType_TimeCode64

      kCMTimeCodeFormatType_TimeCode64

      64-bit timeCode sample.

      Available in OS X v10.7 and later.

    • kCMTimeCodeFormatType_Counter32

      kCMTimeCodeFormatType_Counter32

      32-bit counter-mode sample.

      Available in OS X v10.7 and later.

    • kCMTimeCodeFormatType_Counter64

      kCMTimeCodeFormatType_Counter64

      64-bit counter-mode sample.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Declaration

    Swift

    var kCMTimeCodeFlag_DropFrame: Int { get } var kCMTimeCodeFlag_24HourMax: Int { get } var kCMTimeCodeFlag_NegTimesOK: Int { get }

    Objective-C

    enum { kCMTimeCodeFlag_DropFrame = 1 << 0, kCMTimeCodeFlag_24HourMax = 1 << 1, kCMTimeCodeFlag_NegTimesOK = 1 << 2 };

    Constants

    • kCMTimeCodeFlag_DropFrame

      kCMTimeCodeFlag_DropFrame

      Timecodes are to be rendered in drop-frame format.

      Available in OS X v10.7 and later.

    • kCMTimeCodeFlag_24HourMax

      kCMTimeCodeFlag_24HourMax

      Timecode rolls over every 24 hours.

      Available in OS X v10.7 and later.

    • kCMTimeCodeFlag_NegTimesOK

      kCMTimeCodeFlag_NegTimesOK

      Track may contain negative timecodes.

      Available in OS X v10.7 and later.

  • Display mode flags for text media.

    Declaration

    Swift

    typealias CMTextDisplayFlags = UInt32

    Objective-C

    enum { kCMTextDisplayFlag_scrollIn = 0x00000020, kCMTextDisplayFlag_scrollOut = 0x00000040, kCMTextDisplayFlag_scrollDirectionMask = 0x00000180, kCMTextDisplayFlag_scrollDirection_bottomToTop = 0x00000000, kCMTextDisplayFlag_scrollDirection_rightToLeft = 0x00000080, kCMTextDisplayFlag_scrollDirection_topToBottom = 0x00000100, kCMTextDisplayFlag_scrollDirection_leftToRight = 0x00000180, kCMTextDisplayFlag_continuousKaraoke = 0x00000800, kCMTextDisplayFlag_writeTextVertically = 0x00020000, kCMTextDisplayFlag_fillTextRegion = 0x00040000, kCMTextDisplayFlag_forcedSubtitlesPresent = 0x40000000, kCMTextDisplayFlag_allSubtitlesForced = 0x80000000, }; typedef uint32_t CMTextDisplayFlags;

    Constants

    • kCMTextDisplayFlag_scrollIn

      kCMTextDisplayFlag_scrollIn

      Text scrolls into the display region.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollOut

      kCMTextDisplayFlag_scrollOut

      Text scrolls out of the display region.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollDirectionMask

      kCMTextDisplayFlag_scrollDirectionMask

      The scrolling direction is set by a two-bit field, obtained from displayFlags using kCMTextDisplayFlag_scrollDirectionMask.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollDirection_bottomToTop

      kCMTextDisplayFlag_scrollDirection_bottomToTop

      Text is vertically scrolled up (“credits style”), entering from the bottom and leaving towards the top.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollDirection_rightToLeft

      kCMTextDisplayFlag_scrollDirection_rightToLeft

      Text is horizontally scrolled (“marquee style”), entering from the right and leaving towards the left.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollDirection_topToBottom

      kCMTextDisplayFlag_scrollDirection_topToBottom

      Text is vertically scrolled down, entering from the top and leaving towards the bottom.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_scrollDirection_leftToRight

      kCMTextDisplayFlag_scrollDirection_leftToRight

      Text is horizontally scrolled, entering from the left and leaving towards the right.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_continuousKaraoke

      kCMTextDisplayFlag_continuousKaraoke

      Enables the Continuous Karaoke mode where the range of karaoke highlighting extends to include additional ranges rather than the highlighting moves onto the next range.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_writeTextVertically

      kCMTextDisplayFlag_writeTextVertically

      Specifies the text to be rendered vertically.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_fillTextRegion

      kCMTextDisplayFlag_fillTextRegion

      The subtitle display bounds are to be filled with the color specified by kCMTextFormatDescriptionExtension_BackgroundColor.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_forcedSubtitlesPresent

      kCMTextDisplayFlag_forcedSubtitlesPresent

      There are forced subtitles present, e.g., a subtitle which only displays during foreign language sections of the video. Check individual samples to determine what type of subtitle is contained.

      Available in OS X v10.7 and later.

    • kCMTextDisplayFlag_allSubtitlesForced

      kCMTextDisplayFlag_allSubtitlesForced

      Treat all subtitle samples as if they contain forced subtitles.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Text media format/subtype.

    Declaration

    Swift

    typealias CMTextFormatType = FourCharCode

    Objective-C

    enum { kCMTextFormatType_QTText = 'text', kCMTextFormatType_3GText = 'tx3g' }; typedef FourCharCode CMTextFormatType;

    Constants

    • kCMTextFormatType_QTText

      kCMTextFormatType_QTText

      QuickTime Text media.

      Available in OS X v10.7 and later.

    • kCMTextFormatType_3GText

      kCMTextFormatType_3GText

      3GPP Text media.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Justification modes for text media.

    Declaration

    Swift

    typealias CMTextJustificationValue = Int8

    Objective-C

    enum { kCMTextJustification_left_top = 0, kCMTextJustification_centered = 1, kCMTextJustification_bottom_right = -1 }; typedef int8_t CMTextJustificationValue;

    Constants

    • kCMTextJustification_left_top

      kCMTextJustification_left_top

      Left justification when specified for horizontal justification, top justification for vertical justification.

      Available in OS X v10.7 and later.

    • kCMTextJustification_centered

      kCMTextJustification_centered

      Center justification (both horizontal and vertical justification).

      Available in OS X v10.7 and later.

    • kCMTextJustification_bottom_right

      kCMTextJustification_bottom_right

      Bottom justification when specified for vertical justification, right justification for horizontal justification.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Codes to identify audio codecs.

    Declaration

    Swift

    typealias CMAudioCodecType = FourCharCode

    Objective-C

    enum { kCMAudioCodecType_AAC_LCProtected = 'paac', kCMAudioCodecType_AAC_AudibleProtected = 'aaac' }; typedef FourCharCode CMAudioCodecType;

    Constants

    • kCMAudioCodecType_AAC_LCProtected

      kCMAudioCodecType_AAC_LCProtected

      iTMS protected low-complexity AAC.

      Available in OS X v10.7 and later.

    • kCMAudioCodecType_AAC_AudibleProtected

      kCMAudioCodecType_AAC_AudibleProtected

      Audible's protected AAC.

      Available in OS X v10.7 and later.

    Discussion

    Certain codec types are also audio formats.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Mask bits representing various parts of an audio format description.

    Declaration

    Objective-C

    enum { kCMAudioFormatDescriptionMask_StreamBasicDescription = (1<<0), kCMAudioFormatDescriptionMask_MagicCookie = (1<<1), kCMAudioFormatDescriptionMask_ChannelLayout = (1<<2), kCMAudioFormatDescriptionMask_Extensions = (1<<3), kCMAudioFormatDescriptionMask_All = kCMAudioFormatDescriptionMask_StreamBasicDescription | kCMAudioFormatDescriptionMask_MagicCookie | kCMAudioFormatDescriptionMask_ChannelLayout |kCMAudioFormatDescriptionMask_Extensions };

    Constants

    • CMAudioFormatDescriptionMask_StreamBasicDescription

      CMAudioFormatDescriptionMask_StreamBasicDescription

      Represents the AudioStreamBasicDescription.

    • CMAudioFormatDescriptionMask_MagicCookie

      CMAudioFormatDescriptionMask_MagicCookie

      Represents the magic cookie.

    • CMAudioFormatDescriptionMask_ChannelLayout

      CMAudioFormatDescriptionMask_ChannelLayout

      Represents the AudioChannelLayout.

    • CMAudioFormatDescriptionMask_Extensions

      CMAudioFormatDescriptionMask_Extensions

      Represents the format description extensions.

    • CMAudioFormatDescriptionMask_All

      CMAudioFormatDescriptionMask_All

      Represents all the parts of an audio format description.

    Discussion

    These components form the bit mask passed to (and returned from) CMAudioFormatDescriptionEqual.

  • Muxed media format/subtype.

    Declaration

    Swift

    typealias CMMuxedStreamType = FourCharCode

    Objective-C

    enum { kCMMuxedStreamType_MPEG1System = 'mp1s', kCMMuxedStreamType_MPEG2Transport = 'mp2t', kCMMuxedStreamType_MPEG2Program = 'mp2p', kCMMuxedStreamType_DV = 'dv ' }; typedef FourCharCode CMMuxedStreamType;

    Constants

    • kCMMuxedStreamType_MPEG1System

      kCMMuxedStreamType_MPEG1System

      MPEG-1 System stream.

      Available in OS X v10.7 and later.

    • kCMMuxedStreamType_MPEG2Transport

      kCMMuxedStreamType_MPEG2Transport

      MPEG-2 Transport stream.

      Available in OS X v10.7 and later.

    • kCMMuxedStreamType_MPEG2Program

      kCMMuxedStreamType_MPEG2Program

      MPEG-2 Program stream.

      Available in OS X v10.7 and later.

    • kCMMuxedStreamType_DV

      kCMMuxedStreamType_DV

      DV stream.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

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

    Declaration

    Swift

    typealias CMClosedCaptionFormatType = FourCharCode

    Objective-C

    enum { kCMClosedCaptionFormatType_CEA608 = 'c608', kCMClosedCaptionFormatType_CEA708 = 'c708' }; typedef FourCharCode CMClosedCaptionFormatType;

    Constants

    • kCMClosedCaptionFormatType_CEA608

      kCMClosedCaptionFormatType_CEA608

      CEA 608-compliant samples.

      Available in OS X v10.7 and later.

    • kCMClosedCaptionFormatType_CEA708

      kCMClosedCaptionFormatType_CEA708

      CEA 708-compliant samples.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Four-character codes identifying pixel formats.

    Declaration

    Swift

    typealias CMPixelFormatType = FourCharCode

    Objective-C

    enum { kCMPixelFormat_32ARGB = 32, kCMPixelFormat_32BGRA = 'BGRA', kCMPixelFormat_24RGB = 24, kCMPixelFormat_16BE555 = 16, kCMPixelFormat_16BE565 = 'B565', kCMPixelFormat_16LE555 = 'L555', kCMPixelFormat_16LE565 = 'L565', kCMPixelFormat_16LE5551 = '5551', kCMPixelFormat_422YpCbCr8 = '2vuy', kCMPixelFormat_422YpCbCr8_yuvs = 'yuvs', kCMPixelFormat_444YpCbCr8 = 'v308', kCMPixelFormat_4444YpCbCrA8 = 'v408', kCMPixelFormat_422YpCbCr16 = 'v216', kCMPixelFormat_422YpCbCr10 = 'v210', kCMPixelFormat_444YpCbCr10 = 'v410', kCMPixelFormat_8IndexedGray_WhiteIsZero = 0x00000028, }; typedef FourCharCode CMPixelFormatType;

    Constants

    • kCMPixelFormat_32ARGB

      kCMPixelFormat_32ARGB

      32-bit ARGB.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_32BGRA

      kCMPixelFormat_32BGRA

      32-bit BGRA.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_24RGB

      kCMPixelFormat_24RGB

      24-bit RGB.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_16BE555

      kCMPixelFormat_16BE555

      16-bit big-endian 5-5-5.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_16BE565

      kCMPixelFormat_16BE565

      16-bit big-endian 5-6-5.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_16LE555

      kCMPixelFormat_16LE555

      16-bit little-endian 5-5-5.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_16LE565

      kCMPixelFormat_16LE565

      16-bit little-endian 5-6-5.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_16LE5551

      kCMPixelFormat_16LE5551

      16-bit little-endian 5-5-5-1.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_422YpCbCr8

      kCMPixelFormat_422YpCbCr8

      Component Y'CbCr 8-bit 4:2:2 ordered Cb Y'0 Cr Y'1.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_422YpCbCr8_yuvs

      kCMPixelFormat_422YpCbCr8_yuvs

      Component Y'CbCr 8-bit 4:2:2 ordered Y'0 Cb Y'1 Cr.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_444YpCbCr8

      kCMPixelFormat_444YpCbCr8

      Component Y'CbCr 8-bit 4:4:4.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_4444YpCbCrA8

      kCMPixelFormat_4444YpCbCrA8

      Component Y'CbCrA 8-bit 4:4:4:4.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_422YpCbCr16

      kCMPixelFormat_422YpCbCr16

      Component Y'CbCr 10,12,14,16-bit 4:2:2.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_422YpCbCr10

      kCMPixelFormat_422YpCbCr10

      Component Y'CbCr 10-bit 4:2:2.

      Available in OS X v10.7 and later.

    • kCMPixelFormat_444YpCbCr10

      kCMPixelFormat_444YpCbCr10

      Component Y'CbCr 10-bit 4:4:4

      Available in OS X v10.7 and later.

    • kCMPixelFormat_8IndexedGray_WhiteIsZero

      kCMPixelFormat_8IndexedGray_WhiteIsZero

      8 bit indexed gray, white is zero.

      Available in OS X v10.7 and later.

    Discussion

    Only some codec types are pixel formats.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • The types of TimedMetadata.

    Declaration

    Swift

    typealias CMMetadataFormatType = FourCharCode

    Objective-C

    enum { kCMTimedMetadataFormatType_ICY = 'icy ', kCMTimedMetadataFormatType_ID3 = 'id3 ', kCMTimedMetadataFormatType_Boxed = 'mebx', }; typedef FourCharCode CMMetadataFormatType;

    Constants

    • kCMTimedMetadataFormatType_ICY

      kCMTimedMetadataFormatType_ICY

      SHOUTCast format.

      Available in OS X v10.7 through OS X v10.7.

    • kCMTimedMetadataFormatType_ID3

      kCMTimedMetadataFormatType_ID3

      ID3 format.

      Available in OS X v10.7 through OS X v10.7.

    • kCMTimedMetadataFormatType_Boxed

      kCMTimedMetadataFormatType_Boxed

      CoreMedia boxed format.

      Available in OS X v10.7 through OS X v10.7.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Constants to access MPEG-2 attributes.

    Declaration

    Swift

    let kCMFormatDescriptionConformsToMPEG2VideoProfile: CFString! let kCMFormatDescriptionExtension_TemporalQuality: CFString! let kCMFormatDescriptionExtension_SpatialQuality: CFString! let kCMFormatDescriptionExtension_Version: CFString! let kCMFormatDescriptionExtension_RevisionLevel: CFString! let kCMFormatDescriptionExtension_Vendor: CFString! let kCMFormatDescriptionVendor_Apple: CFString!

    Objective-C

    CFStringRef kCMFormatDescriptionConformsToMPEG2VideoProfile; CFStringRef kCMFormatDescriptionExtension_TemporalQuality; CFStringRef kCMFormatDescriptionExtension_SpatialQuality; CFStringRef kCMFormatDescriptionExtension_Version; CFStringRef kCMFormatDescriptionExtension_RevisionLevel; CFStringRef kCMFormatDescriptionExtension_Vendor; CFStringRef kCMFormatDescriptionVendor_Apple;

    Constants

    • kCMFormatDescriptionConformsToMPEG2VideoProfile

      kCMFormatDescriptionConformsToMPEG2VideoProfile

      The value is a CFNumber specifying a kCMMPEG2VideoProfile.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionExtension_TemporalQuality

      kCMFormatDescriptionExtension_TemporalQuality

      The value is a CFNumber.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionExtension_SpatialQuality

      kCMFormatDescriptionExtension_SpatialQuality

      The value is a CFNumber.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionExtension_Version

      kCMFormatDescriptionExtension_Version

      The value is a CFNumber.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionExtension_RevisionLevel

      kCMFormatDescriptionExtension_RevisionLevel

      The value is a CFNumber.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionExtension_Vendor

      kCMFormatDescriptionExtension_Vendor

      The value is a CFString of four character codes.

      Available in OS X v10.7 and later.

    • kCMFormatDescriptionVendor_Apple

      kCMFormatDescriptionVendor_Apple

      A CFString specifying Apple as the vendor.

      Available in OS X v10.7 and later.

  • These keys and values are used by text-based format descriptions.

    Declaration

    Swift

    let kCMTextFormatDescriptionExtension_DisplayFlags: CFString! let kCMTextFormatDescriptionExtension_BackgroundColor: CFString! let kCMTextFormatDescriptionColor_Red: CFString! let kCMTextFormatDescriptionColor_Green: CFString! let kCMTextFormatDescriptionColor_Blue: CFString! let kCMTextFormatDescriptionColor_Alpha: CFString! let kCMTextFormatDescriptionExtension_DefaultTextBox: CFString! let kCMTextFormatDescriptionRect_Top: CFString! let kCMTextFormatDescriptionRect_Left: CFString! let kCMTextFormatDescriptionRect_Bottom: CFString! let kCMTextFormatDescriptionRect_Right: CFString! let kCMTextFormatDescriptionExtension_DefaultStyle: CFString! let kCMTextFormatDescriptionStyle_StartChar: CFString! let kCMTextFormatDescriptionStyle_Font: CFString! let kCMTextFormatDescriptionStyle_FontFace: CFString! let kCMTextFormatDescriptionStyle_ForegroundColor: CFString! let kCMTextFormatDescriptionExtension_HorizontalJustification: CFString! let kCMTextFormatDescriptionExtension_VerticalJustification: CFString! let kCMTextFormatDescriptionStyle_EndChar: CFString! let kCMTextFormatDescriptionExtension_FontTable: CFString! let kCMTextFormatDescriptionExtension_TextJustification: CFString! let kCMTextFormatDescriptionStyle_Height: CFString! let kCMTextFormatDescriptionStyle_Ascent: CFString! let kCMTextFormatDescriptionExtension_DefaultFontName: CFString!

    Objective-C

    // Extension keys and values common to kCMTextFormatType_QTText and kCMTextFormatType_3GText format descriptions CFStringRef kCMTextFormatDescriptionExtension_DisplayFlags; CFStringRef kCMTextFormatDescriptionExtension_BackgroundColor; CFStringRef kCMTextFormatDescriptionColor_Red; CFStringRef kCMTextFormatDescriptionColor_Green; CFStringRef kCMTextFormatDescriptionColor_Blue; CFStringRef kCMTextFormatDescriptionColor_Alpha; CFStringRef kCMTextFormatDescriptionExtension_DefaultTextBox; CFStringRef kCMTextFormatDescriptionRect_Top; CFStringRef kCMTextFormatDescriptionRect_Left; CFStringRef kCMTextFormatDescriptionRect_Bottom; CFStringRef kCMTextFormatDescriptionRect_Right; CFStringRef kCMTextFormatDescriptionExtension_DefaultStyle; CFStringRef kCMTextFormatDescriptionStyle_StartChar; CFStringRef kCMTextFormatDescriptionStyle_Font; CFStringRef kCMTextFormatDescriptionStyle_FontFace; CFStringRef kCMTextFormatDescriptionStyle_ForegroundColor; CFStringRef kCMTextFormatDescriptionStyle_FontSize; // Extension keys and values specific to kCMTextFormatType_3GText CFStringRef kCMTextFormatDescriptionExtension_HorizontalJustification; CFStringRef kCMTextFormatDescriptionExtension_VerticalJustification; // Extension keys and values specific to the kCMTextFormatType_3GText kCMTextFormatDescriptionExtension_DefaultStyle dictionary CFStringRef kCMTextFormatDescriptionStyle_EndChar; CFStringRef kCMTextFormatDescriptionExtension_FontTable; // Extension keys and values specific to kCMTextFormatType_QTText CFStringRef kCMTextFormatDescriptionExtension_TextJustification; // Extension keys and values specific to the kCMTextFormatType_QTText kCMTextFormatDescriptionExtension_DefaultStyle dictionary CFStringRef kCMTextFormatDescriptionStyle_Height; CFStringRef kCMTextFormatDescriptionStyle_Ascent; CFStringRef kCMTextFormatDescriptionExtension_DefaultFontName;

    Constants

    • kCMTextFormatDescriptionExtension_DisplayFlags

      kCMTextFormatDescriptionExtension_DisplayFlags

      The value is a CFNumber (an SInt32 holding CMTextDisplayFlags).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_BackgroundColor

      kCMTextFormatDescriptionExtension_BackgroundColor

      The value is a CFDictionary.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionColor_Red

      kCMTextFormatDescriptionColor_Red

      The value is a CFNumber (SInt8 for 3G), (SInt16 for QT).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionColor_Green

      kCMTextFormatDescriptionColor_Green

      The value is a CFNumber (SInt8 for 3G), (SInt16 for QT).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionColor_Blue

      kCMTextFormatDescriptionColor_Blue

      The value is a CFNumber (SInt8 for 3G), (SInt16 for QT).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionColor_Alpha

      kCMTextFormatDescriptionColor_Alpha

      The value is a CFNumber (SInt8 for 3G), not applicable for QT text.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_DefaultTextBox

      kCMTextFormatDescriptionExtension_DefaultTextBox

      The value is a CFDictionary.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionRect_Top

      kCMTextFormatDescriptionRect_Top

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionRect_Left

      kCMTextFormatDescriptionRect_Left

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionRect_Bottom

      kCMTextFormatDescriptionRect_Bottom

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionRect_Right

      kCMTextFormatDescriptionRect_Right

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_DefaultStyle

      kCMTextFormatDescriptionExtension_DefaultStyle

      The value is a CFDictionary.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_StartChar

      kCMTextFormatDescriptionStyle_StartChar

      The value is a CFNumber (SInt16 for 3G), (SInt32 for QT).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_Font

      kCMTextFormatDescriptionStyle_Font

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_FontFace

      kCMTextFormatDescriptionStyle_FontFace

      The value is a CFNumber (SInt8).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_ForegroundColor

      kCMTextFormatDescriptionStyle_ForegroundColor

      The value is a CFDictionary.

      The dictionary contains values for kCMTextFormatDescriptionColor_Red, kCMTextFormatDescriptionColor_Green, and so on.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_HorizontalJustification

      kCMTextFormatDescriptionExtension_HorizontalJustification

      The value is a CFNumber (SInt8) containing a CMTextJustificationValue.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_VerticalJustification

      kCMTextFormatDescriptionExtension_VerticalJustification

      The value is a CFNumber (SInt8) containing a CMTextJustificationValue.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_EndChar

      kCMTextFormatDescriptionStyle_EndChar

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_FontTable

      kCMTextFormatDescriptionExtension_FontTable

      The value is a CFDictionary.

      Keys are FontIDs as CFStrings, values are font names as CFStrings.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_TextJustification

      kCMTextFormatDescriptionExtension_TextJustification

      The value is a CFNumber (SInt8) containing a CMTextJustificationValue.

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_Height

      kCMTextFormatDescriptionStyle_Height

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionStyle_Ascent

      kCMTextFormatDescriptionStyle_Ascent

      The value is a CFNumber (SInt16).

      Available in OS X v10.7 and later.

    • kCMTextFormatDescriptionExtension_DefaultFontName

      kCMTextFormatDescriptionExtension_DefaultFontName

      The value is a CFString.

      Available in OS X v10.7 and later.

  • Four-character codes identifying the video codec.

    Declaration

    Swift

    typealias CMVideoCodecType = FourCharCode

    Objective-C

    enum { kCMVideoCodecType_422YpCbCr8 = kCMPixelFormat_422YpCbCr8, kCMVideoCodecType_Animation = 'rle ', kCMVideoCodecType_Cinepak = 'cvid', kCMVideoCodecType_JPEG = 'jpeg', kCMVideoCodecType_JPEG_OpenDML = 'dmb1', kCMVideoCodecType_SorensonVideo = 'SVQ1', kCMVideoCodecType_SorensonVideo3 = 'SVQ3', kCMVideoCodecType_H263 = 'h263', kCMVideoCodecType_H264 = 'avc1', kCMVideoCodecType_MPEG4Video = 'mp4v', kCMVideoCodecType_MPEG2Video = 'mp2v', kCMVideoCodecType_MPEG1Video = 'mp1v', kCMVideoCodecType_DVCNTSC = 'dvc ', kCMVideoCodecType_DVCPAL = 'dvcp', kCMVideoCodecType_DVCProPAL = 'dvpp', kCMVideoCodecType_DVCPro50NTSC = 'dv5n', kCMVideoCodecType_DVCPro50PAL = 'dv5p', kCMVideoCodecType_DVCPROHD720p60 = 'dvhp', kCMVideoCodecType_DVCPROHD720p50 = 'dvhq', kCMVideoCodecType_DVCPROHD1080i60 = 'dvh6', kCMVideoCodecType_DVCPROHD1080i50 = 'dvh5', kCMVideoCodecType_DVCPROHD1080p30 = 'dvh3', kCMVideoCodecType_DVCPROHD1080p25 = 'dvh2', }; typedef FourCharCode CMVideoCodecType;

    Constants

    • kCMVideoCodecType_422YpCbCr8

      kCMVideoCodecType_422YpCbCr8

      Component Y'CbCr 8-bit 4:2:2 ordered Cb Y'0 Cr Y'1.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_Animation

      kCMVideoCodecType_Animation

      Apple Animation format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_Cinepak

      kCMVideoCodecType_Cinepak

      Cinepak format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_JPEG

      kCMVideoCodecType_JPEG

      Joint Photographic Experts Group (JPEG) format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_JPEG_OpenDML

      kCMVideoCodecType_JPEG_OpenDML

      JPEG format with Open-DML extensions.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_SorensonVideo

      kCMVideoCodecType_SorensonVideo

      Sorenson video format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_SorensonVideo3

      kCMVideoCodecType_SorensonVideo3

      Sorenson 3 video format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_H263

      kCMVideoCodecType_H263

      ITU-T H.263 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_H264

      kCMVideoCodecType_H264

      ITU-T H.264 format (also known as ISO/IEC 14496-10 - MPEG-4 Part 10, Advanced Video Coding format).

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_MPEG4Video

      kCMVideoCodecType_MPEG4Video

      ISO/IEC Moving Picture Experts Group (MPEG) MPEG-4 Part 2 video format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_MPEG2Video

      kCMVideoCodecType_MPEG2Video

      MPEG-2 video format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_MPEG1Video

      kCMVideoCodecType_MPEG1Video

      MPEG-1 video format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCNTSC

      kCMVideoCodecType_DVCNTSC

      DV NTSC format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPAL

      kCMVideoCodecType_DVCPAL

      DV PAL format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCProPAL

      kCMVideoCodecType_DVCProPAL

      Panasonic DVCPro PAL format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPro50NTSC

      kCMVideoCodecType_DVCPro50NTSC

      Panasonic DVCPro-50 NTSC format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPro50PAL

      kCMVideoCodecType_DVCPro50PAL

      Panasonic DVCPro-50 PAL format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD720p60

      kCMVideoCodecType_DVCPROHD720p60

      Panasonic DVCPro-HD 720p60 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD720p50

      kCMVideoCodecType_DVCPROHD720p50

      Panasonic DVCPro-HD 720p50 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD1080i60

      kCMVideoCodecType_DVCPROHD1080i60

      Panasonic DVCPro-HD 1080i60 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD1080i50

      kCMVideoCodecType_DVCPROHD1080i50

      Panasonic DVCPro-HD 1080i50 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD1080p30

      kCMVideoCodecType_DVCPROHD1080p30

      Panasonic DVCPro-HD 1080p30 format.

      Available in OS X v10.7 and later.

    • kCMVideoCodecType_DVCPROHD1080p25

      kCMVideoCodecType_DVCPROHD1080p25

      Panasonic DVCPro-HD 1080p25 format.

      Available in OS X v10.7 and later.

    Discussion

    Certain codec types are also pixel formats.

    There is no “kCMVideoCodecType_Raw”; you should use the appropriate pixel format type as the codec type.

    Import Statement

    Objective-C

    @import CoreMedia;

    Swift

    import CoreMedia

    Availability

    Available in OS X v10.7 and later.

  • Constants for video profiles. For more information on HDV, see HDV documentation.

    Declaration

    Swift

    var kCMMPEG2VideoProfile_HDV_720p30: Int { get } var kCMMPEG2VideoProfile_HDV_1080i60: Int { get } var kCMMPEG2VideoProfile_HDV_1080i50: Int { get } var kCMMPEG2VideoProfile_HDV_720p24: Int { get } var kCMMPEG2VideoProfile_HDV_720p25: Int { get } var kCMMPEG2VideoProfile_HDV_1080p24: Int { get } var kCMMPEG2VideoProfile_HDV_1080p25: Int { get } var kCMMPEG2VideoProfile_HDV_1080p30: Int { get } var kCMMPEG2VideoProfile_HDV_720p60: Int { get } var kCMMPEG2VideoProfile_HDV_720p50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_1080i60_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_1080i50_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_1080p24_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_1080p25_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_1080p30_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_720p24_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_720p25_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_720p30_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_720p50_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_720p60_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_1080i60_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_1080i50_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_1080p24_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_1080p25_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_EX_1080p30_VBR35: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_720p50_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_720p60_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_1080i60_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_1080i50_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_1080p24_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_1080p25_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_1080p30_CBR50: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD_540p: Int { get } var kCMMPEG2VideoProfile_XDCAM_HD422_540p: Int { get }

    Objective-C

    enum { kCMMPEG2VideoProfile_HDV_720p30 = 'hdv1', kCMMPEG2VideoProfile_HDV_1080i60 = 'hdv2', kCMMPEG2VideoProfile_HDV_1080i50 = 'hdv3', kCMMPEG2VideoProfile_HDV_720p24 = 'hdv4', kCMMPEG2VideoProfile_HDV_720p25 = 'hdv5', kCMMPEG2VideoProfile_HDV_1080p24 = 'hdv6', kCMMPEG2VideoProfile_HDV_1080p25 = 'hdv7', kCMMPEG2VideoProfile_HDV_1080p30 = 'hdv8', kCMMPEG2VideoProfile_HDV_720p60 = 'hdv9', kCMMPEG2VideoProfile_HDV_720p50 = 'hdva', kCMMPEG2VideoProfile_XDCAM_HD_1080i60_VBR35 = 'xdv2', kCMMPEG2VideoProfile_XDCAM_HD_1080i50_VBR35 = 'xdv3', kCMMPEG2VideoProfile_XDCAM_HD_1080p24_VBR35 = 'xdv6', kCMMPEG2VideoProfile_XDCAM_HD_1080p25_VBR35 = 'xdv7', kCMMPEG2VideoProfile_XDCAM_HD_1080p30_VBR35 = 'xdv8', kCMMPEG2VideoProfile_XDCAM_EX_720p24_VBR35 = 'xdv4', kCMMPEG2VideoProfile_XDCAM_EX_720p25_VBR35 = 'xdv5', kCMMPEG2VideoProfile_XDCAM_EX_720p30_VBR35 = 'xdv1', kCMMPEG2VideoProfile_XDCAM_EX_720p50_VBR35 = 'xdva', kCMMPEG2VideoProfile_XDCAM_EX_720p60_VBR35 = 'xdv9', kCMMPEG2VideoProfile_XDCAM_EX_1080i60_VBR35 = 'xdvb', kCMMPEG2VideoProfile_XDCAM_EX_1080i50_VBR35 = 'xdvc', kCMMPEG2VideoProfile_XDCAM_EX_1080p24_VBR35 = 'xdvd', kCMMPEG2VideoProfile_XDCAM_EX_1080p25_VBR35 = 'xdve', kCMMPEG2VideoProfile_XDCAM_EX_1080p30_VBR35 = 'xdvf', kCMMPEG2VideoProfile_XDCAM_HD422_720p50_CBR50 = 'xd5a', kCMMPEG2VideoProfile_XDCAM_HD422_720p60_CBR50 = 'xd59', kCMMPEG2VideoProfile_XDCAM_HD422_1080i60_CBR50 = 'xd5b', kCMMPEG2VideoProfile_XDCAM_HD422_1080i50_CBR50 = 'xd5c', kCMMPEG2VideoProfile_XDCAM_HD422_1080p24_CBR50 = 'xd5d', kCMMPEG2VideoProfile_XDCAM_HD422_1080p25_CBR50 = 'xd5e', kCMMPEG2VideoProfile_XDCAM_HD422_1080p30_CBR50 = 'xd5f', kCMMPEG2VideoProfile_XDCAM_HD_540p = 'xdhd', kCMMPEG2VideoProfile_XDCAM_HD422_540p = 'xdh2', };

    Constants

    • kCMMPEG2VideoProfile_HDV_720p30

      kCMMPEG2VideoProfile_HDV_720p30

      Apple Intermediate Codec HDV 720p30 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_1080i60

      kCMMPEG2VideoProfile_HDV_1080i60

      Apple Intermediate Codec HDV 1080i60 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_1080i50

      kCMMPEG2VideoProfile_HDV_1080i50

      Apple Intermediate Codec HDV 1080i50 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_720p24

      kCMMPEG2VideoProfile_HDV_720p24

      HDV 720p24 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_720p25

      kCMMPEG2VideoProfile_HDV_720p25

      HDV_720p25 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_1080p24

      kCMMPEG2VideoProfile_HDV_1080p24

      Apple ProRes 422 codec HDV 1080p24 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_1080p25

      kCMMPEG2VideoProfile_HDV_1080p25

      HDV 1080p25 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_1080p30

      kCMMPEG2VideoProfile_HDV_1080p30

      HDV 1080p30 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_720p60

      kCMMPEG2VideoProfile_HDV_720p60

      HDV 720p60 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_HDV_720p50

      kCMMPEG2VideoProfile_HDV_720p50

      HDV 720p50 format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_1080i60_VBR35

      kCMMPEG2VideoProfile_XDCAM_HD_1080i60_VBR35

      XDCAM HD 1080i60 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_1080i50_VBR35

      kCMMPEG2VideoProfile_XDCAM_HD_1080i50_VBR35

      XDCAM HD 1080i50 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_1080p24_VBR35

      kCMMPEG2VideoProfile_XDCAM_HD_1080p24_VBR35

      XDCAM HD 1080p24 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_1080p25_VBR35

      kCMMPEG2VideoProfile_XDCAM_HD_1080p25_VBR35

      XDCAM HD 1080p25 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_1080p30_VBR35

      kCMMPEG2VideoProfile_XDCAM_HD_1080p30_VBR35

      DCAM HD 1080p30 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_720p24_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_720p24_VBR35

      XDCAM EX 720p24 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_720p25_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_720p25_VBR35

      XDCAM EX 720p25 video HQ format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_720p30_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_720p30_VBR35

      XDCAM EX 720p30 video HQ format with 35 Mbps bit rate .

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_720p50_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_720p50_VBR35

      XDCAM EX 720p50 HQ video format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_720p60_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_720p60_VBR35

      XDCAM EX 720p60 HQ video format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_1080i60_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_1080i60_VBR35

      XDCAM EX 1080i60 HQ video format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_1080i50_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_1080i50_VBR35

      XDCAM EX 1080i50 HQ video format with HQ 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_1080p24_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_1080p24_VBR35

      XDCAM EX 1080p24 HQ video format with HQ 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_1080p25_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_1080p25_VBR35

      XDCAM EX 1080p25 HQ video format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_EX_1080p30_VBR35

      kCMMPEG2VideoProfile_XDCAM_EX_1080p30_VBR35

      XDCAM EX 1080p30 HQ video format with 35 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_720p50_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_720p50_CBR50

      XDCAM HD422 720p50 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_720p60_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_720p60_CBR50

      XDCAM HD422 720p60 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_1080i60_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_1080i60_CBR50

      XDCAM HD422 1080i60 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_1080i50_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_1080i50_CBR50

      XDCAM HD422 1080i50 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_1080p24_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_1080p24_CBR50

      XDCAM HD422 1080p24 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_1080p25_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_1080p25_CBR50

      XDCAM HD422 1080p25 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_1080p30_CBR50

      kCMMPEG2VideoProfile_XDCAM_HD422_1080p30_CBR50

      XDCAM HD422 1080p30 video format with 50 Mbps bit rate.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD_540p

      kCMMPEG2VideoProfile_XDCAM_HD_540p

      XDCAM HD 540p video format.

      Available in OS X v10.7 and later.

    • kCMMPEG2VideoProfile_XDCAM_HD422_540p

      kCMMPEG2VideoProfile_XDCAM_HD422_540p

      XDCAM HD422 540 video format.

      Available in OS X v10.7 and later.