#[cfg(target_os = "macos")]
#[tokio::main]
async fn main() -> visual_cortex::Result<()> {
use visual_cortex::{FrameSource, ScapSource, Target};
let mut src = ScapSource::new(&Target::display(0), true)?;
println!("capturing 5 frames from display 0...");
for i in 0..5 {
let frame = src.capture_frame().await?;
println!(
"frame {i}: {}x{}, {} bytes",
frame.width(),
frame.height(),
frame.data().len()
);
}
println!("done");
Ok(())
}
#[cfg(not(target_os = "macos"))]
fn main() {
eprintln!(
"the mirror example requires macOS (ScreenCaptureKit); \
other platforms arrive in milestone 5."
);
}