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
use crate::error::{Error, PlatformError};

pub mod device;
pub mod ext;
pub mod frame;
pub mod stream;

/// Catch Objective-C exceptions and convert them to our Error type.
fn catch_objc<R>(f: impl FnOnce() -> R + std::panic::UnwindSafe) -> Result<R, Error> {
    objc2::exception::catch(f)
        .map_err(|exception| Error::Platform(PlatformError::ObjCException(exception)))
}