use of android.media.ImageReader in project android_frameworks_base by ResurrectionRemix.
the class CameraTestUtils method makeImageReader.
/**
* Create an {@link ImageReader} object and get the surface.
*
* @param size The size of this ImageReader to be created.
* @param format The format of this ImageReader to be created
* @param maxNumImages The max number of images that can be acquired simultaneously.
* @param listener The listener used by this ImageReader to notify callbacks.
* @param handler The handler to use for any listener callbacks.
*/
public static ImageReader makeImageReader(Size size, int format, int maxNumImages, ImageReader.OnImageAvailableListener listener, Handler handler) {
ImageReader reader;
reader = ImageReader.newInstance(size.getWidth(), size.getHeight(), format, maxNumImages);
reader.setOnImageAvailableListener(listener, handler);
if (VERBOSE)
Log.v(TAG, "Created ImageReader size " + size);
return reader;
}
Aggregations