[][src]Struct v4l::device::Device

pub struct Device { /* fields omitted */ }

Linux capture device abstraction

Implementations

impl Device[src]

pub fn new(index: usize) -> Result<Self>[src]

Returns a capture device by index

Devices are usually enumerated by the system. An index of zero thus represents the first device the system got to know about.

Arguments

  • index - Index (0: first, 1: second, ..)

Example

use v4l::device::Device;
let dev = Device::new(0);

pub fn with_path<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Returns a capture device by path

Linux device nodes are usually found in /dev/videoX or /sys/class/video4linux/videoX.

Arguments

  • path - Path (e.g. "/dev/video0")

Example

use v4l::device::Device;
let dev = Device::with_path("/dev/video0");

pub fn handle(&self) -> Arc<Handle>[src]

Returns the raw device handle

pub fn query_caps(&self) -> Result<Capabilities>[src]

Returns video4linux framework defined information such as card, driver, etc.

pub fn query_controls(&self) -> Result<Vec<Description>>[src]

Returns the supported controls for a device such as gain, focus, white balance, etc.

pub fn control(&self, id: u32) -> Result<Control>[src]

Returns the control value for an ID

Arguments

  • id - Control identifier

pub fn set_control(&self, id: u32, val: Control) -> Result<()>[src]

Modifies the control value

Arguments

  • id - Control identifier
  • val - New value

Trait Implementations

impl Capture for Device[src]

impl Output for Device[src]

impl Read for Device[src]

impl Write for Device[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.