Browse Source

Commented some debugging messages as DEBUG_EXTRA

AGP
Evgeny Gagua 3 years ago
parent
commit
376b038c19
  1. 2
      Projects/la_mojo/build
  2. 12
      Projects/la_mojo/la_mojo.vpj
  3. 8
      Projects/la_mojo/makefile
  4. 2
      lib/App/common/deviceNode2D.cpp
  5. 37
      lib/App/common/deviceNodeCamera.cpp
  6. 96
      lib/App/common/kernelModuleEmbedVideo.cpp
  7. 14
      lib/components/object/objectSystemAnchor.cpp
  8. 12
      lib/data/ponvif/ponvif.cpp
  9. 2
      lib/data/protocol/protocolPTZ_ONVIF.cpp

2
Projects/la_mojo/build

@ -4,7 +4,7 @@
#make clean -e "CFG=Debug" #make clean -e "CFG=Debug"
#make -e "CFG=Debug" -j6 #make -e "CFG=Debug" -j6
#make clean -e "CFG=Debug86"
make clean -e "CFG=Debug86"
make -e "CFG=Debug86" -j2 make -e "CFG=Debug86" -j2
#make clean -e "CFG=Release86" #make clean -e "CFG=Release86"

12
Projects/la_mojo/la_mojo.vpj

@ -14,7 +14,7 @@
Version="1" Version="1"
OutputFile="%bdmojo_d" OutputFile="%bdmojo_d"
CompilerConfigName="Latest Version" 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"'>
<Menu> <Menu>
<Target <Target
Name="Compile" Name="Compile"
@ -26,7 +26,7 @@
SaveOption="SaveCurrent" SaveOption="SaveCurrent"
RunFromDir="%rw"> RunFromDir="%rw">
<Exec <Exec
CmdLine='g++ -c %xup -x c++ %defd -O0 -g1 -ggdb -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f'
CmdLine='g++ -c %xup -x c++ %defd -O0 -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f'
OtherOptions="-std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags`"/> OtherOptions="-std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags`"/>
</Target> </Target>
<Target <Target
@ -38,7 +38,7 @@
Deletable="0" Deletable="0"
SaveOption="SaveCurrent" SaveOption="SaveCurrent"
RunFromDir="%rw"> RunFromDir="%rw">
<Exec CmdLine='g++ %xup -O0 -g1 -ggdb -w -o "%o" %objs'/>
<Exec CmdLine='g++ %xup -O0 -w -o "%o" %objs'/>
</Target> </Target>
<Target <Target
Name="Build" Name="Build"
@ -246,7 +246,7 @@
Version="1" Version="1"
OutputFile="%bdmojo_d" OutputFile="%bdmojo_d"
CompilerConfigName="Latest Version" CompilerConfigName="Latest Version"
Defines='"/DDEBUG" "/D__STDC_CONSTANT_MACROS" "/D_CLIENT_APPLICATION_" "/D_OPENCV_"'>
Defines='"/DDEBUG__" "/D__STDC_CONSTANT_MACROS" "/D_CLIENT_APPLICATION_" "/D_OPENCV_"'>
<Menu> <Menu>
<Target <Target
Name="Compile" Name="Compile"
@ -258,7 +258,7 @@
SaveOption="SaveCurrent" SaveOption="SaveCurrent"
RunFromDir="%rw"> RunFromDir="%rw">
<Exec <Exec
CmdLine='g++ -c %xup -x c++ %defd -O0 -g1 -ggdb -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f'
CmdLine='g++ -c %xup -x c++ %defd -O0 -w -Wpointer-arith %~other -o "%bd%n%oe" %i %f'
OtherOptions="-std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags`"/> OtherOptions="-std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags`"/>
</Target> </Target>
<Target <Target
@ -270,7 +270,7 @@
Deletable="0" Deletable="0"
SaveOption="SaveCurrent" SaveOption="SaveCurrent"
RunFromDir="%rw"> RunFromDir="%rw">
<Exec CmdLine='g++ %xup -O0 -g1 -ggdb -w -o "%o" %objs'/>
<Exec CmdLine='g++ %xup -O0 -w -o "%o" %objs'/>
</Target> </Target>
<Target <Target
Name="Build" Name="Build"

8
Projects/la_mojo/makefile

