pub trait VideoStream: Send {
// Required methods
fn read_frame(&mut self) -> Result<CapturedFrame, VideoCaptureError>;
fn fps(&self) -> Result<f64, VideoCaptureError>;
fn seek_to_start(&mut self) -> Result<(), VideoCaptureError>;
}Expand description
An open video stream producing frames on demand.
Required Methods§
Sourcefn read_frame(&mut self) -> Result<CapturedFrame, VideoCaptureError>
fn read_frame(&mut self) -> Result<CapturedFrame, VideoCaptureError>
Reads the next frame. Returns
VideoCaptureError::EndOfStream when the stream is exhausted.
Sourcefn fps(&self) -> Result<f64, VideoCaptureError>
fn fps(&self) -> Result<f64, VideoCaptureError>
Frames-per-second as reported by the backend.
Sourcefn seek_to_start(&mut self) -> Result<(), VideoCaptureError>
fn seek_to_start(&mut self) -> Result<(), VideoCaptureError>
Rewind the stream so the next Self::read_frame returns the first frame.