Skip to content

Commit

Permalink
Merge pull request #1 from nclack/main
Browse files Browse the repository at this point in the history
test
  • Loading branch information
nclack authored Apr 26, 2023
2 parents 74f91f7 + b39d676 commit b7daac6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ fn main() {
.target("acquire-video-runtime")
.profile("RelWithDebInfo")
.static_crt(true)
.define("NOTEST", "TRUE")
.define("NO_UNIT_TESTS", "TRUE")
.define("NO_EXAMPLES", "TRUE")
.define("CMAKE_OSX_DEPLOYMENT_TARGET", "10.15")
Expand All @@ -19,7 +20,7 @@ fn main() {
println!("cargo:rustc-link-lib=static=acquire-device-hal");
println!("cargo:rustc-link-lib=static=acquire-core-platform");
println!("cargo:rustc-link-lib=static=acquire-core-logger");
println!("cargo:rustc-link-lib=static=stdc++");
// println!("cargo:rustc-link-lib=static=stdc++");

println!("cargo:rerun-if-changed=wrapper.h");
// TODO: expand rerun-if-changed so we don't have to touch wrapper so much
Expand All @@ -43,6 +44,7 @@ fn build_acquire_driver(dst: &std::path::PathBuf, name: &str) {
.target(name)
.profile("RelWithDebInfo")
.static_crt(true)
.define("NOTEST", "TRUE")
.define("NO_UNIT_TESTS", "TRUE")
.define("NO_EXAMPLES", "TRUE")
.define("CMAKE_OSX_DEPLOYMENT_TARGET", "10.15")
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ acquire-python = [
"libacquire-driver-egrabber.so",
"libacquire-driver-hdcam.so",
"libacquire-driver-zarr.so",
"acquire-driver-common.dll",
"acquire-driver-egrabber.dll",
"acquire-driver-hdcam.dll",
"acquire-driver-zarr.dll",
"__init__.pyi",
"acquire.pyi",
]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ impl Status for capi::DeviceStatusCode {
}
}

impl Status for i32 {
impl Status for bool {
fn is_ok(&self) -> bool {
*self == 1
*self
}
}

Expand Down
12 changes: 7 additions & 5 deletions src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{capi, components::macros::impl_plain_old_dict, Status};
use crate::{capi, components::macros::impl_plain_old_dict};
use pyo3::prelude::*;
use serde::{Deserialize, Serialize};
use std::{
Expand Down Expand Up @@ -94,7 +94,7 @@ impl TryFrom<&StorageProperties> for capi::StorageProperties {
};

// This copies the string into a buffer owned by the return value.
unsafe {
if !unsafe {
capi::storage_properties_init(
&mut out,
value.first_frame_id,
Expand All @@ -107,10 +107,12 @@ impl TryFrom<&StorageProperties> for capi::StorageProperties {
y: value.pixel_scale_um.1,
},
value.bytes_per_chunk,
)
.ok()?;
) == 1
} {
Err(anyhow::anyhow!("Failed acquire api status check"))
} else {
Ok(out)
}
Ok(out)
}
}

Expand Down

0 comments on commit b7daac6

Please sign in to comment.