v4l::video::traits

Trait Output

Source
pub trait Output {
    // Required methods
    fn enum_frameintervals(
        &self,
        fourcc: FourCC,
        width: u32,
        height: u32,
    ) -> (Vec<FrameInterval>, Result<()>);
    fn enum_framesizes(&self, fourcc: FourCC) -> (Vec<FrameSize>, Result<()>);
    fn enum_formats_mbus_code(
        &self,
        mbus_code: __u32,
    ) -> (Vec<FormatDescription>, Result<()>);
    fn format(&self) -> Result<Format>;
    fn set_format(&self, fmt: &Format) -> Result<Format>;
    fn params(&self) -> Result<OutputParameters>;
    fn set_params(&self, params: &OutputParameters) -> Result<OutputParameters>;

    // Provided method
    fn enum_formats(&self) -> (Vec<FormatDescription>, Result<()>) { ... }
}
Expand description

Output device protocol

Required Methods§

Source

fn enum_frameintervals( &self, fourcc: FourCC, width: u32, height: u32, ) -> (Vec<FrameInterval>, Result<()>)

Returns a vector of all frame intervals that the device supports for the given pixel format and frame size

Source

fn enum_framesizes(&self, fourcc: FourCC) -> (Vec<FrameSize>, Result<()>)

Returns a vector of valid framesizes that the device supports for the given pixel format

Source

fn enum_formats_mbus_code( &self, mbus_code: __u32, ) -> (Vec<FormatDescription>, Result<()>)

Returns a vector of valid formats for this device for the given mbus code. FIXME: Passing anything else than 0 on non-MC devices (by capability flag IO_MC is in violation of the kernel protocol

Source

fn format(&self) -> Result<Format>

Returns the format currently in use

Source

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
Source

fn params(&self) -> Result<OutputParameters>

Returns the parameters currently in use

Source

fn set_params(&self, params: &OutputParameters) -> Result<OutputParameters>

Modifies the output parameters and returns the actual parameters

§Arguments
  • params - Desired parameters

Provided Methods§

Source

fn enum_formats(&self) -> (Vec<FormatDescription>, Result<()>)

Returns a vector of valid formats for this device

Implementors§