diff --git a/nokhwa-bindings-macos/Cargo.toml b/nokhwa-bindings-macos/Cargo.toml index fbe60a1..a5a026a 100644 --- a/nokhwa-bindings-macos/Cargo.toml +++ b/nokhwa-bindings-macos/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "nokhwa-bindings-macos" version = "0.1.2" -edition = "2021" +edition = "2018" authors = ["l1npengtul"] license = "Apache-2.0" repository = "https://github.com/l1npengtul/nokhwa" diff --git a/nokhwa-bindings-macos/src/lib.rs b/nokhwa-bindings-macos/src/lib.rs index b2f6262..7668e6e 100644 --- a/nokhwa-bindings-macos/src/lib.rs +++ b/nokhwa-bindings-macos/src/lib.rs @@ -242,9 +242,9 @@ pub mod avfoundation { use block::ConcreteBlock; use cocoa_foundation::foundation::{NSArray, NSInteger, NSString, NSUInteger}; use core_media_sys::{ - kCMPixelFormat_422YpCbCr8_yuvs, kCMVideoCodecType_422YpCbCr8, kCMVideoCodecType_JPEG, - kCMVideoCodecType_JPEG_OpenDML, CMFormatDescriptionGetMediaSubType, CMSampleBufferRef, - CMVideoDimensions, + kCMPixelFormat_422YpCbCr8_yuvs, kCMPixelFormat_8IndexedGray_WhiteIsZero, + kCMVideoCodecType_422YpCbCr8, kCMVideoCodecType_JPEG, kCMVideoCodecType_JPEG_OpenDML, + CMFormatDescriptionGetMediaSubType, CMSampleBufferRef, CMVideoDimensions, }; use dashmap::DashMap; use flume::{Receiver, Sender}; @@ -681,6 +681,7 @@ pub mod avfoundation { pub enum AVFourCC { YUV2, MJPEG, + GRAY8, } // Localized Name @@ -874,6 +875,7 @@ pub mod avfoundation { let fourcc = match fcc_raw { kCMVideoCodecType_422YpCbCr8 | kCMPixelFormat_422YpCbCr8_yuvs => AVFourCC::YUV2, kCMVideoCodecType_JPEG | kCMVideoCodecType_JPEG_OpenDML => AVFourCC::MJPEG, + kCMPixelFormat_8IndexedGray_WhiteIsZero => AVFourCC::GRAY8, _ => { return Err(AVFError::InvalidValue { found: fcc_raw.to_string(), @@ -1109,7 +1111,7 @@ pub mod avfoundation { Ok(avf) => avf.into_raw(), Err(_) => { // should not happen - return Err(AVFError::StreamOpen("String contains null? This is a bug, please report it https://github.com/l1npengtul/nokhwa".to_string())); + return Err(AVFError::StreamOpen("String contains null? This is a bug, please report it: https://github.com/l1npengtul/nokhwa".to_string())); } }; let queue = dispatch_queue_create(avf_queue_str, NSObject(std::ptr::null_mut()));