I'm trying to modify the basic Camera2 API sample (https://github.com/googlesamples/android-Camera2Basic) so that it takes a picture every x seconds (and then processes it on the background thread; I don't even need to save the image to the disk), while showing smooth preview. Unfortunately, calling capture()
on the capture session freezes the preview for a second or two, resulting in poor user experience.
Is there a way to get to the preview surface directly and read image bytes? I don't care about the image quality, smooth UX is the priority.