How to get CVPixelBuffer attributes?

Viewed 92

I need to retrieve attributes dictionary from CVPixelBuffer. Printing a buffer object shows that the buffer has that dictionary:

(lldb) po imageBuffer
<CVPixelBuffer 0x282985fe0 width=886 height=1920 pixelFormat=420f iosurface=0x281a9def0 planes=2>
<Plane 0 width=886 height=1920 bytesPerRow=896>
<Plane 1 width=443 height=960 bytesPerRow=896>
<attributes={
    ExtendedPixelsBottom = 0;
    ExtendedPixelsLeft = 0;
    ExtendedPixelsRight = 10;
    ...
    };
} propagatedAttachments={
    ...
} nonPropagatedAttachments={
    ...
}>

iOS 15 has introduced a new method called CVPixelBufferCopyCreationAttributes that returns this attributes field.

Is it possible to achieve the same for the lower targets?

0 Answers
Related