diff --git a/2204131800_SIMCom-Wireless-Solutions-SIM7600E_C2995536.pdf b/2204131800_SIMCom-Wireless-Solutions-SIM7600E_C2995536.pdf deleted file mode 100644 index 051069b8..00000000 Binary files a/2204131800_SIMCom-Wireless-Solutions-SIM7600E_C2995536.pdf and /dev/null differ diff --git a/SIM7100_SIM7500_SIM7600_Series_USB_AUDIO_Application_Note_V1.03.pdf b/SIM7100_SIM7500_SIM7600_Series_USB_AUDIO_Application_Note_V1.03.pdf deleted file mode 100644 index e10730cf..00000000 Binary files a/SIM7100_SIM7500_SIM7600_Series_USB_AUDIO_Application_Note_V1.03.pdf and /dev/null differ diff --git a/lib/App/common/dataBinder_structures.h b/lib/App/common/dataBinder_structures.h index a00174b2..4538c632 100644 --- a/lib/App/common/dataBinder_structures.h +++ b/lib/App/common/dataBinder_structures.h @@ -869,4 +869,13 @@ typedef struct S_DBC_RPC_MEDIA_INFO{ char fmt[6]; }DBC_RPC_MEDIA_INFO; +typedef struct S_DBC_SERVA_MEDIA_ENCODER_SETTINGS{ + char CODEC[5]; + uint8_t CRF; + char preset[32]; + char tune[32]; + uint32_t bitrate; + char CONTAINER[5]; +}DBC_SERVA_MEDIA_ENCODER_SETTINGS; + #endif \ No newline at end of file diff --git a/lib/App/common/deviceNodeCamera.cpp b/lib/App/common/deviceNodeCamera.cpp index 8943e569..87e49dbc 100644 --- a/lib/App/common/deviceNodeCamera.cpp +++ b/lib/App/common/deviceNodeCamera.cpp @@ -16,6 +16,8 @@ #define LOG( X ) deviceNode::m_pLog->Log( "RCAM", this, X ) +#define DEBUG_EXTRA + #ifdef DEBUG #define LOG_ERROR( X ) {\ char _tBfrErrMSG2w34[256];\ @@ -1587,7 +1589,6 @@ bool deviceNodeCamera::testFOV( C3D_SPH_DEGREES SL ){ }; bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_WGS84_LOC L ){ - if ( m_bCameraIsStatic ) return true; systemAnchor* tSystem = systemAnchor::getInstance(); if( tSystem == NULL ) return false; C3D_SPH_DEGREES SL; @@ -1599,7 +1600,6 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_WGS84_LOC L ){ }; bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_DECART L ){ - if ( m_bCameraIsStatic ) return true; systemAnchor* tSystem = systemAnchor::getInstance(); if( tSystem == NULL ) return false; C3D_SPH_DEGREES SL; @@ -1611,7 +1611,6 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_DECART L ){ }; bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_RADIANS L ){ - if ( m_bCameraIsStatic ) return true; C3D_SPH_DEGREES SL; #ifdef DEBUG_EXTRA LOG("Look at spherical(rad) 2 spherical(deg) coords!"); @@ -1621,7 +1620,33 @@ bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_RADIANS L ){ }; bool deviceNodeCamera::lookAt( uint32_t TargetRefID, C3D_SPH_DEGREES L ){ - if ( m_bCameraIsStatic ) return true; + if ( m_bCameraIsStatic ) { + DBC_SNAPSHOT_DATA *tData = (DBC_SNAPSHOT_DATA*)malloc(sizeof(DBC_SNAPSHOT_DATA)); + if ( tData ) { + memset( tData, 0, sizeof( DBC_SNAPSHOT_DATA )); + tData->stream_id = m_sNodeData.aux_parameter; + tData->assoc_event_ids.push_back( TargetRefID ); + if (m_pBEH) { + EVENT_CONTAINER *tEVT = createBasicEvent( + m_sNodeData.node_id, + EVT_CLASS_CAMERA_CTRL, + EVT_CAMERA_ON_POSITION, + NULL, NULL, tData ); + if( tEVT ){ + #ifdef DEBUG + LOG("INSTANT BCAST CAM ONPOS"); + #endif + //tEVT->m_db_id = tTASK->source_evt_id; // EVT ids embed in DATA + m_pBEH->broadcast( tEVT ); + } else { + free( tData ); + }; + } else { + free( tData ); + }; + }; + return true; + }; //char tB[128]; //sprintf(tB, "Target On %.3f %.3f %.3f", L.r, L.fi, L.tetta ); //LOG( tB ); @@ -1897,3 +1922,5 @@ CSTR deviceNodeCamera::getPresetToken( uint8_t specialRole ){ #undef LOG #undef LOG_ERROR +#undef DEBUG_EXTRA + diff --git a/lib/App/common/deviceNodeStaticCamControl.cpp b/lib/App/common/deviceNodeStaticCamControl.cpp index 05e3fd61..3908ac91 100644 --- a/lib/App/common/deviceNodeStaticCamControl.cpp +++ b/lib/App/common/deviceNodeStaticCamControl.cpp @@ -82,7 +82,8 @@ bool deviceNodeStaticCamControl::dispatchEvent( EVENT_CONTAINER *E ){ tDATA = (TARGET_DATA *)E->m_pEvtData; LOG( "ROI" ); if( tDATA ) { - makeSnap(E->m_db_id); + //makeSnap(E->m_db_id); + lookAt( E->m_db_id, tDATA->system_target ); }; break; }; diff --git a/lib/App/common/kernelModuleEmbedVideo.cpp b/lib/App/common/kernelModuleEmbedVideo.cpp index a93b0fd0..f3a9bc3c 100644 --- a/lib/App/common/kernelModuleEmbedVideo.cpp +++ b/lib/App/common/kernelModuleEmbedVideo.cpp @@ -343,7 +343,7 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){ }; }; if( tStreamID ) { -#ifdef DEBUG +#ifdef DEBUG_EXTRA char tB[64]; sprintf(tB,"StremID: %d", tStreamID ); TLOG( tB ); @@ -351,7 +351,7 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){ if( CTX->ModulePtr->registerForMediaStream( tStreamID, CTX ) ){ // Send Header if( send( CTX->m_iSocketFID, ht_head, strlen(ht_head), 0 ) < 0 ){ -#ifdef DEBUG +#ifdef DEBUG_EXTRA sprintf( mesg, "Failed sending file to client: %s", strerror(errno)); TLOG_ERROR(mesg); #endif @@ -359,12 +359,12 @@ void *kernelModuleEmbedVideo::webClientProc( void *ptr ){ }; CTX->initDone = true; continue; -#ifdef DEBUG +#ifdef DEBUG_EXTRA } else { TLOG("Stream id Not Online"); #endif }; -#ifdef DEBUG +#ifdef DEBUG_EXTRA } else { TLOG("No Stream ID"); #endif @@ -1488,7 +1488,9 @@ bool kernelModuleEmbedVideo::saveStreamPicture( DBC_SNAPSHOT_DATA *ptr ){ //*/ }; if( ( m_sEmbedVideoData.output_mode & EVE_OUTPUT_VIDEO ) == EVE_OUTPUT_VIDEO ){ +#ifdef DEBUG LOG("Saving Video!"); +#endif if( ptr->assoc_event_ids.size() ){ m_mStreamHandlersProtector.lock(); mapSTREAMHANDLERS::iterator hnd = m_mapHANDLERS.find( ptr->stream_id ); @@ -1497,13 +1499,13 @@ bool kernelModuleEmbedVideo::saveStreamPicture( DBC_SNAPSHOT_DATA *ptr ){ uint32_t cfrm; for( DBC_INT_LIST::iterator idx = ptr->assoc_event_ids.begin(); idx < ptr->assoc_event_ids.end(); idx++ ) (*hnd).second->triggerEvent( (*idx), db_id, cfrm ); -#ifdef DEBUG_EXTRA +#ifdef DEBUG } else { LOG("No Stream Found!"); #endif }; m_mStreamHandlersProtector.unlock(); -#ifdef DEBUG_EXTRA +#ifdef DEBUG } else { LOG("No Assoc EVTIDS!"); #endif @@ -2593,11 +2595,11 @@ bool streamHandler::openSegmentA( void ){ strncpy( m_sStreamSegmentInfo[0].recordEXT, VIDEO_OUTPUT_CONTAINER, 6 ); m_sStreamSegmentInfo[0].streamFPS = m_sStreamData.fps; m_sStreamSegmentInfo[0].streamWidth = m_pMaster->getWidh(); - m_sStreamSegmentInfo[0].streamWidth = m_pMaster->getHeight(); + m_sStreamSegmentInfo[0].streamHeight = m_pMaster->getHeight(); m_sStreamSegmentInfo[0].eventIDS.clear(); m_sStreamSegmentInfo[0].eventTSS.clear(); m_sStreamSegmentInfo[0].eventTMS.clear(); - m_sStreamSegmentInfo[0].eventFrames.clear(); + m_sStreamSegmentInfo[0].eventFrames.clear(); m_sStreamSegmentInfo[0].dataSize = 0; m_sStreamSegmentInfo[0].db_id = 0; #ifdef DIRECT_MJPEG_COMPOSING @@ -2748,7 +2750,7 @@ bool streamHandler::openSegmentB( void ){ strncpy( m_sStreamSegmentInfo[1].recordEXT, VIDEO_OUTPUT_CONTAINER, 6 ); m_sStreamSegmentInfo[1].streamFPS = m_sStreamData.fps; m_sStreamSegmentInfo[0].streamWidth = m_pMaster->getWidh(); - m_sStreamSegmentInfo[0].streamWidth = m_pMaster->getHeight(); + m_sStreamSegmentInfo[0].streamHeight = m_pMaster->getHeight(); m_sStreamSegmentInfo[1].eventIDS.clear(); m_sStreamSegmentInfo[1].eventTSS.clear(); m_sStreamSegmentInfo[1].eventTMS.clear(); diff --git a/lib/App/common/kernelModuleModemManager.cpp b/lib/App/common/kernelModuleModemManager.cpp index 8396ca15..31c6b0ae 100644 --- a/lib/App/common/kernelModuleModemManager.cpp +++ b/lib/App/common/kernelModuleModemManager.cpp @@ -369,7 +369,7 @@ void kernelModuleModemManager::m_fThreadProc( void ){ bool kernelModuleModemManager::dispatchEvent( EVENT_CONTAINER *Evt ){ if ( moduleActive ) { if( Evt == NULL ) return false; - +#ifdef DEBUG_EXTRA if( Evt->m_eClass == EVT_CLASS_SYSTEM ){ if( Evt->m_eType == EVT_LRF_START_SESSION ){ sessionStarted = true; @@ -379,7 +379,7 @@ bool kernelModuleModemManager::dispatchEvent( EVENT_CONTAINER *Evt ){ }; }; - +#endif if ( sessionStarted ) return true; switch (Evt->m_eType) { diff --git a/lib/App/mojo/mojoKernel.cpp b/lib/App/mojo/mojoKernel.cpp index 0b63ff3d..66da7ff4 100644 --- a/lib/App/mojo/mojoKernel.cpp +++ b/lib/App/mojo/mojoKernel.cpp @@ -1113,9 +1113,7 @@ void mojoKernel::handleVideo( VIDEO_SEGMENT_INFO *ptr ){ LOG_ERROR("Failure in registration video!"); }; }; - if( m_bWorkWithRemoteServer && ( m_pRPC!=NULL) ){ - bKeepVideoFile = m_pRPC->addVideo( ptr ); - }; + if( m_bWorkWithRemoteServer && ( m_pRPC!=NULL) ) bKeepVideoFile = m_pRPC->addVideo( ptr ); }; if( !bKeepVideoFile ){ unlink( ptr->scratchPath ); diff --git a/lib/App/mojo/mojoRemoteClient.cpp b/lib/App/mojo/mojoRemoteClient.cpp index f30cc968..ca6075d7 100644 --- a/lib/App/mojo/mojoRemoteClient.cpp +++ b/lib/App/mojo/mojoRemoteClient.cpp @@ -604,6 +604,7 @@ bool mojoRemoteClient::addVideo( VIDEO_SEGMENT_INFO *ptr ){ }; mojoVideoTransferHelper::mojoVideoTransferHelper( uint32_t buffer_size ){ + m_pLog = basicLogCollection::getInstance(); m_bVideoExists = false; m_bVideoOpened = false; m_nBufferSize = buffer_size; diff --git a/lib/App/mojo/mojoRemoteClient.h b/lib/App/mojo/mojoRemoteClient.h index 9a996f40..1b53a1b2 100644 --- a/lib/App/mojo/mojoRemoteClient.h +++ b/lib/App/mojo/mojoRemoteClient.h @@ -20,6 +20,7 @@ typedef basicRing RPC_CMD_QUEUE; class mojoVideoTransferHelper{ private: + basicLogCollection * m_pLog; char m_cCurrentFile[MAX_PATH]; bool m_bVideoExists; bool m_bVideoOpened; diff --git a/lib/App/serva/servaKernel.cpp b/lib/App/serva/servaKernel.cpp index cea1730a..10dacea0 100644 --- a/lib/App/serva/servaKernel.cpp +++ b/lib/App/serva/servaKernel.cpp @@ -220,8 +220,8 @@ void servaKernel::m_fThreadProc( void ){ if ( m_vEncodersPool.size() ) { for ( V_MEDIA_ENCODERS::iterator idx = m_vEncodersPool.begin(); idx < m_vEncodersPool.end(); idx++ ) { if ( (*idx)->getStatus() == ENCODER_FINISHED ) { - //handleEncodedVideo( (*idx)->getDBID() ); - delete( *idx ); + handleEncodedVideo( (*idx)->getDBID() ); + //delete( *idx ); m_vEncodersPool.erase( idx ); }; }; diff --git a/lib/App/serva/servaRemoteClientHandler.cpp b/lib/App/serva/servaRemoteClientHandler.cpp index 71e4e9c9..590c657a 100644 --- a/lib/App/serva/servaRemoteClientHandler.cpp +++ b/lib/App/serva/servaRemoteClientHandler.cpp @@ -2,20 +2,21 @@ #include "servaRemoteClient.h" #include "servaKernel.h" -#define LOG( X ) networkClientHandler::m_pLog->Log( "RPCH", this, X ) +#define LOG( X ) m_pLog->Log( "RPCH", this, X ) #ifdef DEBUG #define LOG_ERROR( X ) {\ char _tBfrErrMSG234[256];\ sprintf( _tBfrErrMSG234, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\ - networkClientHandler::m_pLog->Log( "RPCH", this, _LOG_ERROR, _tBfrErrMSG234 );\ + m_pLog->Log( "RPCH", this, _LOG_ERROR, _tBfrErrMSG234 );\ } #else - #define LOG_ERROR( X ) networkClientHandler::m_pLog->Log( "RPCH", this, _LOG_ERROR, X ); + #define LOG_ERROR( X ) m_pLog->Log( "RPCH", this, _LOG_ERROR, X ); #endif servaRPCHadnler::servaRPCHadnler( int SocketFD, networkServiceEngine *ptr ):basicThread(),networkClientHandler( SocketFD, ptr ),protocolParser(){ m_pEngine = ptr; m_pMaster = (servaRemoteClient *)ptr; + m_pLog = basicLogCollection::getInstance(); m_dRemoteMojoDBID = 0; m_dRemoteUpperDBID = 0; m_dRemoteBottomDBID = 0; @@ -322,6 +323,7 @@ bool servaRPCHadnler::peer_send_time_sync_ack( ARGUS_DATA_TIME_SYNC_ACK *ptr ){ servaVideoTransferHelper::servaVideoTransferHelper(){ + m_pLog = basicLogCollection::getInstance(); m_pFD = NULL; clear(); }; @@ -336,6 +338,9 @@ bool servaVideoTransferHelper::init( uint64_t MID, ARGUS_DATA_VIDEO_INFO *ptr ){ memcpy( &m_sIn, ptr, sizeof(ARGUS_DATA_VIDEO_INFO) ); servaKernel *pK = servaKernel::getInstance(); if ( pK ) { + char tB[256]; + sprintf( tB,"Data: %s, %d, %d, %d, %d, %s", ptr->UUID, ptr->DTS, ptr->DMS, ptr->WIDTH, ptr->HEIGHT, ptr->FMT ); + LOG(tB); m_nRemoteRefID = pK->registerRemoteVideo( ptr->UUID, MID, ptr->DTS, ptr->DMS, ptr->WIDTH, ptr->HEIGHT, ptr->FMT ); }; sprintf( m_cCurrentFile, "data/%s.%s", ptr->UUID, ptr->FMT ); @@ -391,7 +396,7 @@ uint32_t servaVideoTransferHelper::saveNextChunk( uint8_t *ptr ){ uint8_t perc = (uint8_t)((m_nSAVED * 100) / m_sIn.DATA_SIZE); if ( m_bOPerc != perc ) { m_bOPerc = perc; - servaKernel::getInstance()->updateEncodeStatus(tDBID, MEDIA_TRANSFERING, perc); + servaKernel::getInstance()->updateEncodeStatus(tDBID, MEDIA_TRANSFERING, perc ); }; } else servaKernel::getInstance()->updateEncodeStatus( tDBID, MEDIA_TRANSFERING, 50 ); }; diff --git a/lib/App/serva/servaRemoteClientHandler.h b/lib/App/serva/servaRemoteClientHandler.h index 1b2e9599..293dd7c3 100644 --- a/lib/App/serva/servaRemoteClientHandler.h +++ b/lib/App/serva/servaRemoteClientHandler.h @@ -25,6 +25,7 @@ typedef basicRing RPC_CMD_QUEUE; class servaVideoTransferHelper{ private: + basicLogCollection * m_pLog; char m_cCurrentFile[MAX_PATH]; uint64_t m_nRemoteRefID; FILE * m_pFD; @@ -47,6 +48,7 @@ class servaRPCHadnler: public basicThread, public networkClientHandler, public p private: servaRemoteClient * m_pMaster; servaMySQLDBC * m_pDBC; + basicLogCollection * m_pLog; char m_cRemoteIP[64]; char m_cRemoteIdentity[64]; uint64_t m_dRemoteMojoDBID; diff --git a/lib/rgoose/rgooseCamera.cpp b/lib/rgoose/rgooseCamera.cpp index a7b48a82..992a9d19 100644 --- a/lib/rgoose/rgooseCamera.cpp +++ b/lib/rgoose/rgooseCamera.cpp @@ -1023,6 +1023,7 @@ void ARGUS_Camera::m_fThreadProc( void ){ */ m_pCurrentROI = fusion_fetchROI(); if( m_pCurrentROI != NULL ) { + LOG( "GOABS" ); setWM( CAM_WS_GO_ABS_POSITION ); } else { // Lowest Priority to Web Client Commands @@ -1266,6 +1267,7 @@ bool ARGUS_Camera::makeSnap( uint32_t TargetRefID ){ if( tTask->CMD ){ tTask->CMD->CMD = PTZ_CAPTURE_ONLY; tTask->source_evt_id = TargetRefID; + LOG( "PTZ_CAPTURE_ONLY" ); return pushCamTask( tTask ); } else { free( tTask );