pub struct DmaBuf { /* private fields */ }Expand description
A Linux DMA-BUF surface with an on-demand exported descriptor.
Cloning this value retains the producer’s surface but opens no file
descriptor. export duplicates the descriptor only when a
consumer is ready to import it, avoiding one open fd for every buffered
frame. Dropping the last clone or DmaBufExport releases the producer’s
buffer.
Implementations§
Source§impl DmaBuf
impl DmaBuf
Sourcepub fn export(&self) -> Result<DmaBufExport>
pub fn export(&self) -> Result<DmaBufExport>
Wait for producer writes, then export the descriptor with its producer lease.
Sourcepub const fn height(&self) -> u32
pub const fn height(&self) -> u32
Visible height in pixels. As width, this is not the
allocated extent.
Sourcepub fn planes(&self) -> &[DmaBufPlane]
pub fn planes(&self) -> &[DmaBufPlane]
Plane offsets and row strides, in format order.
Sourcepub const fn color(&self) -> Option<Color>
pub const fn color(&self) -> Option<Color>
The color space of these samples where the producer named one.
None for the usual case of a producer that says nothing, which for YUV
pixels means the consumer falls back to Color::infer. Packed RGB
needs no answer at all.