I am using https://github.com/googlesamples/android-Camera2Basic , but try changing it so that I can access each frame before it is drawn onto the surface overview. I realized, I have to add an extra surface (ImageReader.getSurface ()) and read a frame from it in this callback:
private final ImageReader.OnImageAvailableListener mOnImageAvailableListener = new ImageReader.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReader reader) { Log.d("Img", "onImageAvailable"); mBackgroundHandler.post(new ImageSaver(reader.acquireNextImage(), mFile)); } };
The problem is that this callback is only called when the image is captured by the user and not by the eacg frame that is sent to the preview screen from the camera.
Here is what I tried to add:
private void createCameraPreviewSession() { try { SurfaceTexture texture = mTextureView.getSurfaceTexture(); assert texture != null;
source share