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


Java CameraCharacteristics.CONTROL_AF_MODE_OFF属性代码示例

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


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

示例1: updateAutoFocus

/**
 * Updates the internal state of auto-focus to {@link #mAutoFocus}.
 */
void updateAutoFocus() {
    if (mAutoFocus) {
        int[] modes = mCameraCharacteristics.get(
                CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES);
        // Auto focus is not supported
        if (modes == null || modes.length == 0 ||
                (modes.length == 1 && modes[0] == CameraCharacteristics.CONTROL_AF_MODE_OFF)) {
            mAutoFocus = false;
            mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
                    CaptureRequest.CONTROL_AF_MODE_OFF);
        } else {
            mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
                    CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE);
        }
    } else {
        mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_MODE,
                CaptureRequest.CONTROL_AF_MODE_OFF);
    }
}
 
开发者ID:vshkl,项目名称:PXLSRT,代码行数:22,代码来源:Camera2.java

示例2: checkAutoFocusSupported

/**
 * Check if the auto focus is supported.
 */
private void checkAutoFocusSupported() {
    int[] modes = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES);
    mAutoFocusSupported = !(modes == null || modes.length == 0 ||
        (modes.length == 1 && modes[0] == CameraCharacteristics.CONTROL_AF_MODE_OFF));
}
 
开发者ID:lytcom,项目名称:CameraKitView,代码行数:8,代码来源:Camera2Fragment.java


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