Reputation: 5243
In first camera i have such method
private void takePicture()
{
camera.autoFocus(new Camera.AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
camera.takePicture(shutterCallback, pictureCallback_RAW, pictureCallback_JPEG);
}
});
}
And it is convinient , when user take a picture , app is trying focused and than take a picture...
Question is : how a can implement in camera2API some callback or another way to wait until camera take a focus and that take a picture?
Upvotes: 1
Views: 521
Reputation: 13343
Try this sample project from Google (or just Camera2BasicFragment). In general You should request focus, than determine "focus lock" state in CameraCaptureSession.CaptureCallback
than capture image and finally request for unlock focus.
Upvotes: 1