I'm working with Android Camera2 API and get this after getting a set of photos from camera on my smartphone with Android version 6.0 (API 23):
2020-04-09 20:36:58.556 260-9342/? E/Camera3-Stream: getBuffer: wait for output buffer return timed out after 3000ms
2020-04-09 20:36:58.556 260-9342/? E/Camera3-Device: RequestThread: Can't get output buffer, skipping request: Connection timed out
After this errors the camera blocks, images stop sending and I need to reopen CameraDevice for getting a new set of images.
I'm using a BackgroundHandler to process getting camera images in a BackgroundThread. Then I create additional BackgroundThread to process every image with OpenCV library functions. But, I have only one working additional BackgroundThread at the the same time. (Some images I'm leaving out and create a new thread only if there are no another similar thread.)
For getting images I'm use CameraCaptureSession with setRepeatingRequest function. And also I making a clone of each image buffer before I processing it. So, my question is why the errors are happened and how to overcome it?