public class LegacyFocusStateMapper extends Object
This object will asynchronously process auto-focus changes, so no interaction with it is necessary beyond reading the current state and updating with the latest trigger.
Constructor and Description |
---|
LegacyFocusStateMapper(Camera camera)
Instantiate a new focus state mapper.
|
Modifier and Type | Method and Description |
---|---|
void |
mapResultTriggers(CameraMetadataNative result)
Update the
result camera metadata map with the new value for the
control.afState . |
void |
processRequestTriggers(CaptureRequest captureRequest,
Camera.Parameters parameters)
Process the AF triggers from the request as a camera1 autofocus routine.
|
public LegacyFocusStateMapper(Camera camera)
camera
- a non-null
camera1 deviceNullPointerException
- if any of the args were null
public void processRequestTriggers(CaptureRequest captureRequest, Camera.Parameters parameters)
This method should be called after the parameters are mapped
with the request.
Callbacks are processed in the background, and the next call to mapResultTriggers(android.hardware.camera2.impl.CameraMetadataNative)
will have the latest AF state as reflected by the camera1 callbacks.
None of the arguments will be mutated.
captureRequest
- a non-null
requestparameters
- a non-null
parameters corresponding to this request (read-only)public void mapResultTriggers(CameraMetadataNative result)
result
camera metadata map with the new value for the
control.afState
.
AF callbacks are processed in the background, and each call to mapResultTriggers(android.hardware.camera2.impl.CameraMetadataNative)
will have the latest AF state as reflected by the camera1 callbacks.
result
- a non-null
result