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§
Sourceunsafe fn ptr(&self) -> NonNull<libcamera_framebuffer_t>
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§
Sourcefn metadata(&self) -> Option<Immutable<FrameMetadataRef<'_>>>
fn metadata(&self) -> Option<Immutable<FrameMetadataRef<'_>>>
Returns framebuffer metadata information.
Only available after associated Request has completed.
Sourcefn planes(&self) -> Immutable<FrameBufferPlanesRef<'_>>
fn planes(&self) -> Immutable<FrameBufferPlanesRef<'_>>
Provides access to framebuffer data by exposing file descriptors, offsets and lengths of the planes.
User cookie associated with the buffer.
Set user cookie associated with the buffer.
Sourcefn release_fence(&self) -> Option<Fence>
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.
Sourcefn request(&self) -> Option<RequestRef<'_>>
fn request(&self) -> Option<RequestRef<'_>>
Returns a non-owning view of the Request owning this framebuffer, if any.