Skip to content

Commit

Permalink
fix: Always initialize continuous AF/AE on iOS (#2970)
Browse files Browse the repository at this point in the history
* fix auto focus/exposure

* fix: Move autofocus setup to `configureSideProps`

---------

Co-authored-by: Marc Rousavy <me@mrousavy.com>
  • Loading branch information
j-jonathan and mrousavy committed Jun 12, 2024
1 parent 573ab81 commit 89a8806
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions package/ios/Core/CameraSession+Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extension CameraSession {
captureSession.addInput(input)
videoDeviceInput = input

// Update Orientation manager (uses device relative sensor orientation)
orientationManager.setInputDevice(videoDevice)

VisionLogger.log(level: .info, message: "Successfully configured Input Device!")
Expand Down Expand Up @@ -268,6 +269,14 @@ extension CameraSession {
}
device.automaticallyEnablesLowLightBoostWhenAvailable = configuration.enableLowLightBoost
}

// Configure auto-focus
if device.isFocusModeSupported(.continuousAutoFocus) {
device.focusMode = .continuousAutoFocus
}
if device.isExposureModeSupported(.continuousAutoExposure) {
device.exposureMode = .continuousAutoExposure
}
}

/**
Expand Down

0 comments on commit 89a8806

Please sign in to comment.