To update the camera capture session with a new state (focus, exposuretime) it seems i have to call abortCaptures on my current session. Calling this takes about 0.3 seconds though. The viewport also freezes during this time. It seems this other apps change focus without stuttering though, how do these apps do it?
If I don't call abortCaptures on my session it does eventually update to a new focus distance without stuttering, but only after about 10 seconds..
Source file: https://github.com/RuurdBijlsma/Camera/blob/master/app/src/main/java/com/ruurdbijlsma/camera/Camera.java#L166