From c29247df91f4a38b02216282aa7acfee1a179bbb Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Thu, 28 Aug 2025 02:19:20 +0800 Subject: [PATCH] query for continuity camera properly --- crates/camera-avfoundation/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/camera-avfoundation/src/lib.rs b/crates/camera-avfoundation/src/lib.rs index 3b0fa130fc3..1f59ea6264a 100644 --- a/crates/camera-avfoundation/src/lib.rs +++ b/crates/camera-avfoundation/src/lib.rs @@ -18,9 +18,14 @@ pub fn list_video_devices() -> arc::R> { ]; if api::macos_available("14.0") { - device_types.push(unsafe { av::CaptureDeviceType::external().unwrap() }) + if let Some(typ) = unsafe { av::CaptureDeviceType::external() } { + device_types.push(typ); + } + if let Some(typ) = unsafe { av::CaptureDeviceType::continuity_camera() } { + device_types.push(typ); + } } else { - device_types.push(av::CaptureDeviceType::external_unknown()) + device_types.push(av::CaptureDeviceType::external_unknown()); } let device_types = ns::Array::from_slice(&device_types);