diff --git a/Cargo.lock b/Cargo.lock index 8f6f131..ce6b670 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,9 +382,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.79" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ "proc-macro2", "quote", @@ -399,18 +399,18 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ "proc-macro2", "quote", @@ -447,7 +447,7 @@ dependencies = [ [[package]] name = "windows-capture" -version = "1.4.0" +version = "1.4.1" dependencies = [ "clap", "ctrlc", @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "windows-capture-python" -version = "1.4.0" +version = "1.4.1" dependencies = [ "pyo3", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 27af43a..28efa06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture" -version = "1.4.0" +version = "1.4.1" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Rust 🔥" @@ -52,7 +52,7 @@ parking_lot = "0.12.3" rayon = "1.10.0" # Error handling -thiserror = "1.0.65" +thiserror = "1.0.66" clap = { version = "4.5.20", features = ["derive"] } ctrlc = "3.4.5" diff --git a/README.md b/README.md index 10d655d..589d5b0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Add this dependency to your `Cargo.toml`: ```toml [dependencies] -windows-capture = "1.4.0" +windows-capture = "1.4.1" ``` or run this command diff --git a/examples/basic.rs b/examples/basic.rs index e6cc185..464d458 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -12,7 +12,7 @@ use windows_capture::{ settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, }; -// This struct will be used to handle the capture events. +// Handles capture events. struct Capture { // The video encoder that will be used to encode the frames. encoder: Option, @@ -24,12 +24,12 @@ impl GraphicsCaptureApiHandler for Capture { // The type of flags used to get the values from the settings. type Flags = String; - // The type of error that can occur during capture, the error will be returned from `CaptureControl` and `start` functions. + // The type of error that can be returned from `CaptureControl` and `start` functions. type Error = Box; - // Function that will be called to create the struct. The flags can be passed from settings. + // Function that will be called to create a new instance. The flags can be passed from settings. fn new(ctx: Context) -> Result { - println!("Got The Flag: {}", ctx.flags); + println!("Created with Flags: {}", ctx.flags); let encoder = VideoEncoder::new( VideoSettingsBuilder::new(1920, 1080), @@ -59,7 +59,7 @@ impl GraphicsCaptureApiHandler for Capture { // Send the frame to the video encoder self.encoder.as_mut().unwrap().send_frame(frame)?; - // Note: The frame has other uses too for example you can save a single for to a file like this: + // Note: The frame has other uses too, for example, you can save a single frame to a file, like this: // frame.save_as_image("frame.png", ImageFormat::Png)?; // Or get the raw data like this so you have full control: // let data = frame.buffer()?; @@ -80,30 +80,30 @@ impl GraphicsCaptureApiHandler for Capture { // Optional handler called when the capture item (usually a window) closes. fn on_closed(&mut self) -> Result<(), Self::Error> { - println!("Capture Session Closed"); + println!("Capture session ended"); Ok(()) } } fn main() { - // Gets The Foreground Window, Checkout The Docs For Other Capture Items + // Gets the foreground window, refer to the docs for other capture items let primary_monitor = Monitor::primary().expect("There is no primary monitor"); let settings = Settings::new( - // Item To Captue + // Item to capture primary_monitor, - // Capture Cursor Settings + // Capture cursor settings CursorCaptureSettings::Default, - // Draw Borders Settings + // Draw border settings DrawBorderSettings::Default, // The desired color format for the captured frame. ColorFormat::Rgba8, // Additional flags for the capture settings that will be passed to user defined `new` function. - "Yea This Works".to_string(), + "Yea this works".to_string(), ); // Starts the capture and takes control of the current thread. // The errors from handler trait will end up here - Capture::start(settings).expect("Screen Capture Failed"); + Capture::start(settings).expect("Screen capture failed"); } diff --git a/src/lib.rs b/src/lib.rs index 979e61d..23ec879 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ //! //! ```toml //! [dependencies] -//! windows-capture = "1.4.0" +//! windows-capture = "1.4.1" //! ``` //! or run this command //! @@ -47,7 +47,7 @@ //! settings::{ColorFormat, CursorCaptureSettings, DrawBorderSettings, Settings}, //! }; //! -//! // This struct will be used to handle the capture events. +//! // Handles capture events. //! struct Capture { //! // The video encoder that will be used to encode the frames. //! encoder: Option, @@ -59,12 +59,12 @@ //! // The type of flags used to get the values from the settings. //! type Flags = String; //! -//! // The type of error that can occur during capture, the error will be returned from `CaptureControl` and `start` functions. +//! // The type of error that can be returned from `CaptureControl` and `start` functions. //! type Error = Box; //! -//! // Function that will be called to create the struct. The flags can be passed from settings. +//! // Function that will be called to create a new instance. The flags can be passed from settings. //! fn new(ctx: Context) -> Result { -//! println!("Got The Flag: {}", ctx.flags); +//! println!("Created with Flags: {}", ctx.flags); //! //! let encoder = VideoEncoder::new( //! VideoSettingsBuilder::new(1920, 1080), @@ -94,7 +94,7 @@ //! // Send the frame to the video encoder //! self.encoder.as_mut().unwrap().send_frame(frame)?; //! -//! // Note: The frame has other uses too for example you can save a single for to a file like this: +//! // Note: The frame has other uses too, for example, you can save a single frame to a file, like this: //! // frame.save_as_image("frame.png", ImageFormat::Png)?; //! // Or get the raw data like this so you have full control: //! // let data = frame.buffer()?; @@ -115,31 +115,33 @@ //! //! // Optional handler called when the capture item (usually a window) closes. //! fn on_closed(&mut self) -> Result<(), Self::Error> { -//! println!("Capture Session Closed"); +//! println!("Capture session ended"); //! //! Ok(()) //! } //! } //! -//! // Gets The Foreground Window, Checkout The Docs For Other Capture Items -//! let primary_monitor = Monitor::primary().expect("There is no primary monitor"); -//! -//! let settings = Settings::new( -//! // Item To Captue -//! primary_monitor, -//! // Capture Cursor Settings -//! CursorCaptureSettings::Default, -//! // Draw Borders Settings -//! DrawBorderSettings::Default, -//! // The desired color format for the captured frame. -//! ColorFormat::Rgba8, -//! // Additional flags for the capture settings that will be passed to user defined `new` function. -//! "Yea This Works".to_string(), -//! ); -//! -//! // Starts the capture and takes control of the current thread. -//! // The errors from handler trait will end up here -//! Capture::start(settings).expect("Screen Capture Failed"); +//! fn main() { +//! // Gets the foreground window, refer to the docs for other capture items +//! let primary_monitor = Monitor::primary().expect("There is no primary monitor"); +//! +//! let settings = Settings::new( +//! // Item to capture +//! primary_monitor, +//! // Capture cursor settings +//! CursorCaptureSettings::Default, +//! // Draw border settings +//! DrawBorderSettings::Default, +//! // The desired color format for the captured frame. +//! ColorFormat::Rgba8, +//! // Additional flags for the capture settings that will be passed to user defined `new` function. +//! "Yea this works".to_string(), +//! ); +//! +//! // Starts the capture and takes control of the current thread. +//! // The errors from handler trait will end up here +//! Capture::start(settings).expect("Screen capture failed"); +//! } //! ``` #![warn(clippy::nursery)] #![warn(clippy::cargo)] diff --git a/windows-capture-python/Cargo.toml b/windows-capture-python/Cargo.toml index 5aa9d61..9497ae5 100644 --- a/windows-capture-python/Cargo.toml +++ b/windows-capture-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture-python" -version = "1.4.0" +version = "1.4.1" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Python 🔥" @@ -27,5 +27,5 @@ pyo3 = { version = "0.22.5", features = [ "abi3", "abi3-py39", ] } -thiserror = "1.0.65" +thiserror = "1.0.66" windows-capture = { path = ".." } diff --git a/windows-capture-python/pyproject.toml b/windows-capture-python/pyproject.toml index 377e1df..24821dc 100644 --- a/windows-capture-python/pyproject.toml +++ b/windows-capture-python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "windows-capture" -version = "1.4.0" +version = "1.4.1" description = "Fastest Windows Screen Capture Library For Python 🔥" readme = "README-Python.md" requires-python = ">=3.9"