keyfork-qrcode: use userptr instead of mmap stream

This commit is contained in:
Ryan Heywood 2024-01-12 22:44:30 -05:00
parent 95a8cf6f9f
commit 6f34966518
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
use std::time::Duration;
use keyfork_qrcode::scan_camera;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let output = scan_camera(Duration::from_secs(60 * 10), 0)?;
if let Some(scanned_text) = output {
println!("{scanned_text}");
}
Ok(())
}

View File

@ -7,7 +7,7 @@ use std::{
};
use v4l::{
buffer::Type,
io::{mmap::Stream, traits::CaptureStream},
io::{userptr::Stream, traits::CaptureStream},
video::Capture,
Device, FourCC,
};