Skip to content

Commit

Permalink
factor out openpnp_capture while testing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slivingston committed Jan 7, 2025
1 parent 3623638 commit 3c76dd9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tokio = { version = "1.40", features = ["net", "rt", "signal", "sync"] }
[target.'cfg(target_os="linux")'.dependencies]
v4l = { version = "0.14", features = ["v4l2"] }

[target.'cfg(any(target_os="macos", target_os = "windows"))'.dependencies]
[target.'cfg(target_os="macos")'.dependencies]
openpnp_capture = "0.2.4"

[dependencies.clap]
Expand Down
21 changes: 19 additions & 2 deletions src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ enum CaptureCommand {
Quit, // Return from (close) the thread
}

#[cfg(any(target_os = "macos", target_os = "windows"))]
#[cfg(target_os = "windows")]
fn verify_capture_ability(
camera_path: &str,
dimensions: Option<CameraDimensions>,
) -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}

#[cfg(target_os = "macos")]
fn verify_capture_ability(
camera_path: &str,
dimensions: Option<CameraDimensions>,
Expand Down Expand Up @@ -155,7 +163,16 @@ fn verify_capture_ability(
Ok(())
}

#[cfg(any(target_os = "macos", target_os = "windows"))]
#[cfg(target_os = "windows")]
fn video_capture(
camera_path: &str,
dimensions: Option<CameraDimensions>,
wsclient_addr: Addr<WSClient>,
cap_command: mpsc::Receiver<CaptureCommand>,
) {
}

#[cfg(target_os = "macos")]
fn video_capture(
camera_path: &str,
dimensions: Option<CameraDimensions>,
Expand Down

0 comments on commit 3c76dd9

Please sign in to comment.