Skip to content

Commit

Permalink
Add AVCaptureDeviceType::External enum value to fix detecting externa…
Browse files Browse the repository at this point in the history
…l cameras (fixes l1npengtul#155)

Uses the AVCaptureDeviceTypeExternal enum instead of AVCaptureDeviceTypeExternalUnknown which was deprecated.

See: https://developer.apple.com/documentation/avfoundation/avcapturedevicetypeexternalunknown
  • Loading branch information
alufers committed Dec 5, 2023
1 parent f0bbbf3 commit 7852477
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nokhwa-bindings-macos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ mod internal {
AVCaptureDeviceType::Telephoto,
AVCaptureDeviceType::TrueDepth,
AVCaptureDeviceType::ExternalUnknown,
AVCaptureDeviceType::External
])?
.devices())
}
Expand Down Expand Up @@ -545,6 +546,7 @@ mod internal {
Telephoto,
TrueDepth,
ExternalUnknown,
External
}

impl From<AVCaptureDeviceType> for *mut Object {
Expand Down Expand Up @@ -572,6 +574,7 @@ mod internal {
AVCaptureDeviceType::ExternalUnknown => {
str_to_nsstr("AVCaptureDeviceTypeExternalUnknown")
}
AVCaptureDeviceType::External => str_to_nsstr("AVCaptureDeviceTypeExternal"),
}
}
}
Expand Down Expand Up @@ -814,6 +817,7 @@ mod internal {
AVCaptureDeviceType::Dual,
AVCaptureDeviceType::DualWide,
AVCaptureDeviceType::Triple,
AVCaptureDeviceType::External
])
}

Expand Down

0 comments on commit 7852477

Please sign in to comment.