Android Camera2 api
===
###### tags: `Android`,`Camera2`
1. Camera library is deperate hence Camera2 come in place
2. 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.
3. To enumerate, query, and open available camera devices, obtain a CameraManager instance.
1. 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)
2. createCaptureSession(SessionConfiguration)
3. SurfaceView, SurfaceTexture via Surface(SurfaceTexture), MediaCodec, MediaRecorder, Allocation, and ImageReader.
4. Capture of JPEG images or RAW buffers for DngCreator can be done with ImageReader with the JPEG and RAW_SENSOR formats.
5. Application-driven processing of camera data in RenderScript, OpenGL ES, or directly in managed or native code is best done through Allocation with a YUV Type, SurfaceTexture, and ImageReader with a YUV_420_888 format, respectively.
6. The application then needs to construct a CaptureRequest, which defines all the capture parameters needed by a camera device to capture a single image.
7. The request also lists which of the configured output Surfaces should be used as targets for this capture.
8. The CameraDevice has a factory method for creating a request builder for a given use case, which is optimized for the Android device the application is running on.
9. Once the request has been set up, it can be handed to the active capture session either for a one-shot capture or for an endlessly repeating use.
10. After processing a request, the camera device will produce a TotalCaptureResult object, which contains information about the state of the camera device at time of capture, and the final settings used