visual-cortex-capture 0.1.0

Screen-capture abstraction for visual-cortex: frames, regions, rates, the FrameSource trait, and the macOS ScreenCaptureKit backend.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use std::sync::Arc;

use crate::error::CaptureError;
use crate::frame::Frame;

/// A source of frames. The session's capture loop calls `capture_frame` at the
/// session's capture rate; implementations should return the freshest frame
/// available. Real backends (scap) arrive in a later milestone.
#[async_trait::async_trait]
pub trait FrameSource: Send + 'static {
    async fn capture_frame(&mut self) -> Result<Arc<Frame>, CaptureError>;
}