HimalayanCoder
HimalayanCoder

Reputation: 9850

Image Stream in ImageReader from Camera2 API

I want to capture Images as a sequential stream in OnImageAvailableListener of the ImageReader.

My Aim is to process these images in a background thread.

In the basic camera2 example this ImageAvailable Listener is called only once when I take a picture by clicking a button.

I need to get this OnImageAvailable called in real time.

enter image description here

Upvotes: 1

Views: 1090

Answers (1)

Eddy Talvala
Eddy Talvala

Reputation: 18117

You need to add an ImageReader Surface into the repeating preview request targets as well, instead of just to the still image capture.

You likely also want to use a YUV_420_888 format instead of JPEG, depending on your use case.

Upvotes: 1

Related Questions