fix focusing during recording

This commit is contained in:
tibbi 2018-06-07 23:36:33 +02:00
parent df2493c0c2
commit 4d06be8b4d
1 changed files with 9 additions and 1 deletions

View File

@ -569,7 +569,15 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
} }
set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO) set(CaptureRequest.CONTROL_MODE, CameraMetadata.CONTROL_MODE_AUTO)
set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START)
val trigger = if (mIsRecording) {
set(CaptureRequest.CONTROL_AF_MODE, CameraMetadata.CONTROL_AF_MODE_CONTINUOUS_VIDEO)
CameraMetadata.CONTROL_AF_TRIGGER_IDLE
} else {
CameraMetadata.CONTROL_AF_TRIGGER_START
}
set(CaptureRequest.CONTROL_AF_TRIGGER, trigger)
setTag(FOCUS_TAG) setTag(FOCUS_TAG)
mCaptureSession!!.capture(build(), captureCallbackHandler, mBackgroundHandler) mCaptureSession!!.capture(build(), captureCallbackHandler, mBackgroundHandler)
} }