fix: Expose minExposure/maxExposure in format (#2179)

* fix: Expose `minExposure`/`maxExposure` in `format`

I forgot to do that on iOS before

* Update CameraDeviceFormat.swift
This commit is contained in:
Marc Rousavy
2023-11-19 16:43:04 +01:00
committed by GitHub
parent ba0aa88cb9
commit 9c5eb9105e
3 changed files with 16 additions and 7 deletions

View File

@@ -187,14 +187,14 @@ extension CameraSession {
ReactLogger.log(level: .info, message: "Configuring Format (\(targetFormat))...")
let currentFormat = CameraDeviceFormat(fromFormat: device.activeFormat)
let currentFormat = CameraDeviceFormat(fromFormat: device.activeFormat, forDevice: device)
if currentFormat == targetFormat {
ReactLogger.log(level: .info, message: "Already selected active format, no need to configure.")
return
}
// Find matching format (JS Dictionary -> strongly typed Swift class)
let format = device.formats.first { targetFormat.isEqualTo(format: $0) }
let format = device.formats.first { targetFormat.isEqualTo(format: $0, device: device) }
guard let format else {
throw CameraError.format(.invalidFormat)
}