Trait vidi::pipelines::CameraImpl

source ·
pub trait CameraImpl: Send + Sync {
    // Required methods
    fn configure(&self, config: Config) -> Result<(), Error>;
    fn video_capture_device(&self) -> &Device;

    // Provided methods
    fn start(&self, buffer_count: usize) -> Result<Stream, Error> { ... }
    fn stream_manual(&self, buffer_count: usize) -> Result<StreamManual, Error> { ... }
}
Expand description

An exclusive handle to a mutable camera resource.

This is the main trait to fill in by camera vendors, defining all the low-level operations on the camera apart from acquiring.

Types implementing this impl are required to hold a system-wide exclusive lock over the hardware resource for as long as the instance exists. See ::util::flock::Locked. TODO: stop streaming when dropped? This is internal API, so maybe the owner type already takes care of stopping.

Required Methods§

source

fn configure(&self, config: Config) -> Result<(), Error>

Set configuration (TODO: the Config is nearly useless now)

source

fn video_capture_device(&self) -> &Device

Return the video capture device. Private interface

Provided Methods§

source

fn start(&self, buffer_count: usize) -> Result<Stream, Error>

Start streaming

source

fn stream_manual(&self, buffer_count: usize) -> Result<StreamManual, Error>

Create a stream with manual buffer control.

Implementors§