Skip to content

Commit

Permalink
macos: use YUYV for pixel types
Browse files Browse the repository at this point in the history
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange

Fixes #100.

This was suggested by the code from @paviro at
#100 (comment).
  • Loading branch information
astraw committed Oct 28, 2024
1 parent cf9b8a0 commit 0d09cc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nokhwa-bindings-macos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ mod internal {
use core_video_sys::{
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange,
kCVPixelFormatType_420YpCbCr8BiPlanarFullRange,
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange,
};
use flume::{Receiver, Sender};
use nokhwa_core::{
Expand Down Expand Up @@ -371,7 +372,7 @@ mod internal {
kCMPixelFormat_8IndexedGray_WhiteIsZero => Some(FrameFormat::GRAY),
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
| kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
| 875704438 => Some(FrameFormat::NV12),
| kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange => Some(FrameFormat::YUYV),
kCMPixelFormat_24RGB => Some(FrameFormat::RAWRGB),
_ => None,
}
Expand Down

0 comments on commit 0d09cc3

Please sign in to comment.