I want to synchronize setFocusModeLockedWithLensPosition, setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains and setExposureModeCustomWithDuration calls.
Is there a logic order to call thoses functions ?
What i want to do is to start Running session when i am sure that focus, balance and exposure are properly set (i want to set values, not in automatic)
I have tried to lock the configuration, then call the 3 functions, then unlock, then startRunning on session. I put nil in the 3 completion handler parameters. What i see in this case is that my image preview is not pretty (kind of blue filter). I have to wait before having a good image quality. What i want is to display the image only when it is good. I want do be notified.
So i tried to cascade my 3 calls with completion handler. in some cases, the completion handler is not called. I suppose this is when i want to put my lens position to 0.4 and the current lens position is 0.4.
So i don't know which is the best method.
Thanks
You can set your camera options in completion handler like this. It will wait till focus has been set to set exposure and the same principle will work with white balance and exposure. You can read more about camera setting here.