rscam 0.3.9

Wrapper for v4l2.
docs.rs failed to build rscam-0.3.9
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rscam-0.5.5

rscam

Rust wrapper for v4l2.

let mut camera = rscam::new("/dev/video0").unwrap();

camera.start(&rscam::Config {
    interval: (1, 30),      // 30 fps.
    resolution: (1280, 720),
    format: b"MJPG",
    ..Default::default()
}).unwrap();

for i in 0..10 {
    let frame = camera.capture().unwrap();
    let mut file = fs::File::create(&format!("frame-{}.jpg", i)).unwrap();
    file.write_all(frame.data).unwrap();
}

Default feature use_wrapper enables the v4l2 wrapper (e.g. v4l2_ioctl() instead of ioctl()). In this case, there is dependence on libv4l2.