use anyhow::Result; use sshcamera::v4l2::{Device as V4l2, Field}; use sshcamera::v4l2cairo::V4l2Cairo; use sshcamera::gtk; use gtk4::glib::ExitCode; fn main() -> Result{ let v = V4l2::open("/dev/video0")?; // TODO: It should be better. let c = v.captstream_builder()? .set_pixelformat("MJPG".into()) //.set_pixelformat("YUYV".into()) .set_field(Field::None) .build()?; assert!(["YUYV", "MJPG"].contains(&c.pixelformat().as_str())); assert!(c.field() == Field::None); let v2c = V4l2Cairo::new(c); gtk::main(v2c) }