AsFrameBuffer

Trait AsFrameBuffer 

Source
pub trait AsFrameBuffer: Send {
    // Required method
    unsafe fn ptr(&self) -> NonNull<libcamera_framebuffer_t>;

    // Provided methods
    fn metadata(&self) -> Option<Immutable<FrameMetadataRef<'_>>> { ... }
    fn planes(&self) -> Immutable<FrameBufferPlanesRef<'_>> { ... }
    fn cookie(&self) -> u64 { ... }
    fn set_cookie(&self, cookie: u64) { ... }
    fn release_fence(&self) -> Option<Fence> { ... }
    fn request(&self) -> Option<RequestRef<'_>> { ... }
}

Required Methods§

Source

unsafe fn ptr(&self) -> NonNull<libcamera_framebuffer_t>

Returns raw framebuffer used by libcamera.

It is expected that metadata status field is initialized with u32::MAX on a new buffer, which indicates that metadata is not yet available. This “hackfix” prevents read of uninitialized data in Self::metadata().

§Safety

This function must return a valid instance of libcamera::FrameBuffer.

Provided Methods§

Source

fn metadata(&self) -> Option<Immutable<FrameMetadataRef<'_>>>

Returns framebuffer metadata information.

Only available after associated Request has completed.

Source

fn planes(&self) -> Immutable<FrameBufferPlanesRef<'_>>

Provides access to framebuffer data by exposing file descriptors, offsets and lengths of the planes.

Source

fn cookie(&self) -> u64

User cookie associated with the buffer.

Set user cookie associated with the buffer.

Source

fn release_fence(&self) -> Option<Fence>

Releases the acquire fence associated with this framebuffer, if any.

Ownership of the fence is transferred to the caller.

Source

fn request(&self) -> Option<RequestRef<'_>>

Returns a non-owning view of the Request owning this framebuffer, if any.

Implementors§