From f2f29482a0a2a05bdfb8832e0f43b487642e2860 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 22 Apr 2025 15:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=85=A7=E7=89=87=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 68 ++++++++++++++++---------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index e75f78ab..f1e1c5c1 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -2721,47 +2721,49 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr characteristics cameraInfo = BuildCaptureResultInfo(result.get(), ldr, duration, false); } + XYLOG(XYLOG_SEVERITY_DEBUG, "Photo Result CH=%u PR=%u IMGID=%u %s", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.preset, (uint32_t)photoInfo.photoId, cameraInfo.c_str()); + #ifdef OUTPUT_DBG_INFO #if 0 -bool shouldRetry = false; -if (ldr != ~0) -{ - if (ldr < MIN_LIGHT_Y) - { - if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) - { - shouldRetry = true; - char presetBuf[16] = {0}; - snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); - // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); - replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); - XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", - (uint32_t) captureResult.avgY); + bool shouldRetry = false; + if (ldr != ~0) + { + if (ldr < MIN_LIGHT_Y) + { + if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) + { + shouldRetry = true; + char presetBuf[16] = {0}; + snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); + // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); + replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); + XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", + (uint32_t) captureResult.avgY); - // photoInfo.usingRawFormat = 1; - } - } - else if (ldr > MAX_LIGHT_Y) - { - if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) - { - shouldRetry = true; - char presetBuf[16] = {0}; - snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); - // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); - replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); - XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", - (uint32_t) captureResult.avgY); - } + // photoInfo.usingRawFormat = 1; + } + } + else if (ldr > MAX_LIGHT_Y) + { + if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) + { + shouldRetry = true; + char presetBuf[16] = {0}; + snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); + // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); + replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); + XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", + (uint32_t) captureResult.avgY); + } - photoInfo.compensation = -2 * ((int16_t) ((uint16_t) captureResult.avgY)); - } -} + photoInfo.compensation = -2 * ((int16_t) ((uint16_t) captureResult.avgY)); + } + } #endif // 0 #endif // OUTPUT_DBG_INFO // Notify to take next photo - XYLOG(XYLOG_SEVERITY_INFO, "TP: Notofy to Take Next CUR Info: CH=%u PR=%u PHOTOID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.preset, (uint32_t)photoInfo.photoId); + XYLOG(XYLOG_SEVERITY_INFO, "TP: Notofy to Take Next CUR Info: CH=%u PR=%u IMGID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.preset, (uint32_t)photoInfo.photoId); pThis->TakePhotoCb(1, photoInfo, "", takingTime); bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);