Function

CMTimeCodeFormatDescriptionCreate(allocator:timeCodeFormatType:frameDuration:frameQuanta:flags:extensions:formatDescriptionOut:)

Creates a format description for a timecode media.

Declaration

func CMTimeCodeFormatDescriptionCreate(allocator: CFAllocator?, timeCodeFormatType: CMTimeCodeFormatType, frameDuration: CMTime, frameQuanta: UInt32, flags: UInt32, extensions: CFDictionary?, formatDescriptionOut: UnsafeMutablePointer<CMTimeCodeFormatDescription?>) -> OSStatus

Parameters

allocator

Allocator to be used for creating the CMFormatDescription object.

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

See Also

TimeCode-Specific Functions

func CMTimeCodeFormatDescriptionGetFrameDuration(CMTimeCodeFormatDescription) -> CMTime

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

func CMTimeCodeFormatDescriptionGetFrameQuanta(CMTimeCodeFormatDescription) -> UInt32

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

func CMTimeCodeFormatDescriptionGetTimeCodeFlags(CMTimeCodeFormatDescription) -> UInt32

Returns the flags for kCMTimeCodeFlag_DropFrame, kCMTimeCodeFlag_24HourMax, kCMTimeCodeFlag_NegTimesOK

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

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

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

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