Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

reused vide queue directly in videocapture struct to avoid warning

matthew-heartfulee7c774f6e0a
diff --git a/screenpipe-server/src/video.rs b/screenpipe-server/src/video.rs
index 23e688c23..4a054b095 100644
--- a/screenpipe-server/src/video.rs
+++ b/screenpipe-server/src/video.rs
@@ -72,6 +72,11 @@ impl VideoCapture {
video_queue.push_back(result.clone());
ocr_queue.push_back(result);
debug!("Frame {} pushed to queues. Queue length: {}, Video queue length: {}, OCR queue length: {}", frame_number, queue.len(), video_queue.len(), ocr_queue.len());
+
+ // Clear the old queue after processing
+ if queue.len() > 1 {
+ queue.pop_front();
+ }
}
}
});
@@ -125,6 +130,10 @@ impl VideoCapture {
debug!("Number of frames in queue before popping: {}", queue_length);
queue.pop_front()
}
+
+ pub fn get_video_frame_queue(&self) -> Arc<Mutex<VecDeque<CaptureResult>>> {
+ Arc::clone(&self.video_frame_queue)
+ }
}
async fn save_frames_as_video(
frame_queue: &Arc<Mutex<VecDeque<CaptureResult>>>,