[−][src]Struct v4l::device::Device
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]
pub fn set_control(&self, id: u32, val: Control) -> Result<()>
[src]
Trait Implementations
impl Capture for Device
[src]
pub fn enum_frameintervals(
&self,
fourcc: FourCC,
width: u32,
height: u32
) -> Result<Vec<FrameInterval>>
[src]
&self,
fourcc: FourCC,
width: u32,
height: u32
) -> Result<Vec<FrameInterval>>
pub fn enum_framesizes(&self, fourcc: FourCC) -> Result<Vec<FrameSize>>
[src]
pub fn enum_formats(&self) -> Result<Vec<FormatDescription>>
[src]
pub fn format(&self) -> Result<Format>
[src]
pub fn set_format(&self, fmt: &Format) -> Result<Format>
[src]
pub fn params(&self) -> Result<Parameters>
[src]
pub fn set_params(&self, params: &Parameters) -> Result<Parameters>
[src]
impl Output for Device
[src]
pub fn enum_frameintervals(
&self,
fourcc: FourCC,
width: u32,
height: u32
) -> Result<Vec<FrameInterval>>
[src]
&self,
fourcc: FourCC,
width: u32,
height: u32
) -> Result<Vec<FrameInterval>>
pub fn enum_framesizes(&self, fourcc: FourCC) -> Result<Vec<FrameSize>>
[src]
pub fn enum_formats(&self) -> Result<Vec<FormatDescription>>
[src]
pub fn format(&self) -> Result<Format>
[src]
pub fn set_format(&self, fmt: &Format) -> Result<Format>
[src]
pub fn params(&self) -> Result<Parameters>
[src]
pub fn set_params(&self, params: &Parameters) -> Result<Parameters>
[src]
impl Read for Device
[src]
pub fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn read_vectored(
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>
1.36.0[src]
&mut self,
bufs: &mut [IoSliceMut<'_>]
) -> Result<usize, Error>
pub fn is_read_vectored(&self) -> bool
[src]
pub unsafe fn initializer(&self) -> Initializer
[src]
pub fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]
pub fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
pub fn bytes(self) -> Bytes<Self>
1.0.0[src]
pub fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
pub fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl Write for Device
[src]
pub fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
pub fn flush(&mut self) -> Result<()>
[src]
pub fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>
1.36.0[src]
pub fn is_write_vectored(&self) -> bool
[src]
pub fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
pub fn write_all_vectored(
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
[src]
&mut self,
bufs: &mut [IoSlice<'_>]
) -> Result<(), Error>
pub fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
pub fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for Device
[src]
impl Send for Device
[src]
impl Sync for Device
[src]
impl Unpin for Device
[src]
impl UnwindSafe for Device
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,