Browse Source

MEKOROT step_6z6

poocka 6 years ago
parent
commit
6114968ddf
  1. 20
      Projects/MEKOROT/MEKOROT_Kernel.cpp
  2. 2
      Projects/MEKOROT/mekorot.conf
  3. 8
      lib/data/media/video/videoAVLIBDestination.cpp
  4. 5
      lib/data/storage/storageProvider.cpp
  5. 1
      lib/data/storage/storageProvider.h

20
Projects/MEKOROT/MEKOROT_Kernel.cpp

@ -500,7 +500,7 @@ void mekorotKernel::m_fThreadProc(void){
};
};
} else {
unsigned long long cTS;
unsigned long long cTS;//must be checket logics
cTS = getMilliseconds();
if ((cTS - m_bOperationTO) > 1000) {
LOG_ERROR("FAILED TO COMMUNICATE WITH SENSOR");
@ -519,6 +519,8 @@ void mekorotKernel::m_fThreadProc(void){
m_bDeviceFlags[0] = false;
m_bStage = MEKOROT_KRNL_STG_PING_DEVICES;
LOG_ERROR("Going to Ping Mode!");
} else {
m_nOperation = MEKOROT_KRNL_OP_GSTG_DEV0;
};
} else {
LOG_ERROR("Set DevID FAILURE!");
@ -539,6 +541,8 @@ void mekorotKernel::m_fThreadProc(void){
m_bDeviceFlags[1] = false;
m_bStage = MEKOROT_KRNL_STG_PING_DEVICES;
LOG_ERROR("Going to Ping Mode!");
} else {
m_nOperation = MEKOROT_KRNL_OP_GSTG_DEV1;
};
} else {
LOG_ERROR("Set DevID FAILURE!");
@ -559,6 +563,8 @@ void mekorotKernel::m_fThreadProc(void){
m_bDeviceFlags[2] = false;
m_bStage = MEKOROT_KRNL_STG_PING_DEVICES;
LOG_ERROR("Going to Ping Mode!");
} else {
m_nOperation = MEKOROT_KRNL_OP_GSTG_DEV2;
};
} else {
LOG_ERROR("Set DevID FAILURE!");
@ -604,6 +610,7 @@ bool mekorotKernel::packetHandler(protocolPackage* Package) {
return true;
};
//m_bDeviceTO[cDeviceIDX] = getMilliseconds();
m_bOperationTO = getMilliseconds();
if (!m_bDeviceFlags[cDeviceIDX]) {
#ifdef DEBUG
char tBuff[64];
@ -612,23 +619,28 @@ bool mekorotKernel::packetHandler(protocolPackage* Package) {
#endif
m_bDeviceFlags[cDeviceIDX] = true;
};
switch (m_nOperation) {
case MEKOROT_KRNL_OP_PONG_DEV2: m_nOperation = MEKOROT_KRNL_OP_QSTG_DEV0; m_bStage = MEKOROT_KRNL_STG_WORKING; break;
case MEKOROT_KRNL_OP_GSTG_DEV2: m_nOperation = MEKOROT_KRNL_OP_QSTG_DEV0; break;
default: m_nOperation = m_nOperation << 1;
};
switch (cDeviceIDX) {
case 0: {
LOG("Left Vertical[0]");
//LOG("Left Vertical[0]");
if (!react(cDeviceIDX, Package)) {
LOG_ERROR("Error in REACT!");
};
break;
};
case 1: {
LOG("Center Horisontal[1]");
//LOG("Center Horisontal[1]");
if (!react(cDeviceIDX, Package)) {
LOG_ERROR("Error in REACT!");
};
break;
};
case 2: {
LOG("Right Vertical[2]");
//LOG("Right Vertical[2]");
if (!react(cDeviceIDX, Package)) {
LOG_ERROR("Error in REACT!");
};

2
Projects/MEKOROT/mekorot.conf

@ -14,7 +14,7 @@ KERNEL :
{
INPUT_0 :
{
SOURCE = "artsp://admin:4GetMyID@192.168.200.102:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif";
SOURCE = "rtsp://admin:4GetMyID@192.168.200.102:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif";
PROFILE = "MediaProfile001";
WIDTH = 704;
HEIGHT = 576;

8
lib/data/media/video/videoAVLIBDestination.cpp

@ -214,7 +214,15 @@ out: av_packet_free(&pkt);
*/
/*
AVFrame.format is not set
AVFrame.width or height is not set
AVFrame.format is not set
AVFrame.width or height is not set
AVFrame.format is not set
*/
bool videoAVLIBDestination::init(void){

5
lib/data/storage/storageProvider.cpp

@ -28,6 +28,7 @@ storageProvider::storageProvider(CSTR BasePath) :m_mCounterProtectorMutex(){
m_pEntryFolder = (CSTR) malloc( 9 );
m_pSeriesBase = (CSTR) malloc( 33 );
m_nSeriesCounter = 0;
m_bStorageInitComplete = false;
if( m_pBasePath!= NULL ) {
#ifdef __linux__
getcwd(m_pCWD, MAX_PATH_LEN );
@ -83,7 +84,8 @@ bool storageProvider::startNewSeries( void ){
LOG(Buffer);
#endif
m_nSeriesCounter = 0;
return true;
m_bStorageInitComplete = true;
return m_bStorageInitComplete;
};
bool storageProvider::startNewEntry( void ){
@ -167,6 +169,7 @@ CSTR storageProvider::getNewFileName( CSTR JustFileName ){
char tVal[1024];
CSTR RetVal;
m_mCounterProtectorMutex.lock();
if (!m_bStorageInitComplete) startNewEntry();
m_nSeriesCounter++;
if(JustFileName!=NULL)sprintf(JustFileName, "%s_%d", m_pSeriesBase, m_nSeriesCounter);
sprintf( tVal, "%s/%s/%s_%d", m_pCWD, m_pEntryFolder, m_pSeriesBase, m_nSeriesCounter );

1
lib/data/storage/storageProvider.h

@ -26,6 +26,7 @@ class storageProvider{
U32 m_nSeriesCounter;
CSTR m_pBasePath;
basicMutex m_mCounterProtectorMutex;
bool m_bStorageInitComplete;
public:
// Method to fetch singleton instance.
static storageProvider* getInstance(CSTR Base = (CSTR)"data/storage");

Loading…
Cancel
Save