camera-stream 0.5.0

A cross-platform library for streaming frames from cameras, initially supporting only macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::frame::Frame;

/// Callback-based frame delivery.
pub trait CameraStream {
    type Frame<'a>: Frame
    where
        Self: 'a;
    type Error: core::error::Error;

    /// Start streaming. Callback is invoked on a platform thread for each frame.
    fn start<F>(&mut self, callback: F) -> Result<(), Self::Error>
    where
        F: FnMut(&Self::Frame<'_>) + Send + 'static;

    fn stop(&mut self) -> Result<(), Self::Error>;
}