diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index ab571788..5298a782 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -14,6 +14,25 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wformat set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") # SET_TARGET_PROPERTIES(microphoto PROPERTIES LINK_FLAGS "-Wl,-s,--gc-sections") + +add_definitions(-DUSING_ETHERNET) + +if(ANDROID_ABI STREQUAL "armeabi-v7a") + add_definitions(-DUSING_N938) +elseif(ANDROID_ABI STREQUAL "arm64-v8a") + # add_definitions(-DUSING_N938) + #add_definitions(-DUSING_PLZ) +endif() + +# OUTPUT_DBG_INFO: 输出调试相关信息 +add_definitions(-DOUTPUT_DBG_INFO) +# OUTPUT_SOCKET_DBG_INFO Depends ON OUTPUT_DBG_INFO +# TerminalService.cpp +add_definitions(-DOUTPUT_SOCKET_DBG_INFO) +# OUTPUT_DB_DBG_INFO Depends ON OUTPUT_DBG_INFO +# Database.cpp +add_definitions(-DOUTPUT_DB_DBG_INFO) + IF (CMAKE_BUILD_TYPE STREQUAL Debug) ADD_DEFINITIONS(-D_DEBUG) ELSE() @@ -36,8 +55,7 @@ add_definitions(-DHAVE_STRING_H) # for memcpy in md5.c # add_definitions(-DUSING_NRSEC_VPN) # add_definitions(-DUSING_CERT) # add_definitions(-DUSING_DOWSE) -# OUTPUT_CAMERA_DBG_INFO: 照片上打印CARERA相关信息 -# add_definitions(-DOUTPUT_CAMERA_DBG_INFO) + add_definitions(-DALIGN_HB_TIMER_TO_PHOTO) add_definitions(-DENABLE_3V3_ALWAYS) add_definitions(-DCURL_STATICLIB) @@ -46,15 +64,6 @@ add_definitions(-DUSING_HDRPLUS) add_definitions(-DUSING_EXEC_HDRP=1) set(USING_EXEC_HDRP 1) -add_definitions(-DUSING_ETHERNET) - -if(ANDROID_ABI STREQUAL "armeabi-v7a") - add_definitions(-DUSING_N938) -elseif(ANDROID_ABI STREQUAL "arm64-v8a") - # add_definitions(-DUSING_N938) - # add_definitions(-DUSING_PLZ) -endif() - # include_directories(${OpenCV_DIR}/include) # add_library( lib_opencv SHARED IMPORTED ) # set_target_properties(lib_opencv PROPERTIES IMPORTED_LOCATION ${OpenCV_DIR}/../libs/${ANDROID_ABI}/libopencv_java4.so) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 804ce511..5cb5a1b8 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -2272,7 +2272,7 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr characteristics cameraInfo = str; } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO #if 0 bool shouldRetry = false; if (ldr != ~0) @@ -2309,7 +2309,7 @@ bool CPhoneDevice::onOneCapture(std::shared_ptr characteristics } } #endif // 0 -#endif // OUTPUT_CAMERA_DBG_INFO +#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); @@ -2414,7 +2414,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi } } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO #if 0 bool shouldRetry = false; if (ldr != ~0) @@ -2451,7 +2451,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi } } #endif // 0 -#endif // OUTPUT_CAMERA_DBG_INFO +#endif // OUTPUT_DBG_INFO // Notify to take next photo pThis->TakePhotoCb(1, photoInfo, "", takingTime); @@ -2911,7 +2911,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi } } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO #if 0 bool shouldRetry = false; if (ldr != ~0) @@ -2948,7 +2948,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi } } #endif // 0 -#endif // OUTPUT_CAMERA_DBG_INFO +#endif // OUTPUT_DBG_INFO // Notify to take next photo pThis->TakePhotoCb(1, photoInfo, "", takingTime); @@ -3189,7 +3189,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) pt.x = it->x + it->w - textSize.width; } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO char buf[128]; snprintf(buf, sizeof(buf), "AI: %d=%s (%f,%f)-(%f,%f) Text:(%d,%d)-(%d,%d)", it->label, item.name.c_str(), it->x, it->y, it->w, it->h, pt.x, pt.y, textSize.width, textSize.height); @@ -3206,7 +3206,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) XYLOG(XYLOG_SEVERITY_WARNING, "Channel AI Disabled"); } -// #ifdef OUTPUT_CAMERA_DBG_INFO +// #ifdef OUTPUT_DBG_INFO if (mCamera != NULL) { @@ -3242,7 +3242,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) // DrawOutlineText(ft2, mat, str, cv::Point(0, mat.rows - fs - 20 * ratio), fs, scalarWhite, 1); } } -// #endif // OUTPUT_CAMERA_DBG_INFO +// #endif // OUTPUT_DBG_INFO for (vector::const_iterator it = mOsds.cbegin(); it != mOsds.cend(); ++it) { @@ -3294,7 +3294,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) bool res = false; std::string fullPath = endsWith(mPath, ".jpg") ? mPath : (mPath + CTerminal::BuildPhotoFileName(mPhotoInfo)); -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO bool shouldRetry = false; #if 0 @@ -3334,7 +3334,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) } #endif -#endif // OUTPUT_CAMERA_DBG_INFO +#endif // OUTPUT_DBG_INFO if (!std::filesystem::exists(std::filesystem::path(fullPath)) || getFileSize(fullPath) == 0) { @@ -3347,7 +3347,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat mat) { XYLOG(XYLOG_SEVERITY_INFO, "Succeeded to write photo: %s", fullPath.c_str()); } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO if (shouldRetry) { TakePhotoCb(0, mPhotoInfo, fullPath, takingTime, objs); @@ -3479,7 +3479,7 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vectorx + it->w - textSize.width; } -#ifdef OUTPUT_CAMERA_DBG_INFO +#ifdef OUTPUT_DBG_INFO char buf[128]; snprintf(buf, sizeof(buf), "AI: %d=%s (%f,%f)-(%f,%f) Text:(%d,%d)-(%d,%d)", it->label, item.name.c_str(), it->x, it->y, it->w, it->h, pt.x, pt.y, textSize.width, textSize.height); @@ -3496,7 +3496,7 @@ bool CPhoneDevice::PostProcessPhoto(const PHOTO_INFO& photoInfo, const vector::const_iterator it = osds.cbegin(); it != osds.cend(); ++it) {