public class LegacyFaceDetectMapper extends Object
Constructor and Description |
---|
LegacyFaceDetectMapper(Camera camera,
CameraCharacteristics characteristics)
Instantiate a new face detect mapper.
|
Modifier and Type | Method and Description |
---|---|
void |
mapResultFaces(CameraMetadataNative result,
LegacyRequest legacyRequest)
Update the
result camera metadata map with the new value for the
statistics.faces and statistics.faceDetectMode . |
void |
processFaceDetectMode(CaptureRequest captureRequest,
Camera.Parameters parameters)
Process the face detect mode from the capture request into an api1 face detect toggle.
|
public LegacyFaceDetectMapper(Camera camera, CameraCharacteristics characteristics)
camera
- a non-null
camera1 devicecharacteristics
- a non-null
camera characteristics for that camera1NullPointerException
- if any of the args were null
public void processFaceDetectMode(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
will have the latest faces detected 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 mapResultFaces(CameraMetadataNative result, LegacyRequest legacyRequest)
result
camera metadata map with the new value for the
statistics.faces
and statistics.faceDetectMode
.
Face detect callbacks are processed in the background, and each call to
mapResultFaces(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.LegacyRequest)
will have the latest faces as reflected by the camera1 callbacks.
If the scene mode was set to FACE_PRIORITY
but face detection is disabled,
the camera will still run face detection in the background, but no faces will be reported
in the capture result.
result
- a non-null
resultlegacyRequest
- a non-null
request (read-only)