The android.hardware.camera2 package provides an interface to fully control many apsects of camera device, e.g. CameraDevice, CaptureRequest-CaptureResult flow, Surfaces, ProcessingImages, setting camera parameters, setting request parameters and so on. It replaces the deprecated Camera class.
This package models a camera device as a pipeline, which takes in input requests for capturing a single frame, captures the single image per the request, and then outputs one capture result metadata packet, plus a set of output image buffers for the request. The requests are processed in-order, and multiple requests can be in flight at once. Since the camera device is a pipeline with multiple stages, having multiple requests in flight is required to maintain full framerate on most Android devices. To enumerate, query, and open available camera devices, obtain a CameraManager instance.
Individual CameraDevices provide a set of static property information that describes the hardware device and the available settings and output parameters for the device. This information is provided through the CameraCharacteristics object, and is available through getCameraCharacteristics(String).