Contents

CMMetadataCreateKeyFromIdentifier(allocator:identifier:keyOut:)

Creates a copy of the key by using an identifier.

Declaration

func CMMetadataCreateKeyFromIdentifier(allocator: CFAllocator?, identifier: CFString, keyOut: UnsafeMutablePointer<CFTypeRef?>) -> OSStatus

Parameters

  • allocator:

    The allocator to use for creating the identifier.

  • identifier:

    The identifier to be inspected.

  • keyOut:

    Upon return, a pointer to the key data that was used to create the identifier.

Return Value

If successful, a nonzero result code. See Metadata Identifier Error Codes.

Discussion

The returned CFType is based on the keyspace encoded in the identifier.

For OSType keyspaces, the key will be returned as a CFNumber, where a big endian interpretation of its CFNumberType.sInt32Type value represents the four bytes of the key’s numeric value.

For the keyspaces kCMMetadataKeySpace_QuickTimeMetadata and kCMMetadataKeySpace_Icy, the key will be returned as a CFString.

All other keyspaces will have the function return the key as a CFData.

See Also

Creating Metadata Identifiers