提交 91e87568 authored 作者: blu's avatar blu

init

上级 02100e65
...@@ -3,9 +3,11 @@ ...@@ -3,9 +3,11 @@
{ {
"name": "Mac", "name": "Mac",
"includePath": [ "includePath": [
"${workspaceFolder}/**", "${workspaceFolder}/opencv-motion-detect/inc/**",
"${workspaceFolder}/opencv-motion-detect/vendor/include/**",
"/usr/local/Cellar/opencv/4.1.0_2/include/opencv4", "/usr/local/Cellar/opencv/4.1.0_2/include/opencv4",
"/usr/local/Cellar/ffmpeg/4.1.4_1/include" "/usr/local/Cellar/ffmpeg/4.1.4_1/include",
"${workspaceFolder}/opencv-motion-detect/vendor/leveldb/include"
], ],
"defines": [], "defines": [],
"macFrameworkPath": [ "macFrameworkPath": [
......
...@@ -199,9 +199,6 @@ namespace LVDB { ...@@ -199,9 +199,6 @@ namespace LVDB {
int clearDB(string fileName) { int clearDB(string fileName) {
return 0; return 0;
} }
typedef int (*cb_verify_str)(const string&);
typedef int (*cb_verify_json)(const json&);
int getValue(string &value, string key, string fileName, cb_verify_str cb) { int getValue(string &value, string key, string fileName, cb_verify_str cb) {
int ret = 0; int ret = 0;
...@@ -404,12 +401,21 @@ togo_end: ...@@ -404,12 +401,21 @@ togo_end:
return 0; return 0;
} }
int getLocalConfig(json &config, string fileName){ int getLocalConfig(json &config, string key, string fileName){
return getValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig); if(key.empty()) {
return getValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig);
}else{
return getValue(config, key, fileName, _validateConfig);
}
}; };
int setLocalConfig(json &config, string fileName){ int setLocalConfig(json &config, string key, string fileName){
return setValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig); if(key.empty()) {
return setValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig);
}else{
return setValue(config, key, fileName, _validateConfig);
}
}; };
// slices // slices
......
...@@ -560,7 +560,7 @@ protected: ...@@ -560,7 +560,7 @@ protected:
if(ret < 0) { if(ret < 0) {
spdlog::error("evmlmotion {} failed to send event {} to {}: {}", this->selfId, evt, this->slicerGid, zmq_strerror(zmq_errno())); spdlog::error("evmlmotion {} failed to send event {} to {}: {}", this->selfId, evt, this->slicerGid, zmq_strerror(zmq_errno()));
}else{ }else {
spdlog::info("evmlmotion {} send event: {}", this->selfId, evt); spdlog::info("evmlmotion {} send event: {}", this->selfId, evt);
} }
} }
......
...@@ -228,7 +228,7 @@ private: ...@@ -228,7 +228,7 @@ private:
if(ipc.count("port") == 0) { if(ipc.count("port") == 0) {
ipcPort = "554"; ipcPort = "554";
}else{ }else{
ipcPort = ipc["port"]; ipcPort = to_string(ipc["port"]);
} }
...@@ -330,6 +330,7 @@ protected: ...@@ -330,6 +330,7 @@ protected:
bool bStopSig = false; bool bStopSig = false;
uint64_t pktCnt = 0; uint64_t pktCnt = 0;
spdlog::info("evpulelr {} reading packets from {}", selfId, urlIn);
while (true) { while (true) {
if(checkStop() == true) { if(checkStop() == true) {
bStopSig = true; bStopSig = true;
......
...@@ -301,9 +301,11 @@ namespace cloudutils ...@@ -301,9 +301,11 @@ namespace cloudutils
/* /*
{ {
"time":0, "time":0,
"lastupdated": 0,
"code":0, "code":0,
"data":{ "data":{
"ILSEVMGR1":{ "ILSEVMGR1":{
"lastupdated": 0,
"sn":"ILSEVMGR1", "sn":"ILSEVMGR1",
"addr":"172.31.0.76", "addr":"172.31.0.76",
"addr-cloud":"172.31.0.76", "addr-cloud":"172.31.0.76",
...@@ -317,6 +319,7 @@ namespace cloudutils ...@@ -317,6 +319,7 @@ namespace cloudutils
"proto":"rtsp", "proto":"rtsp",
"user":"admin", "user":"admin",
"password":"FWBWTU", "password":"FWBWTU",
"port": 554,
"status":1, "status":1,
"modules":{ "modules":{
"evpuller":[ "evpuller":[
......
...@@ -21,6 +21,14 @@ namespace LVDB { ...@@ -21,6 +21,14 @@ namespace LVDB {
#define LVDB_KEY_SUFFIX_BACK "_bak" #define LVDB_KEY_SUFFIX_BACK "_bak"
#define LVDB_KEY_SN "SN" #define LVDB_KEY_SN "SN"
#define LVDB_KEY_CONFIG "CONFIG" #define LVDB_KEY_CONFIG "CONFIG"
typedef int (*cb_verify_str)(const string&);
typedef int (*cb_verify_json)(const json&);
int setValue(const string &value, string key, string fileName, cb_verify_str cb);
int getValue(string &value, string key, string fileName, cb_verify_str cb);
int setValue(const string &value, string key, string fileName, cb_verify_json cb);
int getValue(string &value, string key, string fileName, cb_verify_json cb);
// //
json * findConfigModule(json &config, string sn, string moduleName, int iid); json * findConfigModule(json &config, string sn, string moduleName, int iid);
...@@ -32,8 +40,8 @@ namespace LVDB { ...@@ -32,8 +40,8 @@ namespace LVDB {
int getSn(json &info,string fileName=LVDB_FILE_GENERAL); int getSn(json &info,string fileName=LVDB_FILE_GENERAL);
// cloudutils::config // cloudutils::config
int getLocalConfig(json &config, string fileName=LVDB_FILE_GENERAL); int getLocalConfig(json &config, string key = "", string fileName=LVDB_FILE_GENERAL);
int setLocalConfig(json &config, string fileName=LVDB_FILE_GENERAL); int setLocalConfig(json &config, string key = "", string fileName=LVDB_FILE_GENERAL);
// slices // slices
int getSlices(json &slices, string fileName); int getSlices(json &slices, string fileName);
......
...@@ -22,15 +22,15 @@ namespace zmqhelper { ...@@ -22,15 +22,15 @@ namespace zmqhelper {
#define MSG_HELLO "hello" #define MSG_HELLO "hello"
#define EV_MSG_META_PING "ping" #define EV_MSG_META_PING "ping"
#define EV_MSG_META_PONG "pong" #define EV_MSG_META_PONG "pong"
#define EV_MSG_META_PEEROFFLINE "offline"
#define EV_MSG_META_RESTART "restart"
#define EV_MSG_META_UPDATE "update"
#define EV_MSG_META_EVENT "event" #define EV_MSG_META_EVENT "event"
#define EV_MSG_META_CMD "cmd"
#define EV_MSG_META_AVFORMATCTX "afctx" #define EV_MSG_META_AVFORMATCTX "afctx"
#define EV_MSG_TYPE_AI_MOTION "ai_motion" #define EV_MSG_TYPE_AI_MOTION "ai_motion"
#define EV_MSG_TYPE_CONN_STAT "connstat" #define EV_MSG_TYPE_CONN_STAT "connstat"
#define EV_MSG_TYPE_SYS_STAT "sysstat" #define EV_MSG_TYPE_SYS_STAT "sysstat"
// #define EV_MSG_CMD_RESTART "restart"
// #define EV_MSG_CMD_UPDATE "update"
#define EV_MSG_EVENT_MOTION_START "start" #define EV_MSG_EVENT_MOTION_START "start"
#define EV_MSG_EVENT_MOTION_END "end" #define EV_MSG_EVENT_MOTION_END "end"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论