From c021076d1e7d713d701c9c92a7480972e3a03fed Mon Sep 17 00:00:00 2001 From: BlueMatthew Date: Sun, 7 Jan 2024 16:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8B=8D=E7=85=A7=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/camera2/ndkcamera.cpp | 8 +++++++- app/src/main/cpp/camera2/ndkcamera.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index 7439c27a..8921db39 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -743,7 +743,7 @@ void NdkCamera::onCaptureCompleted(ACameraCaptureSession* session, ACaptureReque } } - if (m_imagesCaptured != 0) + if (m_imagesCaptured != 0 || camera_facing == 2) { return; } @@ -771,6 +771,12 @@ void NdkCamera::onCaptureCompleted(ACameraCaptureSession* session, ACaptureReque } mResult.FocusDistance = focusDistance; + val = { 0 }; + status = ACameraMetadata_getConstEntry(result, ACAMERA_CONTROL_AF_STATE, &val); + mResult.afState = *(val.data.u8); + + ALOGW("onCaptureProgressed AF_STATE=%u", (unsigned int)afState); + val = {0}; status = ACameraMetadata_getConstEntry(result, ACAMERA_SENSOR_SENSITIVITY, &val); mResult.sensitibity = *(val.data.i32); diff --git a/app/src/main/cpp/camera2/ndkcamera.h b/app/src/main/cpp/camera2/ndkcamera.h index 99344315..9f8aab4d 100644 --- a/app/src/main/cpp/camera2/ndkcamera.h +++ b/app/src/main/cpp/camera2/ndkcamera.h @@ -52,6 +52,7 @@ public: { uint8_t autoFocus; uint8_t autoExposure; + uint8_t afState; int64_t exposureTime; float FocusDistance; int32_t sensitibity;