Example usage for android.hardware.camera2 CameraMetadata CONTROL_AF_TRIGGER_IDLE

List of usage examples for android.hardware.camera2 CameraMetadata CONTROL_AF_TRIGGER_IDLE

Introduction

In this page you can find the example usage for android.hardware.camera2 CameraMetadata CONTROL_AF_TRIGGER_IDLE.

Prototype

int CONTROL_AF_TRIGGER_IDLE

To view the source code for android.hardware.camera2 CameraMetadata CONTROL_AF_TRIGGER_IDLE.

Click Source Link

Document

The trigger is idle.

Usage

From source file:com.ape.camera2raw.Camera2RawFragment.java

/**
 * Called after a RAW/JPEG capture has completed; resets the AF trigger state for the
 * pre-capture sequence.//from   w  w  w  . j  av a2  s.  co  m
 * <p/>
 * Call this only with {@link #mCameraStateLock} held.
 */
private void finishedCaptureLocked() {
    try {
        // Reset the auto-focus trigger in case AF didn't run quickly enough.
        if (!mNoAFRun) {
            mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
                    CameraMetadata.CONTROL_AF_TRIGGER_CANCEL);

            mCaptureSession.capture(mPreviewRequestBuilder.build(), mPreCaptureCallback, mBackgroundHandler);

            mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
                    CameraMetadata.CONTROL_AF_TRIGGER_IDLE);
        }
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}