use adamo::{Protocol, Robot, detect_encoder};
fn main() -> adamo::Result<()> {
let api_key = std::env::var("ADAMO_API_KEY").expect("set ADAMO_API_KEY");
let name = std::env::var("ADAMO_ROBOT_NAME").unwrap_or_else(|_| "macbook".into());
println!("detected encoder: {}", detect_encoder()?);
let mut robot = Robot::new(&api_key, Some(&name), Protocol::Quic)?;
robot.attach_v4l2("webcam", "", 1280, 720, 30, 2000)?;
println!("streaming `webcam` 1280x720@30 (2000 kbps) — robot name: {name}");
println!("subscribe from the frontend to view.");
robot.run()
}