Function nokhwa::query

source ·
pub fn query(api: ApiBackend) -> Result<Vec<CameraInfo>, NokhwaError>
Expand description

Query the system for a list of available devices. Please refer to the API Backends that support Query)
Usually the order goes Native -> UVC -> Gstreamer.

Quirks

  • Media Foundation: The symbolic link for the device is listed in the misc attribute of the CameraInfo.
  • Media Foundation: The names may contain invalid characters since they were converted from UTF16.
  • AVFoundation: The ID of the device is stored in the misc attribute of the CameraInfo.
  • AVFoundation: There is lots of miscellaneous info in the desc attribute.
  • WASM: The misc field contains the device ID and group ID are seperated by a space (’ ’)

Errors

If you use an unsupported API (check the README or crate root for more info), incompatible backend for current platform, incompatible platform, or insufficient permissions, etc this will error.