Can I getBuffer after image.close?

113 Views Asked by At

I camera2 api, I save continuously image to Image[] and when want to capture picture, I call image.getPlanes()[0].getBuffer but app crashed and show error:

Image is already close.

How can I getBuffer after image.close ? Thank you!

1

There are 1 best solutions below

0
On BEST ANSWER

You can't.

Don't call close() on the Image before you're done using it.

This may require you to increase the maxImageCount argument to your ImageReader, so you can hold on to more Images at the same time.