Contents

CMSetAttachment(_:key:value:attachmentMode:)

Sets or adds an attachment to an attachment bearer object.

Declaration

func CMSetAttachment(_ target: CMAttachmentBearer, key: CFString, value: CFTypeRef?, attachmentMode: CMAttachmentMode)

Parameters

  • target:

    The CMAttachmentBearer object on which to add or set attachments.

  • key:

    A CFString key identifying the desired attachment.

  • value:

    A Core Foundation object attachment. If this parameter is NULL, the function returns an error.

  • attachmentMode:

    Specifies the attachment mode for this attachment. Any given attachment key may exist in only one mode at a time.

Discussion

You can attach any Core Foundation object to a CMAttachmentBearer object to store additional information. CMSetAttachment stores an attachment identified by a key. If the key doesn’t currently exist for the CMAttachmentBearer object when you call this function, the function adds the new attachment. If the key does exist, the function replaces the existing attachment. In both cases the function increments the retain count of the attachment. The value can be any CFType but a NULL value results in an error. Given a CVBuffer, CMSetAttachment is equivalent to CVBufferSetAttachment.

See Also

Processing Attachments