Skip to content

Commit

Permalink
Add support for Blackmagic Micro Studio Camera G2
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianEddy committed Dec 23, 2023
1 parent 97a9e8e commit 8920009
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/blackmagic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ impl BlackmagicBraw {
}
}
pub fn has_accurate_timestamps(&self) -> bool {
true
match self.model.as_deref() {
Some("Micro Studio Camera 4K G2") => false,
_ => true
}
}
pub fn possible_extensions() -> Vec<&'static str> {
vec!["braw"]
Expand Down Expand Up @@ -79,6 +82,11 @@ impl BlackmagicBraw {
util::insert_tag(&mut map, tag!(parsed GroupId::Imager, TagId::PixelPitch, "Pixel pitch", u32x2, |v| format!("{v:?}"), (4628, 4628), vec![]));
// crop_factor = 2.0;
},
Some("Micro Studio Camera 4K G2") => {
// TODO: this is not confirmed
util::insert_tag(&mut map, tag!(parsed GroupId::Imager, TagId::PixelPitch, "Pixel pitch", u32x2, |v| format!("{v:?}"), (4628, 4628), vec![]));
// crop_factor = 2.0;
},
_ => { }
}

Expand Down Expand Up @@ -152,7 +160,10 @@ impl BlackmagicBraw {
util::insert_tag(&mut map, tag!(parsed GroupId::Accelerometer, TagId::Unit, "Accelerometer unit", String, |v| v.to_string(), "m/s²".into(), Vec::new()));
util::insert_tag(&mut map, tag!(parsed GroupId::Gyroscope, TagId::Unit, "Gyroscope unit", String, |v| v.to_string(), "rad/s".into(), Vec::new()));

let imu_orientation = "yxz";
let imu_orientation = match self.model.as_deref() {
Some("Micro Studio Camera 4K G2") => "yXZ",
_ => "yxz"
};
util::insert_tag(&mut map, tag!(parsed GroupId::Accelerometer, TagId::Orientation, "IMU orientation", String, |v| v.to_string(), imu_orientation.into(), Vec::new()));
util::insert_tag(&mut map, tag!(parsed GroupId::Gyroscope, TagId::Orientation, "IMU orientation", String, |v| v.to_string(), imu_orientation.into(), Vec::new()));

Expand Down

0 comments on commit 8920009

Please sign in to comment.