Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

1.4 KB
Raw Blame
fn main() {
    #[cfg(windows)]
    windows::main();
}

#[cfg(windows)]
mod windows {
    use scap_targets::*;
    use std::time::Duration;

    pub fn main() {
        let display = Display::primary();
        let _display = display.raw_handle();

        // let mut capturer = Capturer::new(
        //     display.try_as_capture_item().unwrap(),
        //     Settings {
        //         is_border_required: Some(false),
        //         is_cursor_capture_enabled: Some(true),
        //         pixel_format: PixelFormat::R8G8B8A8Unorm,
        //         // crop: Some(D3D11_BOX {
        //         //     left: 0,
        //         //     top: 0,
        //         //     right: 500,
        //         //     bottom: 400,
        //         //     front: 0,
        //         //     back: 1,
        //         // }),
        //         ..Default::default()
        //     },
        // )
        // .unwrap();

        // capturer
        //     .start(
        //         |frame| {
        //             dbg!(&frame);

        //             let ff_frame = frame.as_ffmpeg()?;
        //             dbg!(ff_frame.width(), ff_frame.height(), ff_frame.format());

        //             Ok(())
        //         },
        //         || Ok(()),
        //     )
        //     .unwrap();

        std::thread::sleep(Duration::from_secs(3));

        // capturer.stop().unwrap();

        std::thread::sleep(Duration::from_secs(3));
    }
}