當前位置: 首頁>>代碼示例>>Java>>正文


Java CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED屬性代碼示例

本文整理匯總了Java中android.hardware.camera2.CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED屬性的典型用法代碼示例。如果您正苦於以下問題:Java CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED屬性的具體用法?Java CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED怎麽用?Java CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.hardware.camera2.CaptureResult的用法示例。


在下文中一共展示了CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: stateFromCamera2State

/**
 * Convert reported camera2 AF state to OneCamera AutoFocusState.
 */
public static OneCamera.AutoFocusState stateFromCamera2State(int state) {
    switch (state) {
        case CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN:
            return OneCamera.AutoFocusState.ACTIVE_SCAN;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_SCAN:
            return OneCamera.AutoFocusState.PASSIVE_SCAN;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED:
            return OneCamera.AutoFocusState.PASSIVE_FOCUSED;
        case CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED:
            return OneCamera.AutoFocusState.ACTIVE_FOCUSED;
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED:
            return OneCamera.AutoFocusState.PASSIVE_UNFOCUSED;
        case CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
            return OneCamera.AutoFocusState.ACTIVE_UNFOCUSED;
        default:
            return OneCamera.AutoFocusState.INACTIVE;
    }
}
 
開發者ID:jameliu,項目名稱:Camera2,代碼行數:21,代碼來源:AutoFocusHelper.java

示例2: controlAFStateToString

/**
 * Utility function: converts CaptureResult.CONTROL_AF_STATE to String.
 */
private static String controlAFStateToString(int controlAFState) {
    switch (controlAFState) {
        case CaptureResult.CONTROL_AF_STATE_INACTIVE:
            return "inactive";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_SCAN:
            return "passive_scan";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED:
            return "passive_focused";
        case CaptureResult.CONTROL_AF_STATE_ACTIVE_SCAN:
            return "active_scan";
        case CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED:
            return "focus_locked";
        case CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED:
            return "not_focus_locked";
        case CaptureResult.CONTROL_AF_STATE_PASSIVE_UNFOCUSED:
            return "passive_unfocused";
        default:
            return "unknown";
    }
}
 
開發者ID:jameliu,項目名稱:Camera2,代碼行數:23,代碼來源:AutoFocusHelper.java

示例3: process

private void process(CaptureResult captureResult) {
    switch (mCaptureState) {
        case STATE_PREVIEW:
            // Do nothing
            break;
        case STATE_WAIT_LOCK:
            mCaptureState = STATE_PREVIEW;
            Integer afState = captureResult.get(CaptureResult.CONTROL_AF_STATE);
            if(afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED ||
                    afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED) {
                Toast.makeText(getApplicationContext(), "AF Locked!", Toast.LENGTH_SHORT).show();
                startStillCaptureRequest();
            }
            break;
    }
}
 
開發者ID:mobapptuts,項目名稱:android_camera2_api_video_app,代碼行數:16,代碼來源:Camera2VideoImageActivity.java

示例4: process

private void process(CaptureResult result) {
    synchronized (mCameraStateLock) {
        switch (mState) {
            case STATE_PREVIEW: {
                // We have nothing to do when the camera preview is running normally.
                break;
            }
            case STATE_WAITING_FOR_3A_CONVERGENCE: {
                boolean readyToCapture = true;
                if (!mNoAFRun) {
                    Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
                    if (afState == null) {
                        break;
                    }

                    // If auto-focus has reached locked state, we are ready to capture
                    readyToCapture =
                            (afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED ||
                                    afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED);
                }

                // If we are running on an non-legacy device, we should also wait until
                // auto-exposure and auto-white-balance have converged as well before
                // taking a picture.
                if (!CameraDeviceCapability.isLegacyLocked(mCharacteristics)) {
                    Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
                    Integer awbState = result.get(CaptureResult.CONTROL_AWB_STATE);
                    if (aeState == null || awbState == null) {
                        break;
                    }

                    readyToCapture = readyToCapture &&
                            aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED &&
                            awbState == CaptureResult.CONTROL_AWB_STATE_CONVERGED;
                }

                // If we haven't finished the pre-capture sequence but have hit our maximum
                // wait timeout, too bad! Begin capture anyway.
                if (!readyToCapture && hitTimeoutLocked()) {
                    Log.w(TAG, "Timed out waiting for pre-capture sequence to complete.");
                    readyToCapture = true;
                }

                if (readyToCapture && mPendingUserCaptures > 0) {
                    // Capture once for each user tap of the "Picture" button.
                    while (mPendingUserCaptures > 0) {
                        captureStillPictureLocked();
                        mPendingUserCaptures--;
                    }
                    // After this, the camera will go back to the normal state of preview.
                    mState = STATE_PREVIEW;
                }
            }
        }
    }
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:56,代碼來源:Camera2RawFragment.java

示例5: setupJPEGCaptureListener

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void  setupJPEGCaptureListener() {
    mCaptureCallback = new CameraCaptureSession.CaptureCallback() {
       private void process(CaptureResult result) {
                switch (mState) {
                    case STATE_PREVIEW: {
                        // We have nothing to do when the camera preview is working normally.
                        break;
                    }
                    case STATE_WAITING_LOCK: {
                            int afState = result.get(CaptureResult.CONTROL_AF_STATE);
                            if (CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState ||
                                    CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) {
                                // CONTROL_AE_STATE can be null on some devices
                                Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
                                if (aeState == null ||
                                        aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED) {
                                    mState = STATE_WAITING_NON_PRECAPTURE;
                                    captureStillPicture();
                                } else {
                                    runPrecaptureSequence();
                                }
                            }
                        break;
                    }
                    case STATE_WAITING_PRECAPTURE: {
                            // CONTROL_AE_STATE can be null on some devices
                            Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
                            if (aeState == null ||
                                    aeState == CaptureResult.CONTROL_AE_STATE_PRECAPTURE ||
                                    aeState == CaptureRequest.CONTROL_AE_STATE_FLASH_REQUIRED) {
                                mState = STATE_WAITING_NON_PRECAPTURE;
                            }
                        break;
                    }
                    case STATE_WAITING_NON_PRECAPTURE: {
                            // CONTROL_AE_STATE can be null on some devices
                            Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
                            if (aeState == null || aeState != CaptureResult.CONTROL_AE_STATE_PRECAPTURE) {
                                mState = STATE_PICTURE_TAKEN;
                                captureStillPicture();
                            }
                        break;
                    }
                }
            }
        };
 }
 
開發者ID:tonyconstantinides,項目名稱:LiveMultimedia,代碼行數:48,代碼來源:LollipopCamera.java


注:本文中的android.hardware.camera2.CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。