Struct libcamera::request::Request

source ·
pub struct Request { /* private fields */ }
Expand description

A camera capture request.

Capture requests are created by ActiveCamera::create_request() and scheduled for execution by ActiveCamera::queue_request(). Completed requests are returned by request completed callback (see ActiveCamera::on_request_completed()) and can (should) be reused by calling ActiveCamera::queue_request() again.

Implementations§

source§

impl Request

source

pub fn controls(&self) -> &ControlList

Returns an immutable reference of request controls.

See controls for available items.

source

pub fn controls_mut(&mut self) -> &mut ControlList

Returns a mutable reference of request controls.

See controls for available items.

source

pub fn metadata(&self) -> &ControlList

Returns request metadata, which contains information relevant to the request execution (i.e. capture timestamp).

See controls for available items.

source

pub fn add_buffer<T: AsFrameBuffer + Any>( &mut self, stream: &Stream, buffer: T, ) -> Result<()>

Attaches framebuffer to the request.

Buffers can only be attached once. To access framebuffer after executing request use Self::buffer() or Self::buffer_mut().

source

pub fn buffer<T: 'static>(&self, stream: &Stream) -> Option<&T>

Returns a reference to the buffer that was attached with Self::add_buffer().

T must be equal to the type used in Self::add_buffer(), otherwise this will return None.

source

pub fn buffer_mut<T: 'static>(&mut self, stream: &Stream) -> Option<&mut T>

Returns a mutable reference to the buffer that was attached with Self::add_buffer().

T must be equal to the type used in Self::add_buffer(), otherwise this will return None.

source

pub fn sequence(&self) -> u32

Returns auto-incrementing sequence number of the capture

source

pub fn cookie(&self) -> u64

Returns request identifier that was provided in ActiveCamera::create_request().

Returns zero if cookie was not provided.

source

pub fn status(&self) -> RequestStatus

Capture request status

source

pub fn reuse(&mut self, flags: ReuseFlag)

Reset the request for reuse.

Reset the status and controls associated with the request, to allow it to be reused and requeued without destruction. This function shall be called prior to queueing the request to the camera, in lieu of constructing a new request. The application can reuse the buffers that were previously added to the request via Self::add_buffer() by setting flags to ReuseFlag::REUSE_BUFFERS.

Trait Implementations§

source§

impl Debug for Request

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for Request

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for Request

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.