试图实现点击focus
使用camera2api
.
CaptureRequest.Builder afBuilder = mPreviewBuilder;
Rect newRect=new Rect(0,0,200,200);
MeteringRectangle meteringRectangle=new MeteringRectangle(newRect,METERING_WEIGHT_DONT_CARE);
MeteringRectangle[] areas = afBuilder.get(CaptureRequest.CONTROL_AF_REGIONS);
mPreviewBuilder.set(CaptureRequest.CONTROL_AF_REGIONS,areas);
mPreviewBuilder.set(CaptureRequest.CONTROL_AF_MODE, CameraMetadata.CONTROL_AF_MODE_AUTO);
mPreviewBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_START);
mPreviewSession.setRepeatingRequest(mPreviewBuilder.build(), mCaptureCallback, mBackgroundHandler);
在我的回电中,我不断地陷入一种ACTIVE_SCAN
状态,偶尔也会进入这种FOCUS_NOT_LOCKED
状态。我似乎永远无法进入FOCUS_LOCKED
状态,并且预览看起来永远不会集中。
使用三星 Galaxy Note 3。