godot-ios-plugins icon indicating copy to clipboard operation
godot-ios-plugins copied to clipboard

iOS camera focus control (or auto-focus)

Open vanoak opened this issue 3 years ago • 5 comments

Hello,

First of all this is not an issue, the plugin works as expected. I have a doubt though. Is it possible to change the camera focus ? Or enable auto-focus? Thank you.

vanoak avatar Jan 04 '22 21:01 vanoak

Noticed this [p_device setFocusMode:AVCaptureFocusModeLocked]; in plugins/camera/camera_ios.mm (line 75). Could it be the case of changing to continuousAutoFocus?

SOURCE: https://stackoverflow.com/questions/49541837/swift-autofocus-expose-and-continuousautofocus-exposure-at-the-same-time

vanoak avatar Jan 10 '22 22:01 vanoak

It's possible to use AVCaptureFocusModeContinuousAutoFocus instead of AVCaptureFocusModeLocked, but it would change the way plugin works for everyone, since Godot's CameraFeed doesn't support any way to setup focus modes.

naithar avatar Jan 11 '22 09:01 naithar

Alright, I think that can work for the project I'm working at the moment. I will try it tomorrow.

vanoak avatar Jan 11 '22 10:01 vanoak

Hi again,

It works (just the continuous autofocus). I recompiled the xcframework (debug and the release) and duplicated the previous configuration.

Thank you @naithar.

vanoak avatar Jan 12 '22 00:01 vanoak

@vanoak that's great news :) I think plugin should provide the way to setup some parameters like focus, but I can't think of any way to add this configuration except for extending Godot's CameraFeed

naithar avatar Jan 12 '22 11:01 naithar