私はSamsung S5
にcamera2APIと協力し、私はフォーカスの状態を取得しようとした場合、私はCaptureResult.CONTROL_AF_STATE_INACTIVE
に等しい値0
を取得...なぜ私はresult.get(CaptureResult.CONTROL_AF_STATE)を取得しますか? ==無効ですか?
コードのスニップがあります:
private void process(CaptureResult result) {
switch (mState) {
case CameraHelper.STATE_PREVIEW: {
// We have nothing to do when the camera preview is working normally.
here i get ---> Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
if (CaptureResult.CONTROL_AF_TRIGGER_START == afState) {
if (areWeFocused) {
Log.e("---!!! HERE !!!--- :", String.valueOf(areWeFocused));
}else {
}
}
if (CaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED == afState) {
areWeFocused = true;
} else {
areWeFocused = false;
}
break;
}
しかし、私はまたしてみました私Meizu MX5
上でそれをテストし、私は1
取得 - CaptureResult.CONTROL_AF_TRIGGER_START
または2
からCaptureResult.CONTROL_AF_STATE_PASSIVE_FOCUSED
質問がある:私のコードの違いは何ですか? 1つのケースでは0
、別のケースでは1 or 2
となるのはなぜですか?
この問題に対する解決策をお探しですか? – Donato
@Donato本当に私は覚えていない... –