keyfork-qrcode: use userptr instead of mmap stream
This commit is contained in:
parent
95a8cf6f9f
commit
6f34966518
|
@ -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(())
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ use std::{
|
||||||
};
|
};
|
||||||
use v4l::{
|
use v4l::{
|
||||||
buffer::Type,
|
buffer::Type,
|
||||||
io::{mmap::Stream, traits::CaptureStream},
|
io::{userptr::Stream, traits::CaptureStream},
|
||||||
video::Capture,
|
video::Capture,
|
||||||
Device, FourCC,
|
Device, FourCC,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue