From 8f4f9b450dd257ac70fda32c2161d72c68372bd6 Mon Sep 17 00:00:00 2001 From: Louis Beaumont Date: Thu, 8 Aug 2024 14:18:02 +0200 Subject: [PATCH] fix: build issue --- .../src/bin/screenpipe-server.rs | 21 ++++++++++--------- screenpipe-server/src/video.rs | 3 ++- screenpipe-vision/src/apple.rs | 2 +- .../src/bin/screenpipe-vision.rs | 2 +- screenpipe-vision/src/core.rs | 1 - screenpipe-vision/src/utils.rs | 2 -- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/screenpipe-server/src/bin/screenpipe-server.rs b/screenpipe-server/src/bin/screenpipe-server.rs index f4fdca3cd..397dcadbd 100644 --- a/screenpipe-server/src/bin/screenpipe-server.rs +++ b/screenpipe-server/src/bin/screenpipe-server.rs @@ -15,8 +15,7 @@ use crossbeam::queue::SegQueue; use dirs::home_dir; use log::{debug, error, info, LevelFilter}; use screenpipe_audio::{ - default_input_device, default_output_device, list_audio_devices, parse_audio_device, - DeviceControl, + default_input_device, list_audio_devices, parse_audio_device, DeviceControl, }; use screenpipe_vision::OcrEngine; use std::io::Write; @@ -235,14 +234,16 @@ async fn main() -> anyhow::Result<()> { } // audio output only supported on linux atm // see https://github.com/louis030195/screen-pipe/pull/106 - #[cfg(target_os = "linux")] - if let Ok(output_device) = default_output_device() { - audio_devices.push(Arc::new(output_device.clone())); - let device_control = DeviceControl { - is_running: true, - is_paused: false, - }; - devices_status.insert(output_device, device_control); + if cfg!(target_os = "linux") { + use screenpipe_audio::default_output_device; + if let Ok(output_device) = default_output_device() { + audio_devices.push(Arc::new(output_device.clone())); + let device_control = DeviceControl { + is_running: true, + is_paused: false, + }; + devices_status.insert(output_device, device_control); + } } } else { // Use specified devices diff --git a/screenpipe-server/src/video.rs b/screenpipe-server/src/video.rs index f2ce581a3..37f94fc39 100644 --- a/screenpipe-server/src/video.rs +++ b/screenpipe-server/src/video.rs @@ -2,7 +2,8 @@ use chrono::Utc; use image::ImageFormat::{self}; use log::{debug, error, info, warn}; use screenpipe_core::find_ffmpeg_path; -use screenpipe_vision::{continuous_capture, get_monitor, CaptureResult, OcrEngine}; +use screenpipe_vision::core::get_monitor; +use screenpipe_vision::{continuous_capture, CaptureResult, OcrEngine}; use std::collections::VecDeque; use std::path::PathBuf; use std::process::Stdio; diff --git a/screenpipe-vision/src/apple.rs b/screenpipe-vision/src/apple.rs index ae4dc25a0..77018e11f 100644 --- a/screenpipe-vision/src/apple.rs +++ b/screenpipe-vision/src/apple.rs @@ -1,5 +1,5 @@ use image::DynamicImage; -use std::ffi::{CStr, CString}; +use std::ffi::CStr; use std::os::raw::{c_char, c_uchar}; #[link(name = "ocr")] diff --git a/screenpipe-vision/src/bin/screenpipe-vision.rs b/screenpipe-vision/src/bin/screenpipe-vision.rs index ba72ca2cc..a745ffd17 100644 --- a/screenpipe-vision/src/bin/screenpipe-vision.rs +++ b/screenpipe-vision/src/bin/screenpipe-vision.rs @@ -1,5 +1,5 @@ use clap::Parser; -use screenpipe_vision::{continuous_capture, get_monitor, OcrEngine}; +use screenpipe_vision::{continuous_capture, core::get_monitor, OcrEngine}; use std::{sync::Arc, time::Duration}; use tokio::sync::mpsc::channel; diff --git a/screenpipe-vision/src/core.rs b/screenpipe-vision/src/core.rs index f0ead856f..2f53bfffe 100644 --- a/screenpipe-vision/src/core.rs +++ b/screenpipe-vision/src/core.rs @@ -19,7 +19,6 @@ use crate::utils::OcrEngine; use crate::utils::{ capture_screenshot, compare_with_previous_image, perform_ocr_tesseract, save_text_files, }; -use crate::utils::{perform_ocr_apple, OcrEngine}; use rusty_tesseract::{Data, DataOutput}; use screenpipe_integrations::unstructured_ocr::perform_ocr_cloud; pub enum ControlMessage { diff --git a/screenpipe-vision/src/utils.rs b/screenpipe-vision/src/utils.rs index ddd35cc6a..972a9efcb 100644 --- a/screenpipe-vision/src/utils.rs +++ b/screenpipe-vision/src/utils.rs @@ -1,6 +1,4 @@ use crate::core::MaxAverageFrame; -// Assuming core.rs is in the same crate under the `core` module -use image::codecs::png::PngEncoder; use image::DynamicImage; use image_compare::{Algorithm, Metric, Similarity}; // Added import for Similarity use log::{debug, error};