8000 Pushing a frame to a vector causing unbounded blocking · Issue #27 · loyd/rscam · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Pushing a frame to a vector causing unbounded blocking #27
Open
@seanybaggins

Description

@seanybaggins

I want to create a vector of 10 frames. The following code will block.

fn main() {
    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();

    let mut vec = Vec::with_capacity(10);

    for i in 0..vec.capacity() {
        let frame = camera.capture().unwrap();
        vec.push(frame);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0