From 52e2b5f0649602de95310a067f6c2cb7452d5fd4 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 24 Feb 2025 19:38:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E5=9B=BE=E7=89=87=E7=9A=84=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 35 ++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index c389b26b..cf24a6a9 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -2254,6 +2254,12 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr characteristics closeThread.detach(); } + if (rgb.empty()) + { + TakePhotoCb(0, photoInfo, "", takingTime); + return true; + } + CPhoneDevice* pThis = this; std::thread th([pThis, characteristics, result, photoInfo, osds, path, rgb, facing, sensorOrientation, ldr, duration, takingTime]() { @@ -2697,11 +2703,20 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi } cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR); #endif // USING_EXEC_HDRP - bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb); - if (res) + + if (rgb.empty()) { - // TakePhotoCb(2, photoInfo, path, takingTime); + pThis->TakePhotoCb(0, photoInfo, path, takingTime); + } + else + { + bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb); + if (res) + { + // TakePhotoCb(2, photoInfo, path, takingTime); + } } + }); th.detach(); @@ -3011,11 +3026,19 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi cv::cvtColor(rgb, rgb, cv::COLOR_RGB2BGR); } - bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb); - if (res) + if (rgb.empty()) + { + pThis->TakePhotoCb(0, photoInfo, path, takingTime); + } + else { - // TakePhotoCb(2, photoInfo, path, takingTime); + bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb); + if (res) + { + // TakePhotoCb(2, photoInfo, path, takingTime); + } } + }); th.detach();