Skip to main content

capture_frame

Function capture_frame 

Source
pub fn capture_frame(
    unique_id: &str,
    timeout: Duration,
) -> Result<Frame, CaptureError>
Expand description

Capture a single frame from the camera with unique_id, at the camera’s native resolution.

A partially-filled MJPEG buffer (a dropped USB packet) fails to decode, so this keeps reading until one decodes or timeout elapses. The caller’s whole budget is given to the dequeue, since the first frame carries the stream start-up cost described on [STREAM_TIMEOUT] — and more of it at full resolution, where the sensor has more to read out per frame.

§Errors

CaptureError::NotFound when no camera matches, CaptureError::AccessDenied without permission on the node, CaptureError::Timeout when no frame decodes in time.