当前位置: 首页>>代码示例>>Java>>正文


Java CaptureResult.CONTROL_AWB_STATE_CONVERGED属性代码示例

本文整理汇总了Java中android.hardware.camera2.CaptureResult.CONTROL_AWB_STATE_CONVERGED属性的典型用法代码示例。如果您正苦于以下问题:Java CaptureResult.CONTROL_AWB_STATE_CONVERGED属性的具体用法?Java CaptureResult.CONTROL_AWB_STATE_CONVERGED怎么用?Java CaptureResult.CONTROL_AWB_STATE_CONVERGED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.hardware.camera2.CaptureResult的用法示例。


在下文中一共展示了CaptureResult.CONTROL_AWB_STATE_CONVERGED属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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


注:本文中的android.hardware.camera2.CaptureResult.CONTROL_AWB_STATE_CONVERGED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。