init
TypeScriptstatic init(object: CMFormatDescription): CMFormatDescriptionSwift declarationinit(referencing object: CMFormatDescription)class · iOS 4.0+ · SDK 27.1
class CMFormatDescriptionstatic init(object: CMFormatDescription): CMFormatDescriptionSwift declarationinit(referencing object: CMFormatDescription)get audioStreamBasicDescription(): (_CoreAudioTypes_AudioStreamBasicDescription) | nullSwift declarationvar audioStreamBasicDescription: AudioStreamBasicDescription? { get }Copy of the `AudioStreamBasicDescription`. See `CoreAudioTypes.h` for the definition of AudioStreamBasicDescription`. This API is specific to audio format descriptions, and will return `nil` if used with a non-audio format description.
get dimensions(): CMVideoDimensionsSwift declarationvar dimensions: CMVideoDimensions { get }Dimensions in encoded pixels. This does not take into account pixel aspect ratio or clean aperture tags.
get extensions(): CMFormatDescription_ExtensionsSwift declarationvar extensions: CMFormatDescription.Extensions { get }An immutable dictionary containing all the extensions. 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`.
get frameQuanta(): numberSwift declarationvar frameQuanta: UInt32 { get }The frames/sec for timecode (eg. `30`) OR frames/tick for counter mode.
get identifiers(): Array<string>Swift declarationvar identifiers: [String] { get }An array of metadata identifiers.
get magicCookie(): (ArrayBuffer) | nullSwift declarationvar magicCookie: Data? { get }Copy of the magic cookie.
defaultStyle(): { "localFontID": number; "bold": boolean; "italic": boolean; "underline": boolean; "fontSize": number; "colorComponents": Array<number> }Swift declarationfunc defaultStyle() throws -> (localFontID: Int, bold: Bool, italic: Bool, underline: Bool, fontSize: CGFloat, colorComponents: [CGFloat])Returns the default style. The function throws `CMFormatDescription.Error.valueNotAvailable` for format descriptions that do not carry default style information. - Returns: - localFontID: Font number, local to the format description. - bold: `true` if style includes Bold. - italic: `true` if style includes Italic. - underline: `true` if style includes Underline. - fontSize: font size in points. - colocComponents: Components are in order red, green, blue, alpha.
displayFlags(): CMFormatDescription_Extensions_Value_TextDisplayFlagsSwift declarationfunc displayFlags() throws -> CMFormatDescription.Extensions.Value.TextDisplayFlagsReturns the display flags. These are the flags that control how the text appears. The function can throw `CMFormatDescription.Error.valueNotAvailable` for formats without display flags.
get mediaSubType(): CMFormatDescription_MediaSubTypeSwift declarationvar mediaSubType: CMFormatDescription.MediaSubType { get }The media subtype of the CMFormatDescription. 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 returns `0`.
cleanAperture(originIsAtTopLeft: boolean): { x: number; y: number; width: number; height: number }Swift declarationfunc cleanAperture(originIsAtTopLeft: Bool) -> CGRectReturns the clean aperture. The clean aperture is a rectangle that defines the portion of the encoded pixel dimensions that represents image data valid for display. - Parameter 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.
get frameDuration(): CMTimeSwift declarationvar frameDuration: CMTime { get }The duration of each frame (eg. `100/2997`).
justification(): { "horizontal": CMFormatDescription_Extensions_Value_TextJustification; "vertical": CMFormatDescription_Extensions_Value_TextJustification }Swift declarationfunc justification() throws -> (horizontal: CMFormatDescription.Extensions.Value.TextJustification, vertical: CMFormatDescription.Extensions.Value.TextJustification)Returns horizontal and vertical justification. Values are `TextJustification` constants. The function throws `CMFormatDescription.Error.valueNotAvailable` for format descriptions that do not carry text justification.
get parameterSets(): CMFormatDescription_ParameterSetCollectionSwift declarationvar parameterSets: CMFormatDescription.ParameterSetCollection { get }Parameter sets contained in a H.264 or HEVC format description. Parameter sets are parsed from NAL unit in the decoder configuration record contained in a video format description. These NAL units are typically parameter sets (e.g. VPS, SPS, PPS), but may contain others as specified by ISO/IEC 14496-15 (e.g. user-data SEI). The parameter set NAL units returned will already have any emulation prevention bytes needed.
get timeCodeFlags(): CMFormatDescription_TimeCode_FlagSwift declarationvar timeCodeFlags: CMFormatDescription.TimeCode.Flag { get }The flags for `.dropFrame`, `._24HourMax`, `.negTimesOK`.
defaultTextBox(originIsAtTopLeft: boolean, heightOfTextTrack: number): { x: number; y: number; width: number; height: number }Swift declarationfunc defaultTextBox(originIsAtTopLeft: Bool, heightOfTextTrack: CGFloat) throws -> CGRectReturns the default text box. 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. The function can throw `CMFormatDescription.Error.valueNotAvailable` for format descriptions that do not carry a default text box. - Parameters: - 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`.
keyWithLocalID(localKeyID: SDKHandle): (Record<string, unknown>) | nullSwift declarationfunc keyWithLocalID(_ localKeyID: OSType) -> [String : CFPropertyList]?Returns the key associated with the metadata for the given local ID. - Parameter localKeyID: Local ID identifying the key associated with the metadata description.
get tagCollections(): (Array<Array<CMTag>>) | nullSwift declarationvar tagCollections: [[CMTag]]? { get }Returns the tag collections. This property provides the VideoLayerIDs and LeftAndRightViewIDs from hvcC and 3D Reference Displays Info SEI in the formatDescription. The returned values can be used to enable the multi-image decoding with kVTDecompressionPropertyKey_RequestedMVHEVCVideoLayerIDs. It also gives the eye mapping information for the pixel buffers of the decoded CMTaggedBuffers.
get audioFormatList(): Array<_CoreAudioTypes_AudioFormatListItem>Swift declarationvar audioFormatList: [AudioFormatListItem] { get }List of `AudioFormatListItem` structs describing the audio formats contained within the format description. 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 an empty array if called with a non-audio format description.
withMagicCookie(body: ((arg0: (ArrayBuffer) | null) => unknown)): unknownSwift declarationfunc withMagicCookie<R>(_ body: (UnsafeRawBufferPointer?) throws -> R) rethrows -> RGet access to the magic cookie. 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 `nil` if one does not exist. This API is specific to audio format descriptions, and will return `nil` if called with a non-audio format description. - Parameter body: A closure with an `UnsafeRawBufferPointer` parameter that points to the magic cookie in the audio format description. - Returns: The return value, if any, of the body closure parameter.
get audioChannelLayout(): (_CoreAudio_ManagedAudioChannelLayout) | nullSwift declarationvar audioChannelLayout: ManagedAudioChannelLayout? { get }The `AudioChannelLayout`. See `CoreAudioTypes.h` for the definition of `AudioChannelLayout`. Audio channel layouts are optional; this API will return `nil` if one does not exist. This API is specific to audio format descriptions, and will return `nil` if called with a non-audio format description.
matchesImageBuffer(imageBuffer: _CoreVideo_CVBuffer): booleanSwift declarationfunc matchesImageBuffer(_ imageBuffer: CVImageBuffer) -> BoolChecks to see if the format description matches an image buffer. This function uses the keys returned by `extensionKeysCommonWithImageBuffers` to compares the extensions of the 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. - Parameter imageBuffer: Image buffer validate against.
get nalUnitHeaderLength(): (number) | nullSwift declarationvar nalUnitHeaderLength: Int? { get }Size, in bytes, of the `NALUnitLength` field in an AVC or HEVC video sample or parameter set sample.
get mostCompatibleFormat(): (_CoreAudioTypes_AudioFormatListItem) | nullSwift declarationvar mostCompatibleFormat: AudioFormatListItem? { get }Most compatible `AudioFormatListItem` inside an audio format description. This property returns a pointer to the last `AudioFormatListItem` in the `kAudioFormatProperty_FormatList` (see `AudioFormat.h`). This API is specific to audio format descriptions, and will return `nil` if called with a non-audio format description.
presentationDimensions(usePixelAspectRatio?: boolean, useCleanAperture?: boolean): { width: number; height: number }Swift declarationfunc presentationDimensions(usePixelAspectRatio: Bool = true, useCleanAperture: Bool = true) -> CGSizeReturns the dimensions, adjusted to take pixel aspect ratio and/or clean aperture into account. Pixel aspect ratio is used to adjust the width, leaving the height alone. - Parameters: - usePixelAspectRatio: Compute the dimensions maintaining pixel aspect ratio. - useCleanAperture: Compute the dimensions using the clean aperture.
get richestDecodableFormat(): (_CoreAudioTypes_AudioFormatListItem) | nullSwift declarationvar richestDecodableFormat: AudioFormatListItem? { get }Richest `AudioFormatListItem` inside an audio format description. 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 `nil` if called with a non-audio format description. It may also return `nil` if there is no suitable decoder available on the current system for this audio format.
matchesTaggedBufferGroup(taggedBuffers: Array<CMTaggedBuffer>): booleanSwift declarationfunc matchesTaggedBufferGroup(_ taggedBuffers: [CMTaggedBuffer]) -> BoolChecks to see if the format description matches the provided tagged buffers. This function returns true if the format description matches the format description in the specified tagged buffers, false otherwise. - Parameter taggedBuffers: Tagged buffers to validate against.
static get extensionKeysCommonWithImageBuffers(): Array<CMFormatDescription_Extensions_Key>Swift declarationstatic var extensionKeysCommonWithImageBuffers: [CMFormatDescription.Extensions.Key] { get }Keys that are used both as `CMVideoFormatDescription` extensions and CVImageBuffer attachments and attributes. When specifying a format description for a `CMSampleBuffer`, the format description must be consistent with formatting information attached to the `CVImageBuffer`. The width, height, and codec type must match (for `CVPixelBuffers` the codec type is given by `CVPixelBufferGetPixelFormatType(pixelBuffer)`; for other `CVImageBuffers`, the codec type 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). See `CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers`.
static get typeID(): numberSwift declarationstatic var typeID: CFTypeID { get }The `CFTypeID` corresponding to `CMFormatDescription`.
equalToExtensionKeysToIgnoreSampleDescriptionExtensionAtomKeysToIgnore(otherFormatDescription: CMFormatDescription, extensionKeysToIgnore?: Array<CMFormatDescription_Extensions_Key>, sampleDescriptionExtensionAtomKeysToIgnore?: Array<string>): booleanSwift declarationfunc equalTo(_ otherFormatDescription: CMFormatDescription, extensionKeysToIgnore: [CMFormatDescription.Extensions.Key] = [], sampleDescriptionExtensionAtomKeysToIgnore: [String] = []) -> BoolCompares two format descriptions for equality, ignoring differences in specified lists of format description extension keys and sample description extension keys. If any keys are passed, `kCMFormatDescriptionExtension_VerbatimSampleDescription` and `kCMFormatDescriptionExtension_VerbatimISOSampleEntry` will also be automatically ignored for the purpose of comparison. - Parameters: - otherFormatDescription: A format description to compare to. - extensionKeysToIgnore: An array of format description extension keys. - sampleDescriptionExtensionAtomKeysToIgnore: An array of sample description extension atom keys. See `kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms`.
equalToEqualityMask(otherFormatDescription: CMFormatDescription, equalityMask?: CMFormatDescription_EqualityMask): [boolean, CMFormatDescription_EqualityMask]Swift declarationfunc equalTo(_ otherFormatDescription: CMAudioFormatDescription, equalityMask: CMFormatDescription.EqualityMask = .all) -> (Bool, equalityMask: CMFormatDescription.EqualityMask)Evaluates equality for the specified parts of two audio format descriptions. Bits in `equalityMask` specify the caller's interest in the equality of various parts of the descriptions. If there is any sort of error that prevents the comparison from occurring, `false` will be returned, and all bits in `equalityMask` will be cleared. If you pass `.all` in `equalityMask`, and _ for `equalityMask`, this API is equivalent to CFEqual(desc1, desc2). See CMAudioFormatDescriptionEqual - Parameters: - otherFormatDescription: The CMAudioFormatDescription to which the comparison is done. - equalityMask: Mask specifying which parts of the descriptions to compare. - Returns: `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. Bits set and returned in `equalityMask` represent the subset of those parts that are equal.
fontName(localFontID: number): stringSwift declarationfunc fontName(localFontID: Int) throws -> StringReturns the font name for a local font ID. Some format descriptions carry a mapping from local font IDs to font names. The function returns `CMFormatDescription.Error.valueNotAvailable` for format descriptions that do not carry such a font mapping table. - Parameter localFontID: Font number, local to the format description.
get mediaType(): CMFormatDescription_MediaTypeSwift declarationvar mediaType: CMFormatDescription.MediaType { get }The media type. For example, returns `.audio` for a description of an audio stream.
No declarations were skipped in this snapshot.