You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a low FPS on my camera while using the crate, I think this may be the cause:
If .start() has not been called, calling the .next() method on an MMapStream queues all the buffers.
If .start() has been called it attempts to queue a single buffer.
Manually queuing the buffers at start can then cause an InvalidInput on the first call to .next() as it tries to re-queue the buffer.
Queues only a single buffer
let buffer_count = 4;let v4l2_device = v4l::Device::with_path("/dev/video0").expect("failed to open video");letmut stream = mmap::Stream::with_buffers(&v4l2_device,Type::VideoCapture, buffer_count).expect("failed to create stream");
stream.start().expect("failed to start stream");loop{let(_, meta) = stream.next().expect("failed to get image");println!("seq: {}, timestamp: {}", meta.sequence, meta.timestamp);}
Fails with InvalidInput
let buffer_count = 4;let v4l2_device = v4l::Device::with_path("/dev/video0").expect("failed to open video");letmut stream = mmap::Stream::with_buffers(&v4l2_device,Type::VideoCapture, buffer_count).expect("failed to create stream");for index in0..buffer_count asusize{
stream.queue(index).expect("failed to queue buffer");}
stream.start().expect("failed to start stream");loop{let(_, meta) = stream.next().expect("failed to get image");// <-- fails hereprintln!("seq: {}, timestamp: {}", meta.sequence, meta.timestamp);}
I believe creates expected behavior
let buffer_count = 4;let v4l2_device = v4l::Device::with_path("/dev/video0").expect("failed to open video");letmut stream = mmap::Stream::with_buffers(&v4l2_device,Type::VideoCapture, buffer_count).expect("failed to create stream");for index in1..buffer_count asusize{
stream.queue(index).expect("failed to queue buffer");}
stream.start().expect("failed to start stream");loop{let(_, meta) = stream.next().expect("failed to get image");println!("seq: {}, timestamp: {}", meta.sequence, meta.timestamp);}
The text was updated successfully, but these errors were encountered:
I noticed a low FPS on my camera while using the crate, I think this may be the cause:
If
.start()
has not been called, calling the.next()
method on anMMapStream
queues all the buffers.If
.start()
has been called it attempts to queue a single buffer.Manually queuing the buffers at start can then cause an
InvalidInput
on the first call to.next()
as it tries to re-queue the buffer.Queues only a single buffer
Fails with
InvalidInput
I believe creates expected behavior
The text was updated successfully, but these errors were encountered: