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();