You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

528 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
12 months ago
​
12 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Dr.Frucht Systems Ltd.
  3. // Copyright � 2000-2022. All Rights Reserved.
  4. // Version 1.0 11/19/2022
  5. // Last modification: 11/19/2022
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: mojoKernel.cpp
  9. // AUTHOR: gagua
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // LRF_Kernel.cpp
  13. //----------------------------------------------------------------------------
  14. //
  15. #include "servaKernel.h"
  16. #include "../data/json/json_tool.h"
  17. #include <strings.h>
  18. #include <sys/time.h>
  19. #include <time.h>
  20. #include <json/value.h>
  21. #include <json/writer.h>
  22. #include <json/reader.h>
  23. //#include "../common/kernelEventFilterAPF.h"
  24. //#include "../common/kernelEventFilterTrain.h"
  25. //#include "../common/kernelModuleEmbedVideo.h"
  26. #include "../common/serverMySQL_dataBinder.h"
  27. #include "servaModBusManager.h"
  28. #define LOG( X ) kernelPrototype::m_pLog->Log( "KRNL", this, X )
  29. #ifdef DEBUG
  30. #define LOG_ERROR( X ) {\
  31. char _tBfrErrMSG234[256];\
  32. sprintf( _tBfrErrMSG234, "In file %s[%d] in func:%s %s",__FILE__, __LINE__, __func__, X );\
  33. kernelPrototype::m_pLog->Log( "KRNL", this, _LOG_ERROR, _tBfrErrMSG234 );\
  34. }
  35. #else
  36. #define LOG_ERROR( X ) kernelPrototype::m_pLog->Log( "KRNL", this, _LOG_ERROR, X );
  37. #endif
  38. servaKernel *servaKernel::_instance = NULL;
  39. servaKernel *servaKernel::getInstance( config_setting_t *ptr ){
  40. if ( _instance == NULL ) {
  41. _instance = new servaKernel( ptr );
  42. };
  43. return _instance;
  44. };
  45. servaKernel::servaKernel( config_setting_t *ptr ):kernelPrototype( ptr ){
  46. //m_pEventHeap = basicEventHeap::getInstance();
  47. // memset( &m_sSysInfo, 0, sizeof( DBC_SYS_LOAD_INFO ));
  48. //m_pShadow = NULL;
  49. //m_pSystemAnchor = NULL;
  50. // m_bSessionStarted = false;
  51. // m_bWorkWithRemoteServer = false;
  52. // m_bKeepLocalReport = true;
  53. // m_bMediaMode = 0;
  54. m_pLifeMonitor = servaLifeMonitoring::getInstance();
  55. m_pSM = NULL;
  56. m_pRPC = NULL;//??
  57. m_pModBus = NULL;
  58. memset( &m_sServaConfig, 0, sizeof( DBC_SERVA_CONFIG ));
  59. setWM( WM_NONE );
  60. };
  61. servaKernel::~servaKernel(){
  62. WaitFinish( true );
  63. //stopSession( false );
  64. //while(1){
  65. // char tB[200];
  66. // sprintf( tB, "[%d] Seconds Till System Restart", timeout );
  67. // LOG( "BopBop!" );
  68. // SLEEP(1000);
  69. //};
  70. if ( m_pModBus ) {
  71. delete( (servaModBusManager *) m_pModBus );
  72. };
  73. #ifdef LINUX_KERNEL_WATCHDOG
  74. LOG("Disable WD!");
  75. if( m_iWatchdogFd > -1 ) {
  76. char tB[64];
  77. sprintf( tB, "-1\n" );
  78. //ToDo: Make Error Handling here!
  79. write( m_iWatchdogFd, &tB, strlen( tB ) );
  80. };
  81. LOG("WatchDog turned Off!");
  82. #endif
  83. _instance = NULL;
  84. };
  85. bool servaKernel::create(){
  86. if( m_pSettings != NULL ) {
  87. config_setting_t * pSetting;
  88. int tVal;
  89. const char * tBuf;
  90. char tBuffer[128];
  91. LOG("Getting Settings ...");
  92. /*if( !config_setting_lookup_string( m_pSettings, MOJO_KERNEL_TAG_SERVER_IDENTITY, &tBuf ) ){
  93. char * tVar;
  94. char * tTS;
  95. tTS = getTStr(NULL);
  96. tVar = MD5String(tTS);
  97. free(tTS);
  98. sprintf( m_sIdentity, tVar );
  99. pSetting = config_setting_add( m_pSettings, MOJO_KERNEL_TAG_SERVER_IDENTITY, CONFIG_TYPE_STRING );
  100. config_setting_set_string( pSetting, tVar );
  101. free( tVar );
  102. basicSettingsProvider::getInstance()->compromise();
  103. LOG("Server Identity not defined - generating new!");
  104. } else {
  105. sprintf( m_sIdentity, tBuf );
  106. sprintf( tBuffer, "Server Identity Read From Settings: %s", tBuf );
  107. LOG( tBuffer );
  108. };
  109. if( !config_setting_lookup_int( m_pSettings, MOJO_KERNEL_TAG_SITE_ID, &tVal ) ){
  110. tVal = m_nInstanceID = 1;
  111. pSetting = config_setting_add( m_pSettings, MOJO_KERNEL_TAG_SITE_ID, CONFIG_TYPE_INT );
  112. config_setting_set_int( pSetting, tVal );
  113. basicSettingsProvider::getInstance()->compromise();
  114. LOG("Site ID not defined - using [1] as number!");
  115. } else {
  116. m_nInstanceID = tVal;
  117. sprintf( tBuffer, "App Instance ID Read From Settings: %d", m_nInstanceID );
  118. LOG( tBuffer );
  119. };*/
  120. basicSettingsProvider::getInstance()->validate();
  121. } else {
  122. LOG_ERROR("Failed Read Config Settings!");
  123. return false;
  124. };
  125. LOG("Register Server ... ");
  126. registerServA();
  127. m_pSM = servaSessionManager::getInstance( m_pSettings );
  128. if ( m_pSM ){
  129. cleanUpMess();
  130. if ( m_pSM->create() ) {
  131. LOG("Session Manager Created");
  132. servaModBusManager * tModBus = servaModBusManager::getInstance();
  133. if( tModBus ){
  134. LOG("Have ModBus Instance");
  135. if( tModBus->create() ){
  136. LOG("Modbus Created");
  137. m_pModBus = (void *) tModBus;
  138. } else delete( tModBus );
  139. };
  140. /* Test Composer */
  141. //servaVideoComposer *tVC = new servaVideoComposer( 49 );
  142. //if ( tVC ) {
  143. // tVC->compose();
  144. //};
  145. m_pRPC = servaRemoteClient::getInstance(this);
  146. if ( m_pRPC ) {
  147. if( m_pRPC->start() ) return init();
  148. };
  149. };
  150. };
  151. return false;
  152. };
  153. void servaKernel::m_fThreadProc( void ){
  154. time_t tTimeTSeconds = 0;
  155. time_t cTimeTSeconds = 0;
  156. m_bThreadStatus = TH_WORKING;
  157. LOG("ServA Started!");
  158. while ( m_bThreadStatus < TH_ENDED ) {
  159. if( DBC_RPC_WEB_CMD * tCMD = m_pDBC->fetchWebCmd( 0 ) ) {
  160. m_pDBC->updateWebCmdStatus( tCMD->id, DBC_CMD_STARTED );
  161. switch( tCMD->cmd ){
  162. case CMD_KRNL_RELOAD:{
  163. LOG("Reload ServA Node!");
  164. m_bThreadStatus = TH_ENDED;
  165. setExitCause( EXIT_CODE_RELOAD_SERVICES );
  166. break;
  167. };
  168. case CMD_KRNL_RESTART:{
  169. LOG("Restart ServA Node!");
  170. m_bThreadStatus = TH_ENDED;
  171. setExitCause( EXIT_CODE_KERNEL_CLEAR );
  172. break;
  173. };
  174. case CMD_KRNL_FACTORY_RESET:{
  175. LOG("Restart ServA -> Factory Reset!");
  176. m_bThreadStatus = TH_ENDED;
  177. setExitCause( EXIT_CODE_FACTORY_RESET );
  178. break;
  179. };
  180. case CMD_NODES_RELOAD:{
  181. //if( m_pNodeFactory != NULL ) {
  182. // m_pNodeFactory->reloadNodes();
  183. //};
  184. break;
  185. };
  186. case CMD_NODE_RELOAD:{
  187. uint32_t tNodeID = atoi( tCMD->param );
  188. //if( m_pNodeFactory != NULL ) {
  189. // m_pNodeFactory->reloadNode( tNodeID );
  190. //};
  191. break;
  192. };
  193. case CMD_KRNL_PNP:{
  194. //if( m_pHardwareManager!= NULL ) {
  195. // LOG_ERROR( "Restart and Detect HardWare!" );
  196. // // Must be shutdowned all service that uses hardware prior to detection!
  197. // m_bThreadStatus = TH_ENDED;
  198. // setExitCause( EXIT_CODE_DETECT_HARDWARE ); // Go -> Detect Hardware in BACKEND
  199. //};
  200. break;
  201. };
  202. case CMD_KRNL_UPDATE_IDENT:{
  203. //LOG("Restart Mojo -> Update Ident!");
  204. //sprintf( m_sIdentity, tCMD->PARAM );
  205. //config_setting_remove ( m_pSettings, MOJO_KERNEL_TAG_SERVER_IDENTITY );
  206. //config_setting_t *pSetting = config_setting_add( m_pSettings, MOJO_KERNEL_TAG_SERVER_IDENTITY, CONFIG_TYPE_STRING );
  207. //config_setting_set_string( pSetting, tCMD->PARAM );
  208. //basicSettingsProvider::getInstance()->compromise();
  209. //basicSettingsProvider::getInstance()->validate();
  210. //m_pDBC->updateServerIdentity( m_nServerID, m_sIdentity );
  211. m_bThreadStatus = TH_ENDED;
  212. setExitCause( EXIT_CODE_KERNEL_CLEAR );
  213. break;
  214. };
  215. case CMD_KRNL_REPLACE_DATABASE:{
  216. LOG("Restart Mojo -> Replace Database!");
  217. //CSTR tNAME = m_pDBC->getDataParam( 0 );
  218. //CSTR tUSER = m_pDBC->getDataParam( 1 );
  219. //CSTR tGROUP = m_pDBC->getDataParam( 2 );
  220. //if ( tNAME ) {
  221. // char tB[256];
  222. // sprintf( tB,"./data/%s.db", tCMD->PARAM );
  223. // if ( fileExist( tB )) {
  224. // LOG("Restart Mojo -> Close Database!");
  225. //Closing Database
  226. // delete( m_pDBC );
  227. // m_pDBC = NULL;
  228. // LOG("Restart Mojo -> Delete Database!");
  229. // //unlink( tNAME );
  230. // LOG("Restart Mojo -> Copy Database!");
  231. // fileCopy( tB, tNAME );
  232. // LOG("Restart Mojo -> Chown Database!");
  233. // ch_chown( tNAME, tUSER, tGROUP );
  234. // LOG("Restart Mojo -> Delete Old Database!");
  235. // unlink( tB );
  236. // m_bThreadStatus = TH_ENDED;
  237. // LOG("Restart Mojo -> Exit!");
  238. // setExitCause( EXIT_CODE_NO_DATABASE );//EXIT_CODE_RELOAD_SERVICES );
  239. // m_bThreadStatus = TH_ENDED;
  240. // } else {
  241. // LOG_ERROR("New Database Does not Exists!");
  242. // };
  243. //free( tNAME );
  244. //free( tUSER );
  245. //free( tGROUP );
  246. //};
  247. break;
  248. };
  249. case CMD_KRNL_SYNC_TIME:{
  250. uint32_t uts = atoi( tCMD->param );
  251. if( uts ){
  252. #if ( __GLIBC__ < 3 ) && ( __GLIBC_MINOR__ < 31 )
  253. time_t ts = (time_t)uts;
  254. if( stime( &ts ) == 0 ){
  255. // Restert Server;
  256. m_bThreadStatus = TH_ENDED;
  257. setExitCause( EXIT_CODE_KERNEL_CLEAR );
  258. };
  259. #else
  260. timespec ts;
  261. ts.tv_sec = (time_t)uts;
  262. ts.tv_nsec = 0;
  263. if( clock_settime( CLOCK_REALTIME, &ts ) == 0 ){
  264. // Restert Server;
  265. m_bThreadStatus = TH_ENDED;
  266. setExitCause( EXIT_CODE_KERNEL_CLEAR );
  267. };
  268. #endif
  269. };
  270. break;
  271. };
  272. case CMD_KRNL_SYSTEM_TASK:{
  273. break;
  274. };
  275. case CMD_KRNL_PURGE_SESSION:{
  276. if ( tCMD->aux_id ) {
  277. LOG("Purge Session");
  278. if (m_pSM) m_pSM->eraseSession( tCMD->aux_id );
  279. };
  280. break;
  281. };
  282. case CMD_KRNL_SET_SESSION_HZL:{
  283. uint8_t tLVL = atoi( tCMD->param );
  284. if ( tCMD->aux_id ) {
  285. LOG("Life Session Hazard Level Updated");
  286. /* Actual DataBase chenge done in WebApp Here we just making internal Event */
  287. SESSION_RATE_DATA *tData = (SESSION_RATE_DATA *) malloc( sizeof( SESSION_RATE_DATA ) );
  288. if ( tData ) {
  289. tData->level = tLVL;
  290. tData->track_id = tCMD->aux_id;
  291. EVENT_CONTAINER * tEvt = createBasicEvent( 0, EVT_CLASS_SYSTEM, EVT_SRV_SESSION_RATED, NULL, NULL, tData );
  292. if ( tEvt ) {
  293. basicEventHeap::getInstance()->broadcast( tEvt );
  294. } else {
  295. free( tData );
  296. };
  297. };
  298. };
  299. break;
  300. };
  301. case CMD_KRNL_TEST_MODBUS:{
  302. MODBUS_TEST_DATA *tData = (MODBUS_TEST_DATA *) malloc( sizeof( MODBUS_TEST_DATA ) );
  303. if ( tData ) {
  304. tData->id = tCMD->aux_id;
  305. tData->c_OutBits = atoi( tCMD->param );
  306. EVENT_CONTAINER * tEvt = createBasicEvent( 0, EVT_CLASS_SYSTEM, EVT_SRV_MODBUS_TEST_M, NULL, NULL, tData );
  307. if ( tEvt ) {
  308. basicEventHeap::getInstance()->broadcast( tEvt );
  309. } else {
  310. free( tData );
  311. };
  312. };
  313. break;
  314. };
  315. case CMD_KRN_COMPOSE_SESSION_VIDEOS:{
  316. uint64_t session_id = tCMD->aux_id;
  317. if ( session_id ) {
  318. char tB[256];
  319. sprintf( tB, "Ordered Compose of session %lld", session_id );
  320. LOG( tB );
  321. uint64_t platform_id = tCMD->aux_id;
  322. servaVideoComposer *tCMP = new servaVideoComposer( session_id );
  323. if ( tCMP ) {
  324. if ( tCMP->compose() ) {
  325. m_vComposersPool.push_back(tCMP);
  326. } else {
  327. LOG("Disengage Composer!");
  328. };
  329. };
  330. };
  331. break;
  332. };
  333. };
  334. m_pDBC->updateWebCmdStatus( tCMD->id, DBC_CMD_READY_TO_CLEAN );
  335. free( tCMD );
  336. };
  337. cTimeTSeconds = time( NULL );
  338. if( cTimeTSeconds != tTimeTSeconds ){ //Each Second
  339. tTimeTSeconds = cTimeTSeconds;
  340. #ifdef LINUX_KERNEL_WATCHDOG
  341. if( m_iWatchdogFd > -1 ) {
  342. char tB[64];
  343. sprintf( tB, "2000\n" );
  344. //ToDo: Make Error Handling here!
  345. write( m_iWatchdogFd, &tB, strlen( tB ) );
  346. };
  347. #endif
  348. m_pDBC->cleanWebCmd();
  349. updateStatus();
  350. if ( m_vEncodersPool.size() ) {
  351. for ( V_MEDIA_ENCODERS::iterator idx = m_vEncodersPool.begin(); idx < m_vEncodersPool.end(); ) {
  352. if ( (*idx)->getStatus() == ENCODER_FINISHED ) {
  353. handleEncodedVideo( *idx );
  354. m_vEncodersPool.erase( idx );
  355. } else idx++;
  356. };
  357. };
  358. if ( m_vComposersPool.size() ) {
  359. for ( V_VIDEO_COMPOSERS::iterator idx = m_vComposersPool.begin(); idx< m_vComposersPool.end(); ) {
  360. if ( (*idx)->isFinished() ) {
  361. delete( *idx );
  362. m_vComposersPool.erase( idx );
  363. } else idx++;
  364. };
  365. };
  366. if ( m_sServaConfig.encoderLimit ) {
  367. if (m_vEncodersPool.size() < m_sServaConfig.encoderLimit) {
  368. if (uint64_t new_id = m_pDBC->getRecentMediaId()) {
  369. LOG("New Encoder!");
  370. if ( processVideoFile( new_id ) ) {
  371. updateEncodeStatus( new_id, MEDIA_ENCODE_PROGRESS, 0 );
  372. } else {
  373. LOG_ERROR("Cannot Encode Queued Video -> Removing Task!");
  374. m_pDBC->removeRemoteMediaInfo( new_id );
  375. };
  376. };
  377. };
  378. } else LOG_ERROR("Video Encoders Disabled??");
  379. if ( m_pSM ) m_pSM->validate();
  380. if ( m_pLifeMonitor ) m_pLifeMonitor->validate();
  381. if ( m_pModBus ) ((servaModBusManager *)m_pModBus)->validate();
  382. //m_pHardwareManager->updateSysInfo( &m_sSysInfo );
  383. if ( m_pVideoComposer == NULL ) {
  384. uint64_t tSID = m_pDBC->getSessionWithUnmergedVideo( m_sServaConfig.composerProceedDelay );
  385. if ( tSID ) {
  386. m_pVideoComposer = new servaVideoComposer( tSID );
  387. if ( m_pVideoComposer ) {
  388. if( !m_pVideoComposer->compose() ){
  389. delete( m_pVideoComposer );
  390. m_pVideoComposer = NULL;
  391. };
  392. };
  393. };
  394. };
  395. };
  396. SLEEP(SLEEP_KERNEL_INTERVAL);
  397. };
  398. };
  399. void servaKernel::updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc ){
  400. m_pDBC->updateEncodeStatus( dbid, status, perc );
  401. };
  402. bool servaKernel::processVideoFile( uint64_t dbid ){
  403. if ( dbid == 0 ) return false;
  404. DBC_RPC_MEDIA_INFO *NFO = m_pDBC->getRemoteMediaInfo( dbid );
  405. if ( NFO ) {
  406. if ( strcmp( NFO->fmt, "mp4" ) == 0 ) {
  407. #ifdef DEBUG
  408. LOG("Skip Convertion of MP4");
  409. #endif
  410. DBC_RPC_MEDIA_INFO_EX *tP = m_pDBC->getRemoteMediaInfoEx( dbid );
  411. if ( tP ) {
  412. if( !m_pSM->addVideo( tP )){
  413. LOG_ERROR("Cannot Add to session Media Info!");
  414. };
  415. #ifdef DEBUG
  416. LOG("Delete Extended Info");
  417. #endif
  418. free( tP );
  419. } else {
  420. LOG_ERROR("Cannot get Extended Encoder Queue Media Info!");
  421. };
  422. free( NFO );
  423. return false;
  424. };
  425. servaMediaEncoder *ptr = new servaMediaEncoder(dbid);
  426. if ( ptr ) {
  427. #ifdef DEBUG
  428. LOG("Encoder Constructed!");
  429. #endif
  430. char tA[MAX_PATH];
  431. char tB[MAX_PATH];
  432. //Todo -> Instead GetSessionBase -> calc Base based on TS of video
  433. CSTR BASE = m_pSM->getSessionBase( NFO->session_id );
  434. if( BASE ){
  435. sprintf( tA,"%s/%s.%s", BASE, NFO->uuid, NFO->fmt );
  436. LOG(tA);
  437. sprintf( tB,"%s/%s.mp4", BASE, NFO->uuid );
  438. LOG(tB);
  439. free(BASE);
  440. if ( ptr->create( tA, tB, NFO->fps ) ) {
  441. #ifdef DEBUG
  442. LOG("Encoder Created!");
  443. #endif
  444. m_vEncodersPool.push_back( ptr );
  445. return true;
  446. };
  447. };
  448. delete( ptr );
  449. };
  450. free( NFO );
  451. } else LOG("No Video Info!!");
  452. return false;
  453. };
  454. void servaKernel::handleEncodedVideo( servaMediaEncoder *ptr ){
  455. if ( ptr ) {
  456. m_pDBC->updateEncodeFormat( ptr->getDBID(), ptr->getDstFormat() );
  457. DBC_RPC_MEDIA_INFO_EX *tP = m_pDBC->getRemoteMediaInfoEx( ptr->getDBID() );
  458. if ( tP ) {
  459. if( m_pSM->addVideo( tP )){
  460. m_pDBC->removeRemoteMediaInfo( ptr->getDBID() );
  461. } else {
  462. LOG_ERROR("Cannot Add to session Media Info!");
  463. };
  464. LOG("Delete Extended Info");
  465. free( tP );
  466. } else {
  467. LOG_ERROR("Cannot get Extended Encoder Queue Media Info!");
  468. };
  469. LOG("Delete Encoder");
  470. delete( ptr );
  471. LOG("Done");
  472. };
  473. };
  474. bool servaKernel::dispatchEvent( EVENT_CONTAINER *Evt ){
  475. if ( Evt == NULL ) return false;
  476. /*
  477. switch ( Evt->m_eClass ) {
  478. case EVT_CLASS_VIDEO:{
  479. switch ( Evt->m_eType ) {
  480. case EVT_SRV_VIDEO_CHUNK:{
  481. SERVA_VIDEO_TRANSFER_INFO *tData = ( SERVA_VIDEO_TRANSFER_INFO * ) Evt->m_pEvtData;
  482. if ( tData ){
  483. if ( tData->status == MEDIA_STORED ) {
  484. updateEncodeStatus(tData->db_id, tData->status, tData->perc);
  485. };
  486. };
  487. return false; // Kernel is Final Destination for that Event
  488. };
  489. };
  490. break;
  491. };
  492. };*/
  493. return true;
  494. };
  495. //Todo -> Startup Cleanup Media Encoder Queue (with ability to finish unfinishing jobs -> Drop just unsucessful transfers
  496. // Make Treshold of Running Encoders to a server
  497. #undef LOG
  498. #undef LOG_ERROR