I'm facing a problem where I am using a ImageReader in addition to have a SurfaceView which is used to show the output of the camera. I have added the SurfaceView itself and the surface for the ImageReader like this (and added the ImageReader listeners in order to receive events on new images):
preview.addTarget(_surfaces.get(1)); //ImageReader surface
preview.addTarget(_surfaces.get(0)); //SurfaceView of the layout
reader = ImageReader.newInstance(640, 480, ImageFormat.JPEG, 1);
Turns out that the problem is the ImageFormat of the ImageReader. Changing the
ImageFormat.JPEG to for example
ImageFormat.YUV_420_888 fixed the lagging problem.