江澎涌
unread,Dec 25, 2021, 3:52:02 AM12/25/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Android CameraX Discussion Group, 江澎涌, Scott Nien, Android CameraX Discussion Group
Hi, Scott.
I use the code to search current af_mode value and the return value is null.
```
val camera2CameraControl = Camera2CameraControl.from(cameraControl)
val captureRequestOptions = camera2CameraControl.captureRequestOptions
val captureRequestOption =captureRequestOptions.getCaptureRequestOption(CaptureRequest.CONTROL_AF_MODE)
// the captureRequestOption value is null
Log.e(CameraFragment.TAG, "captureRequestOption: $captureRequestOption")
```
And then, I try to set `CONTROL_AF_MODE_CONTINUOUS_PICTURE` parameters via this code.
```
val camera2CameraControl = Camera2CameraControl.from(camera!!.cameraControl)
camera2CameraControl.captureRequestOptions = CaptureRequestOptions.Builder()
.setCaptureRequestOption(
CaptureRequest.CONTROL_AF_MODE,
CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE
)
.build()
```
It will make the `startFocusAndMetering` api doesn't work, which always show an error like this.
```
java.util.concurrent.ExecutionException: androidx.camera.core.CameraControl$OperationCanceledException: Cancelled by another startFocusAndMetering()
```
And the preview page seem doesn't auto continuous foucs. How can I do?