From 6853d4f1e29460659b59724dcc1afc661a40a803 Mon Sep 17 00:00:00 2001 From: NiiightmareXD Date: Thu, 8 Aug 2024 12:39:42 +0330 Subject: [PATCH] =?UTF-8?q?Add=20audio=20to=20encoder=20=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- README.md | 6 +++--- examples/basic.rs | 4 ++-- src/encoder.rs | 10 +++++----- src/lib.rs | 6 +++--- windows-capture-python/Cargo.toml | 2 +- windows-capture-python/pyproject.toml | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10bac97..8355968 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,7 +306,7 @@ dependencies = [ [[package]] name = "windows-capture" -version = "1.3.2" +version = "1.3.5" dependencies = [ "parking_lot", "rayon", @@ -316,7 +316,7 @@ dependencies = [ [[package]] name = "windows-capture-python" -version = "1.3.2" +version = "1.3.5" dependencies = [ "pyo3", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index baf5520..14457b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture" -version = "1.3.2" +version = "1.3.5" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Rust 🔥" diff --git a/README.md b/README.md index b53181b..3070f4a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Add this library to your `Cargo.toml`: ```toml [dependencies] -windows-capture = "1.3.2" +windows-capture = "1.3.5" ``` or run this command @@ -44,7 +44,7 @@ use std::{ use windows_capture::{ capture::GraphicsCaptureApiHandler, - encoder::{AudioSettingBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, + encoder::{AudioSettingsBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, frame::Frame, graphics_capture_api::InternalCaptureControl, monitor::Monitor, @@ -72,7 +72,7 @@ impl GraphicsCaptureApiHandler for Capture { let encoder = VideoEncoder::new( VideoSettingsBuilder::new(1920, 1080), - AudioSettingBuilder::default().disabled(true), + AudioSettingsBuilder::default().disabled(true), ContainerSettingsBuilder::default(), "video.mp4", )?; diff --git a/examples/basic.rs b/examples/basic.rs index fd0539d..7909692 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -5,7 +5,7 @@ use std::{ use windows_capture::{ capture::GraphicsCaptureApiHandler, - encoder::{AudioSettingBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, + encoder::{AudioSettingsBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, frame::Frame, graphics_capture_api::InternalCaptureControl, monitor::Monitor, @@ -33,7 +33,7 @@ impl GraphicsCaptureApiHandler for Capture { let encoder = VideoEncoder::new( VideoSettingsBuilder::new(1920, 1080), - AudioSettingBuilder::default().disabled(true), + AudioSettingsBuilder::default().disabled(true), ContainerSettingsBuilder::default(), "video.mp4", )?; diff --git a/src/encoder.rs b/src/encoder.rs index bcc917c..900bbf8 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -254,7 +254,7 @@ impl VideoSettingsBuilder { } /// The `AudioSettingsSubType` enum represents the settings for the audio encoder. -pub struct AudioSettingBuilder { +pub struct AudioSettingsBuilder { bitrate: u32, channel_count: u32, sample_rate: u32, @@ -263,7 +263,7 @@ pub struct AudioSettingBuilder { disabled: bool, } -impl AudioSettingBuilder { +impl AudioSettingsBuilder { pub const fn new() -> Self { Self { bitrate: 192000, @@ -316,7 +316,7 @@ impl AudioSettingBuilder { } } -impl Default for AudioSettingBuilder { +impl Default for AudioSettingsBuilder { fn default() -> Self { Self::new() } @@ -534,7 +534,7 @@ impl VideoEncoder { #[inline] pub fn new>( video_settings: VideoSettingsBuilder, - audio_settings: AudioSettingBuilder, + audio_settings: AudioSettingsBuilder, container_settings: ContainerSettingsBuilder, path: P, ) -> Result { @@ -762,7 +762,7 @@ impl VideoEncoder { #[inline] pub fn new_from_stream>( video_settings: VideoSettingsBuilder, - audio_settings: AudioSettingBuilder, + audio_settings: AudioSettingsBuilder, container_settings: ContainerSettingsBuilder, stream: IRandomAccessStream, ) -> Result { diff --git a/src/lib.rs b/src/lib.rs index 12b8358..1311db2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ //! //! ```toml //! [dependencies] -//! windows-capture = "1.3.2" +//! windows-capture = "1.3.5" //! ``` //! or run this command //! @@ -40,7 +40,7 @@ //! //! use windows_capture::{ //! capture::GraphicsCaptureApiHandler, -//! encoder::{AudioSettingBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, +//! encoder::{AudioSettingsBuilder, ContainerSettingsBuilder, VideoEncoder, VideoSettingsBuilder}, //! frame::Frame, //! graphics_capture_api::InternalCaptureControl, //! monitor::Monitor, @@ -68,7 +68,7 @@ //! //! let encoder = VideoEncoder::new( //! VideoSettingsBuilder::new(1920, 1080), -//! AudioSettingBuilder::default().disabled(true), +//! AudioSettingsBuilder::default().disabled(true), //! ContainerSettingsBuilder::default(), //! "video.mp4", //! )?; diff --git a/windows-capture-python/Cargo.toml b/windows-capture-python/Cargo.toml index 4f0aee4..63b4f1e 100644 --- a/windows-capture-python/Cargo.toml +++ b/windows-capture-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "windows-capture-python" -version = "1.3.2" +version = "1.3.5" authors = ["NiiightmareXD"] edition = "2021" description = "Fastest Windows Screen Capture Library For Python 🔥" diff --git a/windows-capture-python/pyproject.toml b/windows-capture-python/pyproject.toml index 162cafb..394d8e0 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.3.2" +version = "1.3.5" description = "Fastest Windows Screen Capture Library For Python 🔥" readme = "README.md" requires-python = ">=3.9"