安卓Camera API CaptureRequest
解读一下CaptureRequest类的官方注释
/**
* <p>An immutable package of settings and outputs needed to capture a single
* image from the camera device.</p>
*
* <p>Contains the configuration for the capture hardware (sensor, lens, flash),
* the processing pipeline, the control algorithms, and the output buffers. Also
* contains the list of target Surfaces to send image data to for this
* capture.</p>
*
* <p>CaptureRequests can be created by using a {@link Builder} instance,
* obtained by calling {@link CameraDevice#createCaptureRequest}</p>
*
* <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
* {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
*
* <p>Each request can specify a different subset of target Surfaces for the
* camera to send the captured data to. All the surfaces used in a request must
* be part of the surface list given to the last call to
* {@link CameraDevice#createCaptureSession}, when the request is submitted to the
* session.</p>
*
* <p>For example, a request meant for repeating preview might only include the
* Surface for the preview SurfaceView or SurfaceTexture, while a
* high-resolution still capture would also include a Surface from a ImageReader
* configured for high-resolution JPEG images.</p>
*
* <p>A reprocess capture request allows a previously-captured image from the camera device to be
* sent back to the device for further processing. It can be created with
* {@link CameraDevice#createReprocessCaptureRequest}, and used with a reprocessable capture session
* created with {@link CameraDevice#createReprocessableCaptureSession}.</p>
*
* @see CameraCaptureSession#capture
* @see CameraCaptureSession#setRepeatingRequest
* @see CameraCaptureSession#captureBurst
* @see CameraCaptureSession#setRepeatingBurst
* @see CameraDevice#createCaptureRequest
* @see CameraDevice#createReprocessCaptureRequest
*/
- CaptureRequest是什么:从Camera设置获取image图片的设置,包含硬件参数的设置,处理的pipeline,控制算法,输出buffer和surface等。
- 如何创建CaptureRequest:通过CaptureRequest.Builder实例,这个实例最开始是通过CameraDevice#createCaptureRequest得到的。
- 如果使用CaptureRequest:通过CameraCaptureSession#capture和CameraCaptureSession#setRepeatingRequest接口向Camera设备发送Request。
- 必须包含目标Surface:Request中用到的Surface必须是通过CameraDevice#createCaptureSession创建Session师的Surface列表的子集。
- 设置为预览的Request必须包含SurfaceView或SurfaceTexture的Surface,高分辨率拍照的Request包含ImageReader中的Surface。
|