pub trait Capture {
// Required methods
fn enum_frameintervals(
&self,
fourcc: FourCC,
width: u32,
height: u32,
) -> Result<Vec<FrameInterval>>;
fn enum_framesizes(&self, fourcc: FourCC) -> Result<Vec<FrameSize>>;
fn enum_formats(&self) -> Result<Vec<FormatDescription>>;
fn format(&self) -> Result<Format>;
fn set_format(&self, fmt: &Format) -> Result<Format>;
fn params(&self) -> Result<CaptureParameters>;
fn set_params(
&self,
params: &CaptureParameters,
) -> Result<CaptureParameters>;
}
Expand description
Capture device protocol
Required Methods§
sourcefn enum_frameintervals(
&self,
fourcc: FourCC,
width: u32,
height: u32,
) -> Result<Vec<FrameInterval>>
fn enum_frameintervals( &self, fourcc: FourCC, width: u32, height: u32, ) -> Result<Vec<FrameInterval>>
Returns a vector of all frame intervals that the device supports for the given pixel format and frame size
sourcefn enum_framesizes(&self, fourcc: FourCC) -> Result<Vec<FrameSize>>
fn enum_framesizes(&self, fourcc: FourCC) -> Result<Vec<FrameSize>>
Returns a vector of valid framesizes that the device supports for the given pixel format
sourcefn enum_formats(&self) -> Result<Vec<FormatDescription>>
fn enum_formats(&self) -> Result<Vec<FormatDescription>>
Returns a vector of valid formats for this device
The “emulated” field describes formats filled in by libv4lconvert. There may be a conversion related performance penalty when using them.
sourcefn set_format(&self, fmt: &Format) -> Result<Format>
fn set_format(&self, fmt: &Format) -> Result<Format>
Modifies the capture format and returns the actual format
The driver tries to match the format parameters on a best effort basis. Thus, if the combination of format properties cannot be achieved, the closest possible settings are used and reported back.
§Arguments
fmt
- Desired format
sourcefn params(&self) -> Result<CaptureParameters>
fn params(&self) -> Result<CaptureParameters>
Returns the parameters currently in use
sourcefn set_params(&self, params: &CaptureParameters) -> Result<CaptureParameters>
fn set_params(&self, params: &CaptureParameters) -> Result<CaptureParameters>
Modifies the capture parameters and returns the actual parameters
§Arguments
params
- Desired parameters