visual_cortex_capture/source.rs
1use std::sync::Arc;
2
3use crate::error::CaptureError;
4use crate::frame::Frame;
5
6/// A source of frames. The session's capture loop calls `capture_frame` at the
7/// session's capture rate; implementations should return the freshest frame
8/// available. Real backends (scap) arrive in a later milestone.
9#[async_trait::async_trait]
10pub trait FrameSource: Send + 'static {
11 async fn capture_frame(&mut self) -> Result<Arc<Frame>, CaptureError>;
12}