Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
extra macos capture logging
Brendan Alland941250076ae
diff --git a/crates/editor/src/editor_instance.rs b/crates/editor/src/editor_instance.rsindex 6dd25c6f0..0ea868bd2 100644--- a/crates/editor/src/editor_instance.rs+++ b/crates/editor/src/editor_instance.rs@@ -36,10 +36,6 @@ impl EditorInstance {on_state_change: impl Fn(&EditorState) + Send + Sync + 'static,frame_cb: Box<dyn FnMut(RenderedFrame) + Send>,) -> Result<Arc<Self>, String> {- sentry::configure_scope(|scope| {- scope.set_tag("crate", "editor");- });-if !project_path.exists() {println!("Video path {} not found!", project_path.display());panic!("Video path {} not found!", project_path.display());diff --git a/crates/recording/src/sources/screen_capture/macos.rs b/crates/recording/src/sources/screen_capture/macos.rsindex 476e45dd4..0f21084d7 100644--- a/crates/recording/src/sources/screen_capture/macos.rs+++ b/crates/recording/src/sources/screen_capture/macos.rs@@ -1,6 +1,7 @@use super::*;use cidre::*;use kameo::prelude::*;+use tracing::{debug, info, trace};#[derive(Debug)]pub struct CMSampleBufferCapture;@@ -122,6 +123,8 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {ready_signal: crate::pipeline::task::PipelineReadySignal,control_signal: crate::pipeline::control::PipelineControlSignal,) -> Result<(), String> {+ trace!("PipelineSourceTask::run");+let video_tx = self.video_tx.clone();let audio_tx = self.audio_tx.clone();let config = self.config.clone();@@ -140,6 +143,8 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {.await.ok_or_else(|| SourceError::AsContentFilter)?;+ debug!("SCK content filter: {:?}", content_filter);+let size = {let logical_size = config.crop_bounds@@ -153,7 +158,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {PhysicalSize::new(logical_size.width() * scale, logical_size.height() * scale)};- tracing::info!("size: {:?}", size);+ debug!("size: {:?}", size);let mut settings = scap_screencapturekit::StreamCfgBuilder::default().with_width(size.width() as usize)@@ -167,7 +172,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {settings.set_color_space_name(cg::color_space::names::srgb());if let Some(crop_bounds) = config.crop_bounds {- tracing::info!("crop bounds: {:?}", crop_bounds);+ debug!("crop bounds: {:?}", crop_bounds);settings.set_src_rect(cg::Rect::new(crop_bounds.position().x(),crop_bounds.position().y(),@@ -178,6 +183,8 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {let (error_tx, error_rx) = flume::bounded(1);+ trace!("Spawning ScreenCaptureActor");+let capturer = ScreenCaptureActor::spawn(ScreenCaptureActor::new(content_filter,@@ -188,11 +195,15 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {.map_err(SourceError::CreateActor)?,);+ info!("Spawned ScreenCaptureActor");+capturer.ask(StartCapturing).await.map_err(SourceError::StartCapturing)?;+ info!("Started capturing");+let _ = ready_signal.send(Ok(()));let stop = async move {@@ -307,15 +318,21 @@ impl Message<StartCapturing> for ScreenCaptureActor {_: StartCapturing,_: &mut Context<Self, Self::Reply>,) -> Self::Reply {+ trace!("ScreenCaptureActor.StartCapturing");+if self.capturing {return Err(StartCapturingError::AlreadyCapturing);}+ trace!("Starting SCK capturer");+self.capturer.start().await.map_err(StartCapturingError::Start)?;+ info!("Started SCK capturer");+self.capturing = true;Ok(())@@ -330,6 +347,8 @@ impl Message<StopCapturing> for ScreenCaptureActor {_: StopCapturing,_: &mut Context<Self, Self::Reply>,) -> Self::Reply {+ trace!("ScreenCaptureActor.StopCapturing");+if !self.capturing {return Err(StopCapturingError::NotCapturing);};