From 376b038c19226b3ca61b46d466821464a3f6866e Mon Sep 17 00:00:00 2001 From: Evgeny Gagua Date: Wed, 14 Feb 2024 09:17:57 -0800 Subject: [PATCH] Commented some debugging messages as DEBUG_EXTRA --- Projects/la_mojo/build | 2 +- Projects/la_mojo/la_mojo.vpj | 12 +-- Projects/la_mojo/makefile | 8 +- lib/App/common/deviceNode2D.cpp | 2 + lib/App/common/deviceNodeCamera.cpp | 37 ++++---- lib/App/common/kernelModuleEmbedVideo.cpp | 96 ++++++++++++-------- lib/components/object/objectSystemAnchor.cpp | 14 +-- lib/data/ponvif/ponvif.cpp | 12 ++- lib/data/protocol/protocolPTZ_ONVIF.cpp | 2 +- 9 files changed, 107 insertions(+), 78 deletions(-) diff --git a/Projects/la_mojo/build b/Projects/la_mojo/build index 98e25a11..922633e2 100755 --- a/Projects/la_mojo/build +++ b/Projects/la_mojo/build @@ -4,7 +4,7 @@ #make clean -e "CFG=Debug" #make -e "CFG=Debug" -j6 -#make clean -e "CFG=Debug86" +make clean -e "CFG=Debug86" make -e "CFG=Debug86" -j2 #make clean -e "CFG=Release86" diff --git a/Projects/la_mojo/la_mojo.vpj b/Projects/la_mojo/la_mojo.vpj index 39f616e2..73c7e0ef 100644 --- a/Projects/la_mojo/la_mojo.vpj +++ b/Projects/la_mojo/la_mojo.vpj @@ -14,7 +14,7 @@ Version="1" OutputFile="%bdmojo_d" CompilerConfigName="Latest Version" - Defines='"/DDEBUG" "/D__STDC_CONSTANT_MACROS" "/D_CLIENT_APPLICATION_" "/D_OPENCV_" "/DRASPI_HARDWARE"'> + Defines='"/DDEBUG" "/D__STDC_CONSTANT_MACROS__" "/D_CLIENT_APPLICATION_" "/D_OPENCV_" "/DRASPI_HARDWARE"'> - + + Defines='"/DDEBUG__" "/D__STDC_CONSTANT_MACROS" "/D_CLIENT_APPLICATION_" "/D_OPENCV_"'> - + updateCamRange( m_sCamData.id, m_fMaxRange ); + m_pDBC->updateCamRange(m_sCamData.id, m_fMaxRange); break; }; case 2:{ @@ -541,7 +541,7 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR ) if( db_id == 0 ) return false; CAM_TRACK_RECORD * tTrackRecords = (CAM_TRACK_RECORD * ) malloc( sizeof(CAM_TRACK_RECORD)); if( tTrackRecords == NULL ) return false; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Fusion: Consuming new Data!"); #endif memset(tTrackRecords, 0, sizeof(CAM_TRACK_RECORD)); @@ -556,11 +556,15 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR ) for( ; idx < m_vROIS.end(); idx++ ) if ( fusion_compare( *idx, tOR ) ) break; if ( idx != m_vROIS.end() ) { // have Match! +#ifdef DEBUG_EXTRA LOG("ROI MATCHED!"); +#endif (*idx)->targets.push_back( tTrackRecords ); fusion_validateROI( tTrackRecords->ts_ms, (*idx) ); } else { +#ifdef DEBUG_EXTRA LOG("NO MATCH FOUND!"); +#endif // No mathced ROI -> create new one CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI)); if ( tROI ) { @@ -584,7 +588,10 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR ) }; }; } else { - // empty ROIs -> create new one +#ifdef DEBUG_EXTRA + LOG("Fusion: NO ROI -> CREATE!"); +#endif + // CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI)); if ( tROI ) { memset( tROI, 0 , sizeof(CAM_ROI) ); @@ -607,7 +614,7 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR ) // Add ROI to vector tROI->targets.push_back( tTrackRecords ); m_vROIS.push_back( tROI ); - }; + } else LOG_ERROR("No MEM4ROI"); }; m_mROIsProtector.unlock(); return true; @@ -653,7 +660,6 @@ bool deviceNodeCamera::fusion_validateROI( uint64_t cts, CAM_ROI *ptr ){ ptr->min_range = calcMinDistance_mm( AC_imager_diag[m_sCamData.imager_type], cFL, m_nRealFrameWidth ); ptr->h_fov = rad2deg( calcFOV_mm(AC_imager_width[m_sCamData.imager_type], cFL) )/ 2.0f; // div to prevent division in comparation ptr->v_fov = rad2deg( calcFOV_mm( AC_imager_height[m_sCamData.imager_type], cFL ) )/ 2.0f; // function that will be called more ofthen - return true; }; }; @@ -752,15 +758,14 @@ bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, float PanPOS, float T LOG_ERROR("CMD malloc Error!"); free( tTask ); }; - } else { - LOG_ERROR("Task malloc error!"); - }; + } else LOG_ERROR("Task malloc error!"); }; return false; }; bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, C3D_ORIENT_ONVIF O ){ if( m_sCamData.online ){ + CAM_TASK *tTask = (CAM_TASK *)malloc(sizeof(CAM_TASK)); if( tTask ){ memset(tTask, 0, sizeof(CAM_TASK)); @@ -778,9 +783,7 @@ bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, C3D_ORIENT_ONVIF O ){ LOG_ERROR("CMD malloc Error!"); free( tTask ); }; - } else { - LOG_ERROR("Task malloc error!"); - }; + } else LOG_ERROR("Task malloc error!"); }; return false; }; @@ -949,7 +952,6 @@ void deviceNodeCamera::m_fThreadProc( void ){ NULL, NULL, NULL ); if( tEVT ){ //tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA - LOG("BCAST CAM GOTO"); m_pBEH->broadcast( tEVT ); }; }; @@ -957,6 +959,7 @@ void deviceNodeCamera::m_fThreadProc( void ){ m_fCP_Pan = m_pCurrentROI->cam_orientation.pan; m_fCP_Tilt = m_pCurrentROI->cam_orientation.tilt; m_fCP_Zoom = m_pCurrentROI->cam_orientation.zoom; + // Do Movement if( !m_pProtocol->goAbsolute( m_pCurrentROI->cam_orientation.pan, @@ -976,7 +979,9 @@ void deviceNodeCamera::m_fThreadProc( void ){ EVT_CAMERA_ON_POSITION, NULL, NULL, tData ); if( tEVT ){ +#ifdef DEBUG_EXTRA LOG("BCAST CAM ONPOS"); +#endif //tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA m_pBEH->broadcast( tEVT ); }; @@ -1287,7 +1292,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_WGS84_LOC L ){ systemAnchor* tSystem = systemAnchor::getInstance(); if( tSystem == NULL ) return false; C3D_SPH_DEGREES SL; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Look at WGS coords!"); #endif tSystem->convertToLocal(&m_oPosition, L, SL ); @@ -1298,7 +1303,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_DECART L ){ systemAnchor* tSystem = systemAnchor::getInstance(); if( tSystem == NULL ) return false; C3D_SPH_DEGREES SL; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Look at System Decart coords!"); #endif tSystem->convertToLocal( &m_oPosition, L, SL ); @@ -1307,7 +1312,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_DECART L ){ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_RADIANS L ){ C3D_SPH_DEGREES SL; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Look at spherical(rad) 2 spherical(deg) coords!"); #endif spherical2spherical( L, SL ); @@ -1320,7 +1325,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_DEGREES L ){ //LOG( tB ); //sprintf( tB, "Cam GoTo %.3f %.3f %.3f", fP, fT, fZ ); //LOG( tB ); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Look at local spherical deg. coords!(final)"); #endif //if( getWM() == CAM_WS_READY ){ diff --git a/lib/App/common/kernelModuleEmbedVideo.cpp b/lib/App/common/kernelModuleEmbedVideo.cpp index 5c87ec09..fab84b30 100644 --- a/lib/App/common/kernelModuleEmbedVideo.cpp +++ b/lib/App/common/kernelModuleEmbedVideo.cpp @@ -448,12 +448,12 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){ void kernelModuleEmbedVideo::m_fThreadProc( void ){ if( !m_bEnabled ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Module is Disabled!"); #endif return; }; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Module Started!"); #endif struct pollfd pfd[1]; @@ -475,7 +475,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){ // Handle Connections if( RetVal != 0 ){ if ( pfd[0].revents & POLLIN ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Handle New Client"); #endif int tSID = accept( pfd[0].fd, NULL, NULL); @@ -484,17 +484,17 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){ sprintf(tBuf, "Accept() error: %s", strerror(errno)); LOG_ERROR(tBuf); } else { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Accept OK"); #endif WEB_CLIENT_CTX *tCTX = (WEB_CLIENT_CTX *) malloc(sizeof(WEB_CLIENT_CTX)); if( tCTX ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("CTX OK"); #endif WEB_HANDLER *tHANDLER = (WEB_HANDLER *) malloc(sizeof(WEB_HANDLER)); if( tHANDLER ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("HANDLER OK"); #endif memset( tCTX, 0, sizeof(WEB_CLIENT_CTX) ); @@ -520,7 +520,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){ m_mWebHandlersProtector.lock(); m_vHandlersPool.push_back( tHANDLER ); m_mWebHandlersProtector.unlock(); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Handler Pushed to a Pool"); #endif }; @@ -542,7 +542,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){ if( m_vHandlersPool.size() ) { for( vectorHANDLERS::iterator idx = m_vHandlersPool.begin(); idx < m_vHandlersPool.end(); idx++ ) { if( !( (*idx)->CTX->bValid ) ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Have Dead Client!"); #endif pthread_join( (*idx)->m_hThreadHandle, NULL ); @@ -553,7 +553,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){ m_mWebHandlersProtector.lock(); m_vHandlersPool.erase(idx); m_mWebHandlersProtector.unlock(); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Web Handler Ripped!"); #endif }; @@ -601,7 +601,7 @@ bool kernelModuleEmbedVideo::startService(){ if( T.cols > 0 ) { cv::Mat mask; vector layers; -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Logo Loaded OK"); #endif cv::split( T, layers); // seperate channels @@ -617,14 +617,20 @@ bool kernelModuleEmbedVideo::startService(){ m_mLogoPic.copyTo( destinationROI, m_mLogoMask ); //m_sEmbedVideoData.show_logo = false; } else { +#ifdef DEBUG_EXTRA LOG("Logo Disabled - No Picture is Loaded"); +#endif m_sEmbedVideoData.show_logo = false; }; } else { +#ifdef DEBUG_EXTRA LOG("Logo Disabled - Wrong Coords"); +#endif m_sEmbedVideoData.show_logo = false; }; +#ifdef DEBUG_EXTRA LOG("Logo Draw OK"); +#endif }; try{ @@ -667,17 +673,23 @@ bool kernelModuleEmbedVideo::startService(){ LOG_ERROR("Failed binding Socket"); close( m_nSocketDescriptor ); return false; +#ifdef DEBUG_EXTRA } else { LOG("Bind Socessfull"); +#endif }; if( listen( m_nSocketDescriptor, 10) != 0 ){ LOG_ERROR("Failed setting web listen backlog"); close( m_nSocketDescriptor ); return false; +#ifdef DEBUG_EXTRA } else { LOG("Listen OK"); +#endif }; +#ifdef DEBUG_EXTRA LOG("Start Thread"); +#endif m_bEnabled = init(); return m_bEnabled; }; @@ -1733,7 +1745,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ //do { //In Any Case Close Stream if it Long enough if( m_nSegAFrameCounter > m_nAHardLimitFrames ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("HardLimit Reached!(A)"); #endif closeSegmentA(); @@ -1741,14 +1753,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ }; if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - ( m_nAPostAlarmFrames + m_nBPreAlarmFrames ))){ if ( !m_bSegBActive ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Start Alt!(A)"); #endif openSegmentB(); }; }; if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - m_nAPostAlarmFrames ) && !m_bActiveEncoderStream ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Swap Active!(A)"); #endif swapActiveStreams(); @@ -1759,7 +1771,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ //do { //In Any Case Close Stream if it Long enough if( m_nSegAFrameCounter > m_nHardLimitFrames ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("HardLimit Reached!(A)"); #endif closeSegmentA(); @@ -1767,14 +1779,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ }; if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){ if ( !m_bSegBActive ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Start Alt!(A)"); #endif openSegmentB(); }; }; if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && !m_bActiveEncoderStream ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Swap Active!(A)"); #endif swapActiveStreams(); @@ -1789,7 +1801,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ // do { //In Any Case Close Stream if it Long enough if( m_nSegBFrameCounter > m_nBHardLimitFrames ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("HardLimit Reached!(B)"); #endif closeSegmentB(); @@ -1797,14 +1809,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ }; if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - ( m_nBPostAlarmFrames + m_nAPreAlarmFrames ))){ if ( !m_bSegAActive ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Start Alt!(B)"); #endif openSegmentA(); }; }; if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - m_nBPostAlarmFrames ) && m_bActiveEncoderStream ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Swap Active!(B)"); #endif swapActiveStreams(); @@ -1815,7 +1827,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ // do { //In Any Case Close Stream if it Long enough if( m_nSegBFrameCounter > m_nHardLimitFrames ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("HardLimit Reached!(B)"); #endif closeSegmentB(); @@ -1823,14 +1835,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){ }; if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){ if ( !m_bSegAActive ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Start Alt!(B)"); #endif openSegmentA(); }; }; if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && m_bActiveEncoderStream ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Swap Active!(B)"); #endif swapActiveStreams(); @@ -1896,7 +1908,7 @@ void streamHandler::closeSegmentA( void ){ m_mCurrentOperationProtector.lock(); if ( m_bCOP == 0 ) m_bCOP = 0x01; m_mCurrentOperationProtector.unlock(); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Closing Stream A"); #endif }; @@ -1905,7 +1917,7 @@ void streamHandler::closeSegmentB( void ){ m_mCurrentOperationProtector.lock(); if ( m_bCOP == 0 ) m_bCOP = 0x02; m_mCurrentOperationProtector.unlock(); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Closing Stream B"); #endif }; @@ -2059,7 +2071,7 @@ bool streamHandler::openSegmentA( void ){ if( !m_pEncoderA->open( mn, fourcc, fps, fz ) ){ LOG_ERROR("Cannot Open Output Segment A!"); return false; - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { char tB[256]; sprintf( tB,"VideoStream A is Created [%s] %.2f fps", m_sStreamSegmentInfo[0].scratchPath, fps ); @@ -2213,7 +2225,7 @@ bool streamHandler::openSegmentB( void ){ if( !m_pEncoderB->open( mn, fourcc, fps, fz ) ){ LOG_ERROR("Cannot Open Output Segment B!"); return false; - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { char tB[256]; sprintf( tB,"VideoStream B is Created [%s] %.2f fps", m_sStreamSegmentInfo[1].scratchPath, fps ); @@ -2712,7 +2724,7 @@ bool streamHandler::initVideoOutput(){ #endif }; - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { LOG("output codec context is already opened"); #endif @@ -3054,7 +3066,7 @@ void streamHandler::m_fThreadProc( void ){ if ( m_bWebFrameSkeepDivider > EVE_EASE_FPS_DIVIDER_MAXIMUM ) { m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MAXIMUM; } else { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Video Quality Degraded!"); #endif EVENT_CONTAINER *bEVT = createBasicEvent( m_sStreamData.source_id, EVT_CLASS_VIDEO, EVT_VIDEO_FPS_DEGRADED, NULL, NULL, NULL ); @@ -3070,7 +3082,7 @@ void streamHandler::m_fThreadProc( void ){ if ( m_bWebFrameSkeepDivider < EVE_EASE_FPS_DIVIDER_MINIMUM ) { m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MINIMUM; } else { -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Video Quality Upgraded!"); #endif EVENT_CONTAINER *bEVT = createBasicEvent( m_sStreamData.source_id, EVT_CLASS_VIDEO, EVT_VIDEO_FPS_RAISED, NULL, NULL, NULL ); @@ -3199,7 +3211,7 @@ void streamHandler::m_fThreadProc( void ){ m_mCurrentOperationProtector.lock(); switch ( m_bCOP ) { case 0x01:{ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Actual Closing Video Stream A!"); LOG( m_sStreamSegmentInfo[0].scratchPath ); #endif @@ -3214,7 +3226,7 @@ void streamHandler::m_fThreadProc( void ){ #ifdef OPENCV_VIDEO_OUTPUT if ( m_pEncoderA->isOpened() ) { m_pEncoderA->release(); - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { LOG(" Encoder A is NOT Opened!"); #endif @@ -3228,7 +3240,7 @@ void streamHandler::m_fThreadProc( void ){ if ( bEVT ) { basicEventHeap::getInstance()->broadcast( bEVT ); } else LOG_ERROR( "Event Creation failure!"); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Stream A is Saved"); #endif } else { @@ -3241,7 +3253,7 @@ void streamHandler::m_fThreadProc( void ){ #ifdef OPENCV_VIDEO_OUTPUT if ( m_pEncoderA->isOpened() ) { m_pEncoderA->release(); - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { LOG(" Encoder A is NOT Opened!"); #endif @@ -3256,7 +3268,7 @@ void streamHandler::m_fThreadProc( void ){ #ifndef EVE_DONT_DELETE_SEGMENTS unlink( m_sStreamSegmentInfo[0].scratchPath ); #endif -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Stream A is Closed!"); #endif }; @@ -3277,7 +3289,7 @@ void streamHandler::m_fThreadProc( void ){ break; }; case 0x02:{ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Actual Closing Video Stream B!"); LOG( m_sStreamSegmentInfo[1].scratchPath ); #endif @@ -3292,7 +3304,7 @@ void streamHandler::m_fThreadProc( void ){ #ifdef OPENCV_VIDEO_OUTPUT if ( m_pEncoderB->isOpened() ) { m_pEncoderB->release(); - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { LOG(" Encoder B is NOT Opened!"); #endif @@ -3306,7 +3318,7 @@ void streamHandler::m_fThreadProc( void ){ if ( bEVT ) { basicEventHeap::getInstance()->broadcast( bEVT ); } else LOG_ERROR( "Event Creation failure!"); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Stream B is Saved"); #endif @@ -3320,7 +3332,7 @@ void streamHandler::m_fThreadProc( void ){ #ifdef OPENCV_VIDEO_OUTPUT if ( m_pEncoderB->isOpened() ) { m_pEncoderB->release(); - #ifdef DEBUG + #ifdef DEBUG_EXTRA } else { LOG(" Encoder B is NOT Opened!"); #endif @@ -3335,7 +3347,7 @@ void streamHandler::m_fThreadProc( void ){ #ifndef EVE_DONT_DELETE_SEGMENTS unlink( m_sStreamSegmentInfo[1].scratchPath ); #endif -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Stream B is Closed!"); #endif }; @@ -3486,7 +3498,7 @@ void streamHandler::swapActiveStreams( void ){ bool streamHandler::triggerEvent( uint32_t eid, uint32_t &dbid, uint32_t &frame ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("Trig Evt"); #endif @@ -3540,13 +3552,17 @@ bool streamHandler::triggerEvent( uint32_t eid, uint32_t &dbid, uint32_t &frame m_mFrameCounterProtector.unlock(); //if ( dbid == 0 ) return false; //dbid = m_nVideoRegisteredDBID; +#ifdef DEBUG_EXTRA LOG("Event Registered!"); +#endif #endif // EVE_ENABLE_VIDEO return true; }; bool streamHandler::triggerCamMove( void ){ +#ifdef DEBUG_EXTRA LOG("Trig Cammove"); +#endif m_bCamMoveCounter = 255; return true; }; diff --git a/lib/components/object/objectSystemAnchor.cpp b/lib/components/object/objectSystemAnchor.cpp index 59e06ca5..d3cac5c1 100644 --- a/lib/components/object/objectSystemAnchor.cpp +++ b/lib/components/object/objectSystemAnchor.cpp @@ -212,7 +212,7 @@ bool systemAnchor::convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_ C3D_DECART tDec; vector_3 A, B; tDec.z = POS.alt; -#ifdef DEBUG +#ifdef DEBUG_EXTRA char tB[256]; sprintf(tB, "Global WGS: %.3f %.3f %.3f", POS.lat, POS.lon, POS.alt ); LOG( tB ); @@ -221,12 +221,12 @@ bool systemAnchor::convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_ A[0] = tDec.x;// - SP->getX(); A[1] = tDec.y;// - SP->getY(); A[2] = tDec.z;// - SP->getZ(); -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( tB, "Global Decart: %.3f %.3f %.3f", A[0], A[1], A[2] ); LOG( tB ); #endif pTF->get_vector_local( A, B ); -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( tB, "Local Decart: %.3f %.3f %.3f", B[0], B[1], B[2] ); LOG( tB ); #endif @@ -321,18 +321,18 @@ bool systemAnchor::convertToSystem(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_D A[0] = tDec.x; A[1] = tDec.y; A[2] = tDec.z; -#ifdef DEBUG +#ifdef DEBUG_EXTRA char tB[256]; LOG("C2S Sph.(deg) -> Dec."); sprintf( tB, "Local Decart: %.3f %.3f %.3f", A[0], A[1], A[2] ); LOG( tB ); #endif pTF->get_vector_world( A, B ); -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( tB, "World Decart: %.3f %.3f %.3f", B[0], B[1], B[2] ); LOG( tB ); #endif -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( tB, "Systen Anchor Decart: %.3f %.3f %.3f", getX(), getY(), getZ() ); LOG( tB ); #endif @@ -345,7 +345,7 @@ bool systemAnchor::convertToSystem(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_D LOC.y = B[1] - getY(); LOC.z = B[2] - getZ(); }; -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( tB, "Final System Decart: %.3f %.3f %.3f", LOC.x, LOC.y, LOC.z ); LOG( tB ); #endif diff --git a/lib/data/ponvif/ponvif.cpp b/lib/data/ponvif/ponvif.cpp index bb44fe67..2114e87c 100644 --- a/lib/data/ponvif/ponvif.cpp +++ b/lib/data/ponvif/ponvif.cpp @@ -457,16 +457,20 @@ discoveryResults pOnvif::discover( void ){ bool pOnvif::create( void ) { m_pHttpAccessManager = curlRequestsManager::getInstance(); if( m_pHttpAccessManager == NULL ) return false; +#ifdef DEBUG_EXTRA LOG("CURL MANAGER OK"); +#endif try { struct tm * tTS; tTS = core_GetSystemDateAndTime(); if( tTS != NULL ){ +#ifdef DEBUG_EXTRA char tB[128]; sprintf( tB, "TS from dev: %04d-%02d-%02d %02d:%02d:%02d", tTS->tm_year, tTS->tm_mon, tTS->tm_mday, tTS->tm_hour, tTS->tm_min, tTS->tm_sec ); LOG( tB ); +#endif // WTF ??!! tTS->tm_year -= 1900; tTS->tm_mon -= 1; @@ -474,10 +478,10 @@ bool pOnvif::create( void ) { time_t tTimeStamp = mktime( tTS ); m_nDeltaTime = time(NULL) - tTimeStamp; - +#ifdef DEBUG_EXTRA sprintf( tB,"TS:[%d] D:[%d]", tTimeStamp, m_nDeltaTime ); LOG(tB); - +#endif free( tTS ); } else return false; } catch ( exception e ) { @@ -517,11 +521,13 @@ struct tm *pOnvif::core_GetSystemDateAndTime( void ) { return NULL; }; }; +#ifdef DEBUG_EXTRA LOG("Before REQ"); +#endif if( _send_request( tURL, PONVIF_PACK_GET_SYS_DTS, true ) ){ XMLResults tParseResults; XMLNode response = XMLNode::parseString( m_pLastResponse, "root", &tParseResults ); -#ifdef DEBUG +#ifdef DEBUG_EXTRA LOG("core_GetSystemDateAndTime"); #endif if( tParseResults.error ){ diff --git a/lib/data/protocol/protocolPTZ_ONVIF.cpp b/lib/data/protocol/protocolPTZ_ONVIF.cpp index 82e5e213..e3a8f18a 100644 --- a/lib/data/protocol/protocolPTZ_ONVIF.cpp +++ b/lib/data/protocol/protocolPTZ_ONVIF.cpp @@ -268,7 +268,7 @@ bool protocolPTZ_ONVIF::move( uint32_t MoveMatrix ){ bool protocolPTZ_ONVIF::goAbsolute( float dPan, float dTilt, float dZoom ){ #ifdef USE_PONVIF //if (m_bStatus == 0) return false; -#ifdef DEBUG_EXTRA +#ifdef DEBUG_EXTRA LOG("ABS Move"); #endif if( m_pProfile == NULL ){