pub trait VideoBackend: Send {
// Required methods
fn info(&self) -> BackendInfo;
fn start(&mut self) -> Result<()>;
fn stop(&mut self) -> Result<()>;
fn next_event(&mut self, timeout: Option<Duration>) -> Result<CaptureEvent>;
}Expand description
A platform video capture implementation.
Contract: next_event returns PinrayError::Timeout when no event
arrives within timeout (None = block forever), and must treat
Some(Duration::ZERO) as a non-blocking poll. start/stop must be
safe to call repeatedly and in either state.
Required Methods§
fn info(&self) -> BackendInfo
fn start(&mut self) -> Result<()>
fn stop(&mut self) -> Result<()>
fn next_event(&mut self, timeout: Option<Duration>) -> Result<CaptureEvent>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".