pub struct Stream<'a> { /* private fields */ }
Expand description
Stream of mapped buffers
An arena instance is used internally for buffer handling.
Implementations§
source§impl<'a> Stream<'a>
impl<'a> Stream<'a>
sourcepub fn new(dev: &Device, buf_type: Type) -> Result<Self>
pub fn new(dev: &Device, buf_type: Type) -> Result<Self>
Returns a stream for frame capturing
§Arguments
dev
- Capture device ref to get its file descriptorbuf_type
- Type of the buffers
§Example
use v4l::buffer::Type;
use v4l::device::Device;
use v4l::io::mmap::Stream;
let dev = Device::new(0);
if let Ok(dev) = dev {
let stream = Stream::new(&dev, Type::VideoCapture);
}
pub fn with_buffers( dev: &Device, buf_type: Type, buf_count: u32, ) -> Result<Self>
sourcepub fn set_timeout(&mut self, duration: Duration)
pub fn set_timeout(&mut self, duration: Duration)
Sets a timeout of the v4l file handle.
sourcepub fn clear_timeout(&mut self)
pub fn clear_timeout(&mut self)
Clears the timeout of the v4l file handle.
Trait Implementations§
source§impl<'a, 'b> CaptureStream<'b> for Stream<'a>
impl<'a, 'b> CaptureStream<'b> for Stream<'a>
Auto Trait Implementations§
impl<'a> Freeze for Stream<'a>
impl<'a> RefUnwindSafe for Stream<'a>
impl<'a> Send for Stream<'a>
impl<'a> Sync for Stream<'a>
impl<'a> Unpin for Stream<'a>
impl<'a> !UnwindSafe for Stream<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more