Skip to main content

camera_stream/platform/macos/
mod.rs

1use crate::error::{Error, PlatformError};
2
3pub mod device;
4pub mod ext;
5pub mod frame;
6pub mod stream;
7
8/// Catch Objective-C exceptions and convert them to our Error type.
9fn catch_objc<R>(f: impl FnOnce() -> R + std::panic::UnwindSafe) -> Result<R, Error> {
10    objc2::exception::catch(f)
11        .map_err(|exception| Error::Platform(PlatformError::ObjCException(exception)))
12}