@ -127,8 +127,8 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
opencv4 rdkafka++` -lwiringx -lliveMedia -lgroupsock \ opencv4 rdkafka++` -lwiringx -lliveMedia -lgroupsock \
-lBasicUsageEnvironment -lUsageEnvironment -lBasicUsageEnvironment -lUsageEnvironment
COMPILE=g++ -c -x c++ "-DDEBUG" "-D__STDC_CONSTANT_MACROS" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" "-DRASPI_HARDWARE" -O0 -g1 -ggdb -w -Wpointer-arith -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -g1 -ggdb -w -o "$(OUTFILE)" $(ALL_OBJ)
COMPILE=g++ -c -x c++ "-DDEBUG" "-D__STDC_CONSTANT_MACROS__" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" "-DRASPI_HARDWARE" -O0 -w -Wpointer-arith -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -w -o "$(OUTFILE)" $(ALL_OBJ)
# Pattern rules # Pattern rules
$(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(OUTDIR)/%.o : ../../lib/components/object/%.cpp
@ -497,8 +497,8 @@ ALL_OBJ=$(OUTDIR)/base64.o $(OUTDIR)/basicCameraInfo.o \
opencv4 rdkafka++` -lliveMedia -lgroupsock -lBasicUsageEnvironment \ opencv4 rdkafka++` -lliveMedia -lgroupsock -lBasicUsageEnvironment \
-lUsageEnvironment -lUsageEnvironment
COMPILE=g++ -c -x c++ "-DDEBUG" "-D__STDC_CONSTANT_MACROS" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" -O0 -g1 -ggdb -w -Wpointer-arith -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -g1 -ggdb -w -o "$(OUTFILE)" $(ALL_OBJ)
COMPILE=g++ -c -x c++ "-DDEBUG__" "-D__STDC_CONSTANT_MACROS" "-D_CLIENT_APPLICATION_" "-D_OPENCV_" -O0 -w -Wpointer-arith -std=c++11 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -w -o "$(OUTFILE)" $(ALL_OBJ)
# Pattern rules # Pattern rules
$(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(OUTDIR)/%.o : ../../lib/components/object/%.cpp

2
lib/App/common/deviceNode2D.cpp

@ -198,7 +198,9 @@ void device2DSensor::connectMode(){
switch( getPPStatus() ){ switch( getPPStatus() ){
case STG_PUSH: case STG_PUSH:
#ifdef DEBUG_EXTRA
LOG("Push"); LOG("Push");
#endif
switch( getStage() ){ switch( getStage() ){
case LRF_WS_INIT:{ case LRF_WS_INIT:{
updateDataStatus( ARGUS_DS_DISCONNECTED ); updateDataStatus( ARGUS_DS_DISCONNECTED );

37
lib/App/common/deviceNodeCamera.cpp

@ -214,7 +214,7 @@ void deviceNodeCamera::updateOpticalParameters( uint16_t frame_width, uint16_t f
m_fR2FL = .0f; m_fR2FL = .0f;
}; };
m_fZoomCorrection = 1.0f; m_fZoomCorrection = 1.0f;
m_pDBC->updateCamRange( m_sCamData.id, m_fMaxRange );
m_pDBC->updateCamRange(m_sCamData.id, m_fMaxRange);
break; break;
}; };
case 2:{ case 2:{
@ -541,7 +541,7 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR )
if( db_id == 0 ) return false; if( db_id == 0 ) return false;
CAM_TRACK_RECORD * tTrackRecords = (CAM_TRACK_RECORD * ) malloc( sizeof(CAM_TRACK_RECORD)); CAM_TRACK_RECORD * tTrackRecords = (CAM_TRACK_RECORD * ) malloc( sizeof(CAM_TRACK_RECORD));
if( tTrackRecords == NULL ) return false; if( tTrackRecords == NULL ) return false;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Fusion: Consuming new Data!"); LOG("Fusion: Consuming new Data!");
#endif #endif
memset(tTrackRecords, 0, sizeof(CAM_TRACK_RECORD)); 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; for( ; idx < m_vROIS.end(); idx++ ) if ( fusion_compare( *idx, tOR ) ) break;
if ( idx != m_vROIS.end() ) { if ( idx != m_vROIS.end() ) {
// have Match! // have Match!
#ifdef DEBUG_EXTRA
LOG("ROI MATCHED!"); LOG("ROI MATCHED!");
#endif
(*idx)->targets.push_back( tTrackRecords ); (*idx)->targets.push_back( tTrackRecords );
fusion_validateROI( tTrackRecords->ts_ms, (*idx) ); fusion_validateROI( tTrackRecords->ts_ms, (*idx) );
} else { } else {
#ifdef DEBUG_EXTRA
LOG("NO MATCH FOUND!"); LOG("NO MATCH FOUND!");
#endif
// No mathced ROI -> create new one // No mathced ROI -> create new one
CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI)); CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI));
if ( tROI ) { if ( tROI ) {
@ -584,7 +588,10 @@ bool deviceNodeCamera::fusion_consumeData( uint32_t db_id, C3D_SPH_DEGREES tOR )
}; };
}; };
} else { } else {
// empty ROIs -> create new one
#ifdef DEBUG_EXTRA
LOG("Fusion: NO ROI -> CREATE!");
#endif
//
CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI)); CAM_ROI * tROI = (CAM_ROI *)malloc(sizeof(CAM_ROI));
if ( tROI ) { if ( tROI ) {
memset( tROI, 0 , sizeof(CAM_ROI) ); 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 // Add ROI to vector
tROI->targets.push_back( tTrackRecords ); tROI->targets.push_back( tTrackRecords );
m_vROIS.push_back( tROI ); m_vROIS.push_back( tROI );
};
} else LOG_ERROR("No MEM4ROI");
}; };
m_mROIsProtector.unlock(); m_mROIsProtector.unlock();
return true; 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->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->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 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; return true;
}; };
}; };
@ -752,15 +758,14 @@ bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, float PanPOS, float T
LOG_ERROR("CMD malloc Error!"); LOG_ERROR("CMD malloc Error!");
free( tTask ); free( tTask );
}; };
} else {
LOG_ERROR("Task malloc error!");
};
} else LOG_ERROR("Task malloc error!");
}; };
return false; return false;
}; };
bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, C3D_ORIENT_ONVIF O ){ bool deviceNodeCamera::absoluteMove( uint32_t TargetRefID, C3D_ORIENT_ONVIF O ){
if( m_sCamData.online ){ if( m_sCamData.online ){
CAM_TASK *tTask = (CAM_TASK *)malloc(sizeof(CAM_TASK)); CAM_TASK *tTask = (CAM_TASK *)malloc(sizeof(CAM_TASK));
if( tTask ){ if( tTask ){
memset(tTask, 0, sizeof(CAM_TASK)); 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!"); LOG_ERROR("CMD malloc Error!");
free( tTask ); free( tTask );
}; };
} else {
LOG_ERROR("Task malloc error!");
};
} else LOG_ERROR("Task malloc error!");
}; };
return false; return false;
}; };
@ -949,7 +952,6 @@ void deviceNodeCamera::m_fThreadProc( void ){
NULL, NULL, NULL ); NULL, NULL, NULL );
if( tEVT ){ if( tEVT ){
//tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA //tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA
LOG("BCAST CAM GOTO");
m_pBEH->broadcast( tEVT ); m_pBEH->broadcast( tEVT );
}; };
}; };
@ -957,6 +959,7 @@ void deviceNodeCamera::m_fThreadProc( void ){
m_fCP_Pan = m_pCurrentROI->cam_orientation.pan; m_fCP_Pan = m_pCurrentROI->cam_orientation.pan;
m_fCP_Tilt = m_pCurrentROI->cam_orientation.tilt; m_fCP_Tilt = m_pCurrentROI->cam_orientation.tilt;
m_fCP_Zoom = m_pCurrentROI->cam_orientation.zoom; m_fCP_Zoom = m_pCurrentROI->cam_orientation.zoom;
// Do Movement // Do Movement
if( !m_pProtocol->goAbsolute( if( !m_pProtocol->goAbsolute(
m_pCurrentROI->cam_orientation.pan, m_pCurrentROI->cam_orientation.pan,
@ -976,7 +979,9 @@ void deviceNodeCamera::m_fThreadProc( void ){
EVT_CAMERA_ON_POSITION, EVT_CAMERA_ON_POSITION,
NULL, NULL, tData ); NULL, NULL, tData );
if( tEVT ){ if( tEVT ){
#ifdef DEBUG_EXTRA
LOG("BCAST CAM ONPOS"); LOG("BCAST CAM ONPOS");
#endif
//tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA //tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA
m_pBEH->broadcast( tEVT ); m_pBEH->broadcast( tEVT );
}; };
@ -1287,7 +1292,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_WGS84_LOC L ){
systemAnchor* tSystem = systemAnchor::getInstance(); systemAnchor* tSystem = systemAnchor::getInstance();
if( tSystem == NULL ) return false; if( tSystem == NULL ) return false;
C3D_SPH_DEGREES SL; C3D_SPH_DEGREES SL;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Look at WGS coords!"); LOG("Look at WGS coords!");
#endif #endif
tSystem->convertToLocal(&m_oPosition, L, SL ); tSystem->convertToLocal(&m_oPosition, L, SL );
@ -1298,7 +1303,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_DECART L ){
systemAnchor* tSystem = systemAnchor::getInstance(); systemAnchor* tSystem = systemAnchor::getInstance();
if( tSystem == NULL ) return false; if( tSystem == NULL ) return false;
C3D_SPH_DEGREES SL; C3D_SPH_DEGREES SL;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Look at System Decart coords!"); LOG("Look at System Decart coords!");
#endif #endif
tSystem->convertToLocal( &m_oPosition, L, SL ); 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 ){ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_RADIANS L ){
C3D_SPH_DEGREES SL; C3D_SPH_DEGREES SL;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Look at spherical(rad) 2 spherical(deg) coords!"); LOG("Look at spherical(rad) 2 spherical(deg) coords!");
#endif #endif
spherical2spherical( L, SL ); spherical2spherical( L, SL );
@ -1320,7 +1325,7 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_DEGREES L ){
//LOG( tB ); //LOG( tB );
//sprintf( tB, "Cam GoTo %.3f %.3f %.3f", fP, fT, fZ ); //sprintf( tB, "Cam GoTo %.3f %.3f %.3f", fP, fT, fZ );
//LOG( tB ); //LOG( tB );
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Look at local spherical deg. coords!(final)"); LOG("Look at local spherical deg. coords!(final)");
#endif #endif
//if( getWM() == CAM_WS_READY ){ //if( getWM() == CAM_WS_READY ){

96
lib/App/common/kernelModuleEmbedVideo.cpp

@ -448,12 +448,12 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){
void kernelModuleEmbedVideo::m_fThreadProc( void ){ void kernelModuleEmbedVideo::m_fThreadProc( void ){
if( !m_bEnabled ) { if( !m_bEnabled ) {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Module is Disabled!"); LOG("Module is Disabled!");
#endif #endif
return; return;
}; };
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Module Started!"); LOG("Module Started!");
#endif #endif
struct pollfd pfd[1]; struct pollfd pfd[1];
@ -475,7 +475,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){
// Handle Connections // Handle Connections
if( RetVal != 0 ){ if( RetVal != 0 ){
if ( pfd[0].revents & POLLIN ) { if ( pfd[0].revents & POLLIN ) {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Handle New Client"); LOG("Handle New Client");
#endif #endif
int tSID = accept( pfd[0].fd, NULL, NULL); int tSID = accept( pfd[0].fd, NULL, NULL);
@ -484,17 +484,17 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){
sprintf(tBuf, "Accept() error: %s", strerror(errno)); sprintf(tBuf, "Accept() error: %s", strerror(errno));
LOG_ERROR(tBuf); LOG_ERROR(tBuf);
} else { } else {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Accept OK"); LOG("Accept OK");
#endif #endif
WEB_CLIENT_CTX *tCTX = (WEB_CLIENT_CTX *) malloc(sizeof(WEB_CLIENT_CTX)); WEB_CLIENT_CTX *tCTX = (WEB_CLIENT_CTX *) malloc(sizeof(WEB_CLIENT_CTX));
if( tCTX ) { if( tCTX ) {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("CTX OK"); LOG("CTX OK");
#endif #endif
WEB_HANDLER *tHANDLER = (WEB_HANDLER *) malloc(sizeof(WEB_HANDLER)); WEB_HANDLER *tHANDLER = (WEB_HANDLER *) malloc(sizeof(WEB_HANDLER));
if( tHANDLER ) { if( tHANDLER ) {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("HANDLER OK"); LOG("HANDLER OK");
#endif #endif
memset( tCTX, 0, sizeof(WEB_CLIENT_CTX) ); memset( tCTX, 0, sizeof(WEB_CLIENT_CTX) );
@ -520,7 +520,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){
m_mWebHandlersProtector.lock(); m_mWebHandlersProtector.lock();
m_vHandlersPool.push_back( tHANDLER ); m_vHandlersPool.push_back( tHANDLER );
m_mWebHandlersProtector.unlock(); m_mWebHandlersProtector.unlock();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Handler Pushed to a Pool"); LOG("Handler Pushed to a Pool");
#endif #endif
}; };
@ -542,7 +542,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){
if( m_vHandlersPool.size() ) { if( m_vHandlersPool.size() ) {
for( vectorHANDLERS::iterator idx = m_vHandlersPool.begin(); idx < m_vHandlersPool.end(); idx++ ) { for( vectorHANDLERS::iterator idx = m_vHandlersPool.begin(); idx < m_vHandlersPool.end(); idx++ ) {
if( !( (*idx)->CTX->bValid ) ) { if( !( (*idx)->CTX->bValid ) ) {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Have Dead Client!"); LOG("Have Dead Client!");
#endif #endif
pthread_join( (*idx)->m_hThreadHandle, NULL ); pthread_join( (*idx)->m_hThreadHandle, NULL );
@ -553,7 +553,7 @@ void kernelModuleEmbedVideo::m_fThreadProc( void ){
m_mWebHandlersProtector.lock(); m_mWebHandlersProtector.lock();
m_vHandlersPool.erase(idx); m_vHandlersPool.erase(idx);
m_mWebHandlersProtector.unlock(); m_mWebHandlersProtector.unlock();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Web Handler Ripped!"); LOG("Web Handler Ripped!");
#endif #endif
}; };
@ -601,7 +601,7 @@ bool kernelModuleEmbedVideo::startService(){
if( T.cols > 0 ) { if( T.cols > 0 ) {
cv::Mat mask; cv::Mat mask;
vector<cv::Mat> layers; vector<cv::Mat> layers;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Logo Loaded OK"); LOG("Logo Loaded OK");
#endif #endif
cv::split( T, layers); // seperate channels cv::split( T, layers); // seperate channels
@ -617,14 +617,20 @@ bool kernelModuleEmbedVideo::startService(){
m_mLogoPic.copyTo( destinationROI, m_mLogoMask ); m_mLogoPic.copyTo( destinationROI, m_mLogoMask );
//m_sEmbedVideoData.show_logo = false; //m_sEmbedVideoData.show_logo = false;
} else { } else {
#ifdef DEBUG_EXTRA
LOG("Logo Disabled - No Picture is Loaded"); LOG("Logo Disabled - No Picture is Loaded");
#endif
m_sEmbedVideoData.show_logo = false; m_sEmbedVideoData.show_logo = false;
}; };
} else { } else {
#ifdef DEBUG_EXTRA
LOG("Logo Disabled - Wrong Coords"); LOG("Logo Disabled - Wrong Coords");
#endif
m_sEmbedVideoData.show_logo = false; m_sEmbedVideoData.show_logo = false;
}; };
#ifdef DEBUG_EXTRA
LOG("Logo Draw OK"); LOG("Logo Draw OK");
#endif
}; };
try{ try{
@ -667,17 +673,23 @@ bool kernelModuleEmbedVideo::startService(){
LOG_ERROR("Failed binding Socket"); LOG_ERROR("Failed binding Socket");
close( m_nSocketDescriptor ); close( m_nSocketDescriptor );
return false; return false;
#ifdef DEBUG_EXTRA
} else { } else {
LOG("Bind Socessfull"); LOG("Bind Socessfull");
#endif
}; };
if( listen( m_nSocketDescriptor, 10) != 0 ){ if( listen( m_nSocketDescriptor, 10) != 0 ){
LOG_ERROR("Failed setting web listen backlog"); LOG_ERROR("Failed setting web listen backlog");
close( m_nSocketDescriptor ); close( m_nSocketDescriptor );
return false; return false;
#ifdef DEBUG_EXTRA
} else { } else {
LOG("Listen OK"); LOG("Listen OK");
#endif
}; };
#ifdef DEBUG_EXTRA
LOG("Start Thread"); LOG("Start Thread");
#endif
m_bEnabled = init(); m_bEnabled = init();
return m_bEnabled; return m_bEnabled;
}; };
@ -1733,7 +1745,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
//do { //do {
//In Any Case Close Stream if it Long enough //In Any Case Close Stream if it Long enough
if( m_nSegAFrameCounter > m_nAHardLimitFrames ){ if( m_nSegAFrameCounter > m_nAHardLimitFrames ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("HardLimit Reached!(A)"); LOG("HardLimit Reached!(A)");
#endif #endif
closeSegmentA(); closeSegmentA();
@ -1741,14 +1753,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
}; };
if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - ( m_nAPostAlarmFrames + m_nBPreAlarmFrames ))){ if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - ( m_nAPostAlarmFrames + m_nBPreAlarmFrames ))){
if ( !m_bSegBActive ){ if ( !m_bSegBActive ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Start Alt!(A)"); LOG("Start Alt!(A)");
#endif #endif
openSegmentB(); openSegmentB();
}; };
}; };
if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - m_nAPostAlarmFrames ) && !m_bActiveEncoderStream ){ if( m_nSegAFrameCounter > ( m_nASegmentLimitFrames - m_nAPostAlarmFrames ) && !m_bActiveEncoderStream ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Swap Active!(A)"); LOG("Swap Active!(A)");
#endif #endif
swapActiveStreams(); swapActiveStreams();
@ -1759,7 +1771,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
//do { //do {
//In Any Case Close Stream if it Long enough //In Any Case Close Stream if it Long enough
if( m_nSegAFrameCounter > m_nHardLimitFrames ){ if( m_nSegAFrameCounter > m_nHardLimitFrames ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("HardLimit Reached!(A)"); LOG("HardLimit Reached!(A)");
#endif #endif
closeSegmentA(); closeSegmentA();
@ -1767,14 +1779,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
}; };
if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){ if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){
if ( !m_bSegBActive ){ if ( !m_bSegBActive ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Start Alt!(A)"); LOG("Start Alt!(A)");
#endif #endif
openSegmentB(); openSegmentB();
}; };
}; };
if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && !m_bActiveEncoderStream ){ if( m_nSegAFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && !m_bActiveEncoderStream ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Swap Active!(A)"); LOG("Swap Active!(A)");
#endif #endif
swapActiveStreams(); swapActiveStreams();
@ -1789,7 +1801,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
// do { // do {
//In Any Case Close Stream if it Long enough //In Any Case Close Stream if it Long enough
if( m_nSegBFrameCounter > m_nBHardLimitFrames ){ if( m_nSegBFrameCounter > m_nBHardLimitFrames ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("HardLimit Reached!(B)"); LOG("HardLimit Reached!(B)");
#endif #endif
closeSegmentB(); closeSegmentB();
@ -1797,14 +1809,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
}; };
if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - ( m_nBPostAlarmFrames + m_nAPreAlarmFrames ))){ if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - ( m_nBPostAlarmFrames + m_nAPreAlarmFrames ))){
if ( !m_bSegAActive ){ if ( !m_bSegAActive ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Start Alt!(B)"); LOG("Start Alt!(B)");
#endif #endif
openSegmentA(); openSegmentA();
}; };
}; };
if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - m_nBPostAlarmFrames ) && m_bActiveEncoderStream ){ if( m_nSegBFrameCounter > ( m_nBSegmentLimitFrames - m_nBPostAlarmFrames ) && m_bActiveEncoderStream ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Swap Active!(B)"); LOG("Swap Active!(B)");
#endif #endif
swapActiveStreams(); swapActiveStreams();
@ -1815,7 +1827,7 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
// do { // do {
//In Any Case Close Stream if it Long enough //In Any Case Close Stream if it Long enough
if( m_nSegBFrameCounter > m_nHardLimitFrames ){ if( m_nSegBFrameCounter > m_nHardLimitFrames ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("HardLimit Reached!(B)"); LOG("HardLimit Reached!(B)");
#endif #endif
closeSegmentB(); closeSegmentB();
@ -1823,14 +1835,14 @@ bool streamHandler::pushFrame( cv::Mat &Frame, void* src ){
}; };
if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){ if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - ( m_nPostAlarmFrames + m_nPreAlarmFrames ))){
if ( !m_bSegAActive ){ if ( !m_bSegAActive ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Start Alt!(B)"); LOG("Start Alt!(B)");
#endif #endif
openSegmentA(); openSegmentA();
}; };
}; };
if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && m_bActiveEncoderStream ){ if( m_nSegBFrameCounter > ( m_nSegmentLimitFrames - m_nPostAlarmFrames ) && m_bActiveEncoderStream ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Swap Active!(B)"); LOG("Swap Active!(B)");
#endif #endif
swapActiveStreams(); swapActiveStreams();
@ -1896,7 +1908,7 @@ void streamHandler::closeSegmentA( void ){
m_mCurrentOperationProtector.lock(); m_mCurrentOperationProtector.lock();
if ( m_bCOP == 0 ) m_bCOP = 0x01; if ( m_bCOP == 0 ) m_bCOP = 0x01;
m_mCurrentOperationProtector.unlock(); m_mCurrentOperationProtector.unlock();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Closing Stream A"); LOG("Closing Stream A");
#endif #endif
}; };
@ -1905,7 +1917,7 @@ void streamHandler::closeSegmentB( void ){
m_mCurrentOperationProtector.lock(); m_mCurrentOperationProtector.lock();
if ( m_bCOP == 0 ) m_bCOP = 0x02; if ( m_bCOP == 0 ) m_bCOP = 0x02;
m_mCurrentOperationProtector.unlock(); m_mCurrentOperationProtector.unlock();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Closing Stream B"); LOG("Closing Stream B");
#endif #endif
}; };
@ -2059,7 +2071,7 @@ bool streamHandler::openSegmentA( void ){
if( !m_pEncoderA->open( mn, fourcc, fps, fz ) ){ if( !m_pEncoderA->open( mn, fourcc, fps, fz ) ){
LOG_ERROR("Cannot Open Output Segment A!"); LOG_ERROR("Cannot Open Output Segment A!");
return false; return false;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
char tB[256]; char tB[256];
sprintf( tB,"VideoStream A is Created [%s] %.2f fps", m_sStreamSegmentInfo[0].scratchPath, fps ); 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 ) ){ if( !m_pEncoderB->open( mn, fourcc, fps, fz ) ){
LOG_ERROR("Cannot Open Output Segment B!"); LOG_ERROR("Cannot Open Output Segment B!");
return false; return false;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
char tB[256]; char tB[256];
sprintf( tB,"VideoStream B is Created [%s] %.2f fps", m_sStreamSegmentInfo[1].scratchPath, fps ); sprintf( tB,"VideoStream B is Created [%s] %.2f fps", m_sStreamSegmentInfo[1].scratchPath, fps );
@ -2712,7 +2724,7 @@ bool streamHandler::initVideoOutput(){
#endif #endif
}; };
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
LOG("output codec context is already opened"); LOG("output codec context is already opened");
#endif #endif
@ -3054,7 +3066,7 @@ void streamHandler::m_fThreadProc( void ){
if ( m_bWebFrameSkeepDivider > EVE_EASE_FPS_DIVIDER_MAXIMUM ) { if ( m_bWebFrameSkeepDivider > EVE_EASE_FPS_DIVIDER_MAXIMUM ) {
m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MAXIMUM; m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MAXIMUM;
} else { } else {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Video Quality Degraded!"); LOG("Video Quality Degraded!");
#endif #endif
EVENT_CONTAINER *bEVT = createBasicEvent( m_sStreamData.source_id, EVT_CLASS_VIDEO, EVT_VIDEO_FPS_DEGRADED, NULL, NULL, NULL ); 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 ) { if ( m_bWebFrameSkeepDivider < EVE_EASE_FPS_DIVIDER_MINIMUM ) {
m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MINIMUM; m_bWebFrameSkeepDivider = EVE_EASE_FPS_DIVIDER_MINIMUM;
} else { } else {
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Video Quality Upgraded!"); LOG("Video Quality Upgraded!");
#endif #endif
EVENT_CONTAINER *bEVT = createBasicEvent( m_sStreamData.source_id, EVT_CLASS_VIDEO, EVT_VIDEO_FPS_RAISED, NULL, NULL, NULL ); 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(); m_mCurrentOperationProtector.lock();
switch ( m_bCOP ) { switch ( m_bCOP ) {
case 0x01:{ case 0x01:{
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Actual Closing Video Stream A!"); LOG("Actual Closing Video Stream A!");
LOG( m_sStreamSegmentInfo[0].scratchPath ); LOG( m_sStreamSegmentInfo[0].scratchPath );
#endif #endif
@ -3214,7 +3226,7 @@ void streamHandler::m_fThreadProc( void ){
#ifdef OPENCV_VIDEO_OUTPUT #ifdef OPENCV_VIDEO_OUTPUT
if ( m_pEncoderA->isOpened() ) { if ( m_pEncoderA->isOpened() ) {
m_pEncoderA->release(); m_pEncoderA->release();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
LOG(" Encoder A is NOT Opened!"); LOG(" Encoder A is NOT Opened!");
#endif #endif
@ -3228,7 +3240,7 @@ void streamHandler::m_fThreadProc( void ){
if ( bEVT ) { if ( bEVT ) {
basicEventHeap::getInstance()->broadcast( bEVT ); basicEventHeap::getInstance()->broadcast( bEVT );
} else LOG_ERROR( "Event Creation failure!"); } else LOG_ERROR( "Event Creation failure!");
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Stream A is Saved"); LOG("Stream A is Saved");
#endif #endif
} else { } else {
@ -3241,7 +3253,7 @@ void streamHandler::m_fThreadProc( void ){
#ifdef OPENCV_VIDEO_OUTPUT #ifdef OPENCV_VIDEO_OUTPUT
if ( m_pEncoderA->isOpened() ) { if ( m_pEncoderA->isOpened() ) {
m_pEncoderA->release(); m_pEncoderA->release();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
LOG(" Encoder A is NOT Opened!"); LOG(" Encoder A is NOT Opened!");
#endif #endif
@ -3256,7 +3268,7 @@ void streamHandler::m_fThreadProc( void ){
#ifndef EVE_DONT_DELETE_SEGMENTS #ifndef EVE_DONT_DELETE_SEGMENTS
unlink( m_sStreamSegmentInfo[0].scratchPath ); unlink( m_sStreamSegmentInfo[0].scratchPath );
#endif #endif
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Stream A is Closed!"); LOG("Stream A is Closed!");
#endif #endif
}; };
@ -3277,7 +3289,7 @@ void streamHandler::m_fThreadProc( void ){
break; break;
}; };
case 0x02:{ case 0x02:{
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Actual Closing Video Stream B!"); LOG("Actual Closing Video Stream B!");
LOG( m_sStreamSegmentInfo[1].scratchPath ); LOG( m_sStreamSegmentInfo[1].scratchPath );
#endif #endif
@ -3292,7 +3304,7 @@ void streamHandler::m_fThreadProc( void ){
#ifdef OPENCV_VIDEO_OUTPUT #ifdef OPENCV_VIDEO_OUTPUT
if ( m_pEncoderB->isOpened() ) { if ( m_pEncoderB->isOpened() ) {
m_pEncoderB->release(); m_pEncoderB->release();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
LOG(" Encoder B is NOT Opened!"); LOG(" Encoder B is NOT Opened!");
#endif #endif
@ -3306,7 +3318,7 @@ void streamHandler::m_fThreadProc( void ){
if ( bEVT ) { if ( bEVT ) {
basicEventHeap::getInstance()->broadcast( bEVT ); basicEventHeap::getInstance()->broadcast( bEVT );
} else LOG_ERROR( "Event Creation failure!"); } else LOG_ERROR( "Event Creation failure!");
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Stream B is Saved"); LOG("Stream B is Saved");
#endif #endif
@ -3320,7 +3332,7 @@ void streamHandler::m_fThreadProc( void ){
#ifdef OPENCV_VIDEO_OUTPUT #ifdef OPENCV_VIDEO_OUTPUT
if ( m_pEncoderB->isOpened() ) { if ( m_pEncoderB->isOpened() ) {
m_pEncoderB->release(); m_pEncoderB->release();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
} else { } else {
LOG(" Encoder B is NOT Opened!"); LOG(" Encoder B is NOT Opened!");
#endif #endif
@ -3335,7 +3347,7 @@ void streamHandler::m_fThreadProc( void ){
#ifndef EVE_DONT_DELETE_SEGMENTS #ifndef EVE_DONT_DELETE_SEGMENTS
unlink( m_sStreamSegmentInfo[1].scratchPath ); unlink( m_sStreamSegmentInfo[1].scratchPath );
#endif #endif
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Stream B is Closed!"); LOG("Stream B is Closed!");
#endif #endif
}; };
@ -3486,7 +3498,7 @@ void streamHandler::swapActiveStreams( void ){
bool streamHandler::triggerEvent( uint32_t eid, uint32_t &dbid, uint32_t &frame ){ bool streamHandler::triggerEvent( uint32_t eid, uint32_t &dbid, uint32_t &frame ){
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("Trig Evt"); LOG("Trig Evt");
#endif #endif
@ -3540,13 +3552,17 @@ bool streamHandler::triggerEvent( uint32_t eid, uint32_t &dbid, uint32_t &frame
m_mFrameCounterProtector.unlock(); m_mFrameCounterProtector.unlock();
//if ( dbid == 0 ) return false; //if ( dbid == 0 ) return false;
//dbid = m_nVideoRegisteredDBID; //dbid = m_nVideoRegisteredDBID;
#ifdef DEBUG_EXTRA
LOG("Event Registered!"); LOG("Event Registered!");
#endif
#endif // EVE_ENABLE_VIDEO #endif // EVE_ENABLE_VIDEO
return true; return true;
}; };
bool streamHandler::triggerCamMove( void ){ bool streamHandler::triggerCamMove( void ){
#ifdef DEBUG_EXTRA
LOG("Trig Cammove"); LOG("Trig Cammove");
#endif
m_bCamMoveCounter = 255; m_bCamMoveCounter = 255;
return true; return true;
}; };

14
lib/components/object/objectSystemAnchor.cpp

@ -212,7 +212,7 @@ bool systemAnchor::convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_
C3D_DECART tDec; C3D_DECART tDec;
vector_3 A, B; vector_3 A, B;
tDec.z = POS.alt; tDec.z = POS.alt;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
char tB[256]; char tB[256];
sprintf(tB, "Global WGS: %.3f %.3f %.3f", POS.lat, POS.lon, POS.alt ); sprintf(tB, "Global WGS: %.3f %.3f %.3f", POS.lat, POS.lon, POS.alt );
LOG( tB ); LOG( tB );
@ -221,12 +221,12 @@ bool systemAnchor::convertToLocal(basicPosition *SP, C3D_WGS84_LOC POS, C3D_SPH_
A[0] = tDec.x;// - SP->getX(); A[0] = tDec.x;// - SP->getX();
A[1] = tDec.y;// - SP->getY(); A[1] = tDec.y;// - SP->getY();
A[2] = tDec.z;// - SP->getZ(); A[2] = tDec.z;// - SP->getZ();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
sprintf( tB, "Global Decart: %.3f %.3f %.3f", A[0], A[1], A[2] ); sprintf( tB, "Global Decart: %.3f %.3f %.3f", A[0], A[1], A[2] );
LOG( tB ); LOG( tB );
#endif #endif
pTF->get_vector_local( A, B ); pTF->get_vector_local( A, B );
#ifdef DEBUG
#ifdef DEBUG_EXTRA
sprintf( tB, "Local Decart: %.3f %.3f %.3f", B[0], B[1], B[2] ); sprintf( tB, "Local Decart: %.3f %.3f %.3f", B[0], B[1], B[2] );
LOG( tB ); LOG( tB );
#endif #endif
@ -321,18 +321,18 @@ bool systemAnchor::convertToSystem(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_D
A[0] = tDec.x; A[0] = tDec.x;
A[1] = tDec.y; A[1] = tDec.y;
A[2] = tDec.z; A[2] = tDec.z;
#ifdef DEBUG
#ifdef DEBUG_EXTRA
char tB[256]; char tB[256];
LOG("C2S Sph.(deg) -> Dec."); LOG("C2S Sph.(deg) -> Dec.");
sprintf( tB, "Local Decart: %.3f %.3f %.3f", A[0], A[1], A[2] ); sprintf( tB, "Local Decart: %.3f %.3f %.3f", A[0], A[1], A[2] );
LOG( tB ); LOG( tB );
#endif #endif
pTF->get_vector_world( A, B ); pTF->get_vector_world( A, B );
#ifdef DEBUG
#ifdef DEBUG_EXTRA
sprintf( tB, "World Decart: %.3f %.3f %.3f", B[0], B[1], B[2] ); sprintf( tB, "World Decart: %.3f %.3f %.3f", B[0], B[1], B[2] );
LOG( tB ); LOG( tB );
#endif #endif
#ifdef DEBUG
#ifdef DEBUG_EXTRA
sprintf( tB, "Systen Anchor Decart: %.3f %.3f %.3f", getX(), getY(), getZ() ); sprintf( tB, "Systen Anchor Decart: %.3f %.3f %.3f", getX(), getY(), getZ() );
LOG( tB ); LOG( tB );
#endif #endif
@ -345,7 +345,7 @@ bool systemAnchor::convertToSystem(basicPosition *SP, C3D_SPH_DEGREES POS, C3D_D
LOC.y = B[1] - getY(); LOC.y = B[1] - getY();
LOC.z = B[2] - getZ(); LOC.z = B[2] - getZ();
}; };
#ifdef DEBUG
#ifdef DEBUG_EXTRA
sprintf( tB, "Final System Decart: %.3f %.3f %.3f", LOC.x, LOC.y, LOC.z ); sprintf( tB, "Final System Decart: %.3f %.3f %.3f", LOC.x, LOC.y, LOC.z );
LOG( tB ); LOG( tB );
#endif #endif

12
lib/data/ponvif/ponvif.cpp

@ -457,16 +457,20 @@ discoveryResults pOnvif::discover( void ){
bool pOnvif::create( void ) { bool pOnvif::create( void ) {
m_pHttpAccessManager = curlRequestsManager::getInstance(); m_pHttpAccessManager = curlRequestsManager::getInstance();
if( m_pHttpAccessManager == NULL ) return false; if( m_pHttpAccessManager == NULL ) return false;
#ifdef DEBUG_EXTRA
LOG("CURL MANAGER OK"); LOG("CURL MANAGER OK");
#endif
try { try {
struct tm * tTS; struct tm * tTS;
tTS = core_GetSystemDateAndTime(); tTS = core_GetSystemDateAndTime();
if( tTS != NULL ){ if( tTS != NULL ){
#ifdef DEBUG_EXTRA
char tB[128]; char tB[128];
sprintf( tB, "TS from dev: %04d-%02d-%02d %02d:%02d:%02d", sprintf( tB, "TS from dev: %04d-%02d-%02d %02d:%02d:%02d",
tTS->tm_year, tTS->tm_mon, tTS->tm_mday, tTS->tm_year, tTS->tm_mon, tTS->tm_mday,
tTS->tm_hour, tTS->tm_min, tTS->tm_sec ); tTS->tm_hour, tTS->tm_min, tTS->tm_sec );
LOG( tB ); LOG( tB );
#endif
// WTF ??!! // WTF ??!!
tTS->tm_year -= 1900; tTS->tm_year -= 1900;
tTS->tm_mon -= 1; tTS->tm_mon -= 1;
@ -474,10 +478,10 @@ bool pOnvif::create( void ) {
time_t tTimeStamp = mktime( tTS ); time_t tTimeStamp = mktime( tTS );
m_nDeltaTime = time(NULL) - tTimeStamp; m_nDeltaTime = time(NULL) - tTimeStamp;
#ifdef DEBUG_EXTRA
sprintf( tB,"TS:[%d] D:[%d]", tTimeStamp, m_nDeltaTime ); sprintf( tB,"TS:[%d] D:[%d]", tTimeStamp, m_nDeltaTime );
LOG(tB); LOG(tB);
#endif
free( tTS ); free( tTS );
} else return false; } else return false;
} catch ( exception e ) { } catch ( exception e ) {
@ -517,11 +521,13 @@ struct tm *pOnvif::core_GetSystemDateAndTime( void ) {
return NULL; return NULL;
}; };
}; };
#ifdef DEBUG_EXTRA
LOG("Before REQ"); LOG("Before REQ");
#endif
if( _send_request( tURL, PONVIF_PACK_GET_SYS_DTS, true ) ){ if( _send_request( tURL, PONVIF_PACK_GET_SYS_DTS, true ) ){
XMLResults tParseResults; XMLResults tParseResults;
XMLNode response = XMLNode::parseString( m_pLastResponse, "root", &tParseResults ); XMLNode response = XMLNode::parseString( m_pLastResponse, "root", &tParseResults );
#ifdef DEBUG
#ifdef DEBUG_EXTRA
LOG("core_GetSystemDateAndTime"); LOG("core_GetSystemDateAndTime");
#endif #endif
if( tParseResults.error ){ if( tParseResults.error ){

2
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 ){ bool protocolPTZ_ONVIF::goAbsolute( float dPan, float dTilt, float dZoom ){
#ifdef USE_PONVIF #ifdef USE_PONVIF
//if (m_bStatus == 0) return false; //if (m_bStatus == 0) return false;
#ifdef DEBUG_EXTRA
#ifdef DEBUG_EXTRA
LOG("ABS Move"); LOG("ABS Move");
#endif #endif
if( m_pProfile == NULL ){ if( m_pProfile == NULL ){

Loading…
Cancel
Save