From 707de491bb4a1305d6835c9d4ee9f3dc4005dfe5 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 22 Jul 2024 22:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B5=8B=E5=80=BC=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E9=81=BF=E5=85=8D=E9=81=97=E6=BC=8F=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/camera2/ndkcamera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index affa35d1..837b5c73 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -976,8 +976,6 @@ void NdkCamera::onImageAvailable(AImageReader* reader) mResult.duration = GetMicroTimeStamp() - m_startTime; - mFinalResult = mResult; - int32_t format; AImage_getFormat(image, &format); @@ -1021,6 +1019,8 @@ void NdkCamera::onImageAvailable(AImageReader* reader) mResult.avgY = avgY / y_len; #endif + mFinalResult = mResult; + if (u_data == v_data + 1 && v_data == y_data + width * height && y_pixelStride == 1 && u_pixelStride == 2 && v_pixelStride == 2 && y_rowStride == width && u_rowStride == width && v_rowStride == width) { // already nv21 :)