Contents

replacementEmbeddedThumbnailPixelBuffer(withPhotoFormat:for:)

A callback in which you can provide a replacement embedded thumbnail image with compression settings, or strip the existing embedded thumbnail image from the flattened file.

Declaration

optional func replacementEmbeddedThumbnailPixelBuffer(withPhotoFormat replacementEmbeddedThumbnailPhotoFormatOut: AutoreleasingUnsafeMutablePointer<NSDictionary?>, for photo: AVCapturePhoto) -> Unmanaged<CVPixelBuffer>?

Parameters

  • replacementEmbeddedThumbnailPhotoFormatOut:

    A pointer to a dictionary of keys and values from AVFoundation/AVVideoSettings.h. If you pass a non-nil dictionary, Avvideocodeckey is required, with width and height keys optional.

  • photo:

    The calling instance of Avcapturephoto whose file metadata you’re modifying.

Return Value

A pixel buffer containing a source image to be encoded to the file as the replacement thumbnail image. To preserve the existing embedded thumbnail photo to the flattened data, set replacementEmbeddedThumbnailPhotoFormatOut to photo.embeddedThumbnailPhotoFormat and return nil. To replace the existing embedded thumbnail, pass a replacement photo format dictionary and return a non-nil replacement pixel buffer. To remove the existing embedded thumbnail, set replacementEmbeddedThumbnailPhotoFormatOut to nil and return nil.

Discussion

This callback is optional. If your delegate doesn’t implement this callback, the existing metadata in the in-memory AVCapturePhoto container is written directly to the file data representation.

See Also

Replacing or removing metadata