Skip to content

Commit

Permalink
Fix compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
eduramiba committed Jan 3, 2025
1 parent ff190f1 commit 73eee19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nokhwa-bindings-linux/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ mod internal {
FrameFormat::YUYV => FourCC::new(b"YUYV"),
FrameFormat::GRAY => FourCC::new(b"GRAY"),
FrameFormat::RAWRGB => FourCC::new(b"RGB3"),
FrameFormat::RAWBGR => FourCC::new(b"BGR3"),
FrameFormat::NV12 => FourCC::new(b"NV12"),
};

Expand Down Expand Up @@ -912,6 +913,7 @@ mod internal {
"MJPG" => Some(FrameFormat::MJPEG),
"GRAY" => Some(FrameFormat::GRAY),
"RGB3" => Some(FrameFormat::RAWRGB),
"BGR3" => Some(FrameFormat::RAWBGR),
"NV12" => Some(FrameFormat::NV12),
_ => None,
}
Expand All @@ -923,6 +925,7 @@ mod internal {
FrameFormat::YUYV => FourCC::new(b"YUYV"),
FrameFormat::GRAY => FourCC::new(b"GRAY"),
FrameFormat::RAWRGB => FourCC::new(b"RGB3"),
FrameFormat::RAWBGR => FourCC::new(b"BGR3"),
FrameFormat::NV12 => FourCC::new(b"NV12"),
}
}
Expand Down
7 changes: 7 additions & 0 deletions nokhwa-bindings-macos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,13 @@ mod internal {
FrameFormat::GRAY => kCMPixelFormat_8IndexedGray_WhiteIsZero,
FrameFormat::NV12 => kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange,
FrameFormat::RAWRGB => kCMPixelFormat_24RGB,
FrameFormat::RAWBGR => {
return Err(NokhwaError::SetPropertyError {
property: "setVideoSettings".to_string(),
value: "set frame format".to_string(),
error: "Unsupported frame format BGR".to_string(),
});
}
};
let obj = CFNumber::from(cmpixelfmt as i32);
let obj = obj.as_CFTypeRef() as *mut Object;
Expand Down

0 comments on commit 73eee19

Please sign in to comment.