From 3a0d159df4920707b4a601fff58db3aa10140c7b Mon Sep 17 00:00:00 2001 From: Rohit Sangwan Date: Sun, 31 Aug 2025 10:10:28 +0530 Subject: [PATCH 1/3] Fix windows compilation beuase of timestamp typo --- src/capturer/engine/win/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/capturer/engine/win/mod.rs b/src/capturer/engine/win/mod.rs index 227aa32..3093541 100644 --- a/src/capturer/engine/win/mod.rs +++ b/src/capturer/engine/win/mod.rs @@ -76,7 +76,7 @@ impl GraphicsCaptureApiHandler for Capturer { frame: &mut WCFrame, _: InternalCaptureControl, ) -> Result<(), Self::Error> { - let elapsed = frame.timespan().Duration - self.start_time.0; + let elapsed = frame.timestamp().Duration - self.start_time.0; let display_time = self .start_time .1 From 834eca4ea219039f58b5623456ed6db4898156c5 Mon Sep 17 00:00:00 2001 From: Rohit Sangwan Date: Thu, 4 Sep 2025 16:40:39 +0530 Subject: [PATCH 2/3] expose get_target_dimensions --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d0d7360..9b0fec0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ mod targets; mod utils; // Helper Methods -pub use targets::{get_all_targets, get_main_display}; +pub use targets::{get_all_targets, get_main_display, get_target_dimensions}; pub use targets::{Display, Target}; pub use utils::has_permission; pub use utils::is_supported; From 2b00ea158138747362757108f1a969256f04edf2 Mon Sep 17 00:00:00 2001 From: Rohit Sangwan Date: Fri, 28 Nov 2025 08:31:48 +0530 Subject: [PATCH 3/3] fix linux compilation --- src/capturer/engine/linux/mod.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/capturer/engine/linux/mod.rs b/src/capturer/engine/linux/mod.rs index 07967fb..b0f702e 100644 --- a/src/capturer/engine/linux/mod.rs +++ b/src/capturer/engine/linux/mod.rs @@ -5,7 +5,7 @@ use std::{ mpsc::{self, sync_channel, SyncSender}, }, thread::JoinHandle, - time::Duration, + time::{Duration, SystemTime}, }; use pipewire as pw; @@ -31,7 +31,7 @@ use pw::{ use crate::{ capturer::Options, - frame::{BGRxFrame, Frame, RGBFrame, RGBxFrame, XBGRFrame}, + frame::{BGRxFrame, Frame, RGBFrame, RGBxFrame, VideoFrame, XBGRFrame}, }; use self::{error::LinCapError, portal::ScreenCastPortal}; @@ -119,6 +119,7 @@ fn process_callback(stream: &StreamRef, user_data: &mut ListenerUserData) { break 'outside; } let timestamp = unsafe { get_timestamp(buffer) }; + let system_time = SystemTime::now(); let n_datas = unsafe { (*buffer).n_datas }; if n_datas < 1 { @@ -134,30 +135,30 @@ fn process_callback(stream: &StreamRef, user_data: &mut ListenerUserData) { }; if let Err(e) = match user_data.format.format() { - VideoFormat::RGBx => user_data.tx.send(Frame::RGBx(RGBxFrame { - display_time: timestamp as u64, + VideoFormat::RGBx => user_data.tx.send(Frame::Video(VideoFrame::RGBx(RGBxFrame { + display_time: system_time, width: frame_size.width as i32, height: frame_size.height as i32, data: frame_data, - })), - VideoFormat::RGB => user_data.tx.send(Frame::RGB(RGBFrame { - display_time: timestamp as u64, + }))), + VideoFormat::RGB => user_data.tx.send(Frame::Video(VideoFrame::RGB(RGBFrame { + display_time: system_time, width: frame_size.width as i32, height: frame_size.height as i32, data: frame_data, - })), - VideoFormat::xBGR => user_data.tx.send(Frame::XBGR(XBGRFrame { - display_time: timestamp as u64, + }))), + VideoFormat::xBGR => user_data.tx.send(Frame::Video(VideoFrame::XBGR(XBGRFrame { + display_time: system_time, width: frame_size.width as i32, height: frame_size.height as i32, data: frame_data, - })), - VideoFormat::BGRx => user_data.tx.send(Frame::BGRx(BGRxFrame { - display_time: timestamp as u64, + }))), + VideoFormat::BGRx => user_data.tx.send(Frame::Video(VideoFrame::BGRx(BGRxFrame { + display_time: system_time, width: frame_size.width as i32, height: frame_size.height as i32, data: frame_data, - })), + }))), _ => panic!("Unsupported frame format received"), } { eprintln!("{e}");