本文整理匯總了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;
}
}
}
}
}