From 4feeb05a2ba6a60d914c971f7d128b876c06e5fd Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 4 Jul 2024 09:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=9B=BE=E5=83=8F=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=BAYUV?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/camera2/ndkcamera.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/cpp/camera2/ndkcamera.cpp b/app/src/main/cpp/camera2/ndkcamera.cpp index 556eda86..b9201606 100644 --- a/app/src/main/cpp/camera2/ndkcamera.cpp +++ b/app/src/main/cpp/camera2/ndkcamera.cpp @@ -207,7 +207,7 @@ int NdkCamera::selfTest(const std::string& cameraId, int32_t& maxResolutionX, in int32_t format = e.data.i32[i + 0]; if (input) continue; - if (format == AIMAGE_FORMAT_YUV_420_888 || format == AIMAGE_FORMAT_JPEG) + if (format == AIMAGE_FORMAT_YUV_420_888/* || format == AIMAGE_FORMAT_JPEG*/) { if (e.data.i32[i + 1] * e.data.i32[i + 2] > (maxResolutionX * maxResolutionY)) { @@ -286,15 +286,15 @@ int NdkCamera::open(const std::string& cameraId) { for (int i = 0; i < e.count; i += 4) { - int32_t input = e.data.i32[i + 3]; - int32_t format = e.data.i32[i + 0]; if (input) continue; - // if (format == AIMAGE_FORMAT_YUV_420_888 || format == AIMAGE_FORMAT_JPEG) + if (format == AIMAGE_FORMAT_YUV_420_888/* || format == AIMAGE_FORMAT_JPEG*/) { DisplayDimension res(e.data.i32[i + 1], e.data.i32[i + 2]); + XYLOG(XYLOG_SEVERITY_DEBUG, "CameraId=%s CX=%d CY=%d", cameraId.c_str(), res.width(), res.height()); if (!disp.IsSameRatio(res)) { + if (res.width() >= mWidth && res.height() >= mHeight) { temp = res;