From 91a67feddebfc14bdd34636ed03049ca89ceda4a Mon Sep 17 00:00:00 2001 From: Matthew Date: Sun, 12 May 2024 10:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B0=83=E7=94=A8=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/camera2/ndkcamera.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index 236fd4c8..9a0b4711 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -491,10 +491,7 @@ int NdkCamera::open(const std::string& cameraId) { } if (afSupported && m_params.autoFocus) { - // uint8_t afMode = ACAMERA_CONTROL_AF_MODE_CONTINUOUS_VIDEO; - uint8_t afMode = ACAMERA_CONTROL_AF_MODE_CONTINUOUS_PICTURE; - // uint8_t afMode = ACAMERA_CONTROL_AF_MODE_AUTO; - status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_MODE, 1, &afMode); + if (!m_params.zoom) { @@ -516,6 +513,12 @@ int NdkCamera::open(const std::string& cameraId) { #endif } } + + // uint8_t afMode = ACAMERA_CONTROL_AF_MODE_CONTINUOUS_VIDEO; + uint8_t afMode = ACAMERA_CONTROL_AF_MODE_CONTINUOUS_PICTURE; + // uint8_t afMode = ACAMERA_CONTROL_AF_MODE_AUTO; + status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_MODE, 1, &afMode); + uint8_t trig = ACAMERA_CONTROL_AF_TRIGGER_CANCEL; // status = ACaptureRequest_setEntry_u8(capture_request, ACAMERA_CONTROL_AF_TRIGGER, 1, &trig);