问题
I need to set up CONTROL_SCENE_MODE_ACTION
for my app camera2API.
i tryed to set it captureStillPicture()
method then in lockFocus()
method then in stateCallback
but is doesn't work...
In documentation i found only explanation what it is, but any lines how this mode have to be set up...
There are 2 question:
- Where exacly i have to set up this mode
- How i can check that it is working
Or maybe you can suggest me how to reduse expose time...
Thanks in advance
回答1:
You can modify Camera2BasicFragment from Google Camera2Basic sample by add line
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_SCENE_MODE, CaptureRequest.CONTROL_SCENE_MODE_ACTION);
just after line
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
in onConfigured()
method of example
@Override
public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {
// The camera is already closed
if (null == mCameraDevice) {
return;
}
// When the session is ready, we start displaying the preview.
mCaptureSession = cameraCaptureSession;
try {
// Auto focus should be continuous for camera preview.
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_SCENE_MODE,
CaptureRequest.CONTROL_SCENE_MODE_ACTION);
// Flash is automatically enabled when necessary.
setAutoFlash(mPreviewRequestBuilder);
// Finally, we start displaying the camera preview.
mPreviewRequest = mPreviewRequestBuilder.build();
mCaptureSession.setRepeatingRequest(mPreviewRequest,
mCaptureCallback, mBackgroundHandler);
} catch (CameraAccessException e) {
e.printStackTrace();
}
}
来源:https://stackoverflow.com/questions/40259844/how-i-can-correctly-set-up-control-scene-mode-action-camera2api