输出照片日志信息

lowmem
Matthew 2 months ago
parent a52255e9d9
commit f2f29482a0

@ -2721,47 +2721,49 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr<ACameraMetadata> characteristics
cameraInfo = BuildCaptureResultInfo(result.get(), ldr, duration, false); 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 #ifdef OUTPUT_DBG_INFO
#if 0 #if 0
bool shouldRetry = false; bool shouldRetry = false;
if (ldr != ~0) if (ldr != ~0)
{ {
if (ldr < MIN_LIGHT_Y) if (ldr < MIN_LIGHT_Y)
{ {
if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1))
{ {
shouldRetry = true; shouldRetry = true;
char presetBuf[16] = {0}; char presetBuf[16] = {0};
snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries);
// replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg");
replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_"));
XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it",
(uint32_t) captureResult.avgY); (uint32_t) captureResult.avgY);
// photoInfo.usingRawFormat = 1; // photoInfo.usingRawFormat = 1;
} }
} }
else if (ldr > MAX_LIGHT_Y) else if (ldr > MAX_LIGHT_Y)
{ {
if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1)) if (photoInfo.retries < (DEFAULT_TAKE_PHOTO_RETRIES - 1))
{ {
shouldRetry = true; shouldRetry = true;
char presetBuf[16] = {0}; char presetBuf[16] = {0};
snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries); snprintf(presetBuf, sizeof(presetBuf), "%02X", photoInfo.retries);
// replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg"); // replaceAll(fullPath, ".jpg", std::string("-") + std::to_string(photoInfo.retries) + ".jpg");
replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_")); replaceAll(fullPath, "_FF_", std::string("_") + presetBuf + std::string("_"));
XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it", XYLOG(XYLOG_SEVERITY_ERROR, "Photo is TOO dark or light(LDR=%u), will RETRY it",
(uint32_t) captureResult.avgY); (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 // 0
#endif // OUTPUT_DBG_INFO #endif // OUTPUT_DBG_INFO
// Notify to take next photo // 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); pThis->TakePhotoCb(1, photoInfo, "", takingTime);
bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb); bool res = pThis->PostProcessPhoto(photoInfo, osds, path, cameraInfo, rgb);

Loading…
Cancel
Save