Skip to content

Commit 845040b

Browse files
authored
query for continuity camera properly (#962)
1 parent 670b630 commit 845040b

File tree

1 file changed

+7
-2
lines changed
  • crates/camera-avfoundation/src

1 file changed

+7
-2
lines changed

crates/camera-avfoundation/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ pub fn list_video_devices() -> arc::R<ns::Array<av::CaptureDevice>> {
1818
];
1919

2020
if api::macos_available("14.0") {
21-
device_types.push(unsafe { av::CaptureDeviceType::external().unwrap() })
21+
if let Some(typ) = unsafe { av::CaptureDeviceType::external() } {
22+
device_types.push(typ);
23+
}
24+
if let Some(typ) = unsafe { av::CaptureDeviceType::continuity_camera() } {
25+
device_types.push(typ);
26+
}
2227
} else {
23-
device_types.push(av::CaptureDeviceType::external_unknown())
28+
device_types.push(av::CaptureDeviceType::external_unknown());
2429
}
2530

2631
let device_types = ns::Array::from_slice(&device_types);

0 commit comments

Comments
 (0)