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
impl Request
sourcepub fn controls(&self) -> &ControlList
pub fn controls(&self) -> &ControlList
Returns an immutable reference of request controls.
See controls for available items.
sourcepub fn controls_mut(&mut self) -> &mut ControlList
pub fn controls_mut(&mut self) -> &mut ControlList
Returns a mutable reference of request controls.
See controls for available items.
sourcepub fn metadata(&self) -> &ControlList
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.
sourcepub fn add_buffer<T: AsFrameBuffer + Any>(
&mut self,
stream: &Stream,
buffer: T,
) -> Result<()>
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().
sourcepub fn buffer<T: 'static>(&self, stream: &Stream) -> Option<&T>
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.
sourcepub fn buffer_mut<T: 'static>(&mut self, stream: &Stream) -> Option<&mut T>
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.
Returns request identifier that was provided in ActiveCamera::create_request().
Returns zero if cookie was not provided.
sourcepub fn status(&self) -> RequestStatus
pub fn status(&self) -> RequestStatus
Capture request status
sourcepub fn reuse(&mut self, flags: ReuseFlag)
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.