pub trait CaptureSession {
// Required methods
fn format(&self) -> CameraFormat;
fn state(&self) -> CaptureState;
fn changed(&self) -> MediaChangeFuture;
fn take_photo(&self) -> PhotoFuture;
fn start_recording(&self, path: PathBuf) -> RecordingFuture;
fn stop_recording(&self);
}Expand description
A camera running for the app, controlled on the app’s main thread. Dropped, it stops for the app: its preview leaves the layer it showed on, and its reader reads nothing more.
Required Methods§
Sourcefn format(&self) -> CameraFormat
fn format(&self) -> CameraFormat
The format it runs in: the one picked, unless it joined the format the camera ran in for another session.
Sourcefn state(&self) -> CaptureState
fn state(&self) -> CaptureState
The session’s state now.
Sourcefn changed(&self) -> MediaChangeFuture
fn changed(&self) -> MediaChangeFuture
Resolves once state may answer something else than when this was
called, or once the session is gone.
Sourcefn take_photo(&self) -> PhotoFuture
fn take_photo(&self) -> PhotoFuture
Takes a photo while the session runs with photos among its outputs, answering it once the system has encoded it.
Sourcefn start_recording(&self, path: PathBuf) -> RecordingFuture
fn start_recording(&self, path: PathBuf) -> RecordingFuture
Records to a new file at path, as a QuickTime movie, while the session runs with movies
among its outputs, until stop_recording; answers once the file is
written whole, or why it was not.
Sourcefn stop_recording(&self)
fn stop_recording(&self)
Ends the recording, whose future then answers.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".