本文整理汇总了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);
}
}
示例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));
}