How to use the ImageReader that appeared in Androi

2019-07-04 21:56发布

问题:

Android 4.4 Kit Kat introduced the ImageReader class for accessing the image in the Surface, useful for real-time processing of a camera preview. However, I can't figure out how to link it to the Surface or use it. Anybody have any insights or short example code?

回答1:

You can find an example in the camera CTS tests.

As noted in the comments, ImageReader isn't actually usable until 5.0 ("Lollipop").