import

abstract fun import(fd: Int, width: Int, height: Int, fourcc: Int, offset: Int, pitch: Int, modifier: Long): ColorBuffer?(source)

Returns a color buffer that samples a single plane DMA-BUF image of width x height pixels in the DRM format fourcc, stored at offset in the DMA-BUF fd with rows of pitch bytes. modifier is the DRM format modifier of the DMA-BUF, or DRM_FORMAT_MOD_INVALID when it is not known.

Supported are the formats R8, and GR88 and RG88, imported with ColorFormat.R and ColorFormat.RG and ColorType.UINT8, and R16, and GR1616 and RG1616, imported with ColorFormat.R and ColorFormat.RG and ColorType.UINT16. These are the formats of the luma and chroma planes of NV12 and P010 frames.

The importer does not take ownership of fd, it can be closed once this function returns. The contents of the color buffer are the current contents of the DMA-BUF.

Return

the color buffer, or null when the plane can not be imported