Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
a47cd2e8
提交
a47cd2e8
authored
9月 17, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
big refacting of communitation architect
上级
b8feb2d5
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
17 行删除
+23
-17
Makefile
opencv-motion-detect/Makefile
+2
-2
config.json
opencv-motion-detect/config.json
+7
-6
evdaemon.cpp
opencv-motion-detect/evdaemon.cpp
+14
-2
evpusher.cpp
opencv-motion-detect/evpusher.cpp
+0
-6
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+0
-1
没有找到文件。
opencv-motion-detect/Makefile
浏览文件 @
a47cd2e8
DEBUG
=
-g
#
DEBUG=-g
CC
=
gcc
CC
=
gcc
CPP
=
g++
CPP
=
g++
CPPFLAGS
=
$(DEBUG)
-Wall
-std
=
gnu++1z
CPPFLAGS
=
$(DEBUG)
-Wall
-std
=
gnu++1z
...
@@ -21,7 +21,7 @@ all: evmgr evpuller evpusher evslicer evmlmotion evmlmotion_d evdaemon evcloudsv
...
@@ -21,7 +21,7 @@ all: evmgr evpuller evpusher evslicer evmlmotion evmlmotion_d evdaemon evcloudsv
# sqlite C object
# sqlite C object
sqlite3.o
:
vendor/sqlite/sqlite3.c
sqlite3.o
:
vendor/sqlite/sqlite3.c
gcc
-D
SQLITE_THREADSAFE
=
1
-c
vendor/sqlite/sqlite3.c
gcc
-D
SQLITE_THREADSAFE
=
1
-c
vendor/sqlite/sqlite3.c
evmgr
:
evmgr.cpp database.cpp inc/utils.hpp inc/common.hpp inc/database.h inc/zmqhelper.hpp inc/tinythread.hpp $(SQLITE_SRC)
evmgr
:
evmgr.cpp database.cpp inc/utils.hpp inc/common.hpp inc/database.h inc/zmqhelper.hpp inc/tinythread.hpp $(SQLITE_SRC)
$(CPP)
$(CPPFLAGS)
$(LD_FLAGS)
-o
evmgr evmgr.cpp
$(SQLITE)
database.cpp
$(HEADERS)
$(LIBFFMPEG)
`
pkg-config
--cflags
--libs
vendor/lib/pkgconfig/libzmq.pc
`
$(LIBS)
$(CPP)
$(CPPFLAGS)
$(LD_FLAGS)
-o
evmgr evmgr.cpp
$(SQLITE)
database.cpp
$(HEADERS)
$(LIBFFMPEG)
`
pkg-config
--cflags
--libs
vendor/lib/pkgconfig/libzmq.pc
`
$(LIBS)
...
...
opencv-motion-detect/config.json
浏览文件 @
a47cd2e8
{
{
"data"
:{
"data"
:{
"
NMXH73Y2
"
:{
"
19JG1U6E
"
:{
"addr"
:
"127.0.0.1"
,
"addr"
:
"127.0.0.1"
,
"api-cloud"
:
"http://127.0.0.1:8089"
,
"api-cloud"
:
"http://127.0.0.1:8089"
,
"ipcs"
:[
"ipcs"
:[
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
"iid"
:
1
,
"iid"
:
1
,
"post"
:
30
,
"post"
:
30
,
"pre"
:
3
,
"pre"
:
3
,
"sn"
:
"
NMXH73Y2
"
,
"sn"
:
"
19JG1U6E
"
,
"status"
:
0
,
"status"
:
0
,
"thresh"
:
80
,
"thresh"
:
80
,
"type"
:
"motion"
"type"
:
"motion"
...
@@ -24,8 +24,9 @@
...
@@ -24,8 +24,9 @@
{
{
"addr"
:
"127.0.0.1"
,
"addr"
:
"127.0.0.1"
,
"iid"
:
1
,
"iid"
:
1
,
"enabled"
:
1
,
"port-pub"
:
5556
,
"port-pub"
:
5556
,
"sn"
:
"
NMXH73Y2
"
,
"sn"
:
"
19JG1U6E
"
,
"status"
:
0
"status"
:
0
}
}
],
],
...
@@ -34,7 +35,7 @@
...
@@ -34,7 +35,7 @@
"enabled"
:
1
,
"enabled"
:
1
,
"iid"
:
1
,
"iid"
:
1
,
"password"
:
""
,
"password"
:
""
,
"sn"
:
"
NMXH73Y2
"
,
"sn"
:
"
19JG1U6E
"
,
"status"
:
0
,
"status"
:
0
,
"token"
:
""
,
"token"
:
""
,
"urlDest"
:
"rtsp://40.73.41.176:554/test1"
,
"urlDest"
:
"rtsp://40.73.41.176:554/test1"
,
...
@@ -46,7 +47,7 @@
...
@@ -46,7 +47,7 @@
"enabled"
:
1
,
"enabled"
:
1
,
"iid"
:
1
,
"iid"
:
1
,
"path"
:
"slices"
,
"path"
:
"slices"
,
"sn"
:
"
NMXH73Y2
"
,
"sn"
:
"
19JG1U6E
"
,
"status"
:
0
"status"
:
0
}
}
]
]
...
@@ -62,7 +63,7 @@
...
@@ -62,7 +63,7 @@
"port-cloud"
:
5556
,
"port-cloud"
:
5556
,
"port-router"
:
5550
,
"port-router"
:
5550
,
"proto"
:
"zmq"
,
"proto"
:
"zmq"
,
"sn"
:
"
NMXH73Y2
"
,
"sn"
:
"
19JG1U6E
"
,
"status"
:
1
"status"
:
1
}
}
},
},
...
...
opencv-motion-detect/evdaemon.cpp
浏览文件 @
a47cd2e8
...
@@ -20,6 +20,7 @@ update: 2019/09/10
...
@@ -20,6 +20,7 @@ update: 2019/09/10
#include "inc/json.hpp"
#include "inc/json.hpp"
#include "inc/utils.hpp"
#include "inc/utils.hpp"
#include <unistd.h>
#include <unistd.h>
#include <sys/wait.h>
using
namespace
std
;
using
namespace
std
;
using
namespace
httplib
;
using
namespace
httplib
;
...
@@ -68,6 +69,18 @@ private:
...
@@ -68,6 +69,18 @@ private:
/// tracking sub-systems: evmgr, evpuller, evpusher, evml*, evslicer etc.
/// tracking sub-systems: evmgr, evpuller, evpusher, evml*, evslicer etc.
json
mapSubSystems
;
json
mapSubSystems
;
int
ping
(
void
*
s
)
{
int
ret
=
0
;
vector
<
vector
<
uint8_t
>
>
body
=
{
str2body
(
"evcloudsvc:0:0"
),
str2body
(
EV_MSG_META_PING
),
str2body
(
MSG_HELLO
)};
ret
=
z_send_multiple
(
s
,
body
);
if
(
ret
<
0
)
{
spdlog
::
error
(
"evdaemon {} failed to send ping: {}"
,
devSn
,
zmq_strerror
(
zmq_errno
()));
}
return
ret
;
}
int
reloadCfg
(
string
subModGid
=
""
)
int
reloadCfg
(
string
subModGid
=
""
)
{
{
// int bootType = 0;
// int bootType = 0;
...
@@ -81,7 +94,6 @@ private:
...
@@ -81,7 +94,6 @@ private:
// bootType = 3;
// bootType = 3;
// }
// }
int
ret
=
LVDB
::
getSn
(
this
->
info
);
int
ret
=
LVDB
::
getSn
(
this
->
info
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
spdlog
::
error
(
"evdaemon {} failed to get info"
,
this
->
devSn
);
spdlog
::
error
(
"evdaemon {} failed to get info"
,
this
->
devSn
);
...
@@ -599,7 +611,6 @@ public:
...
@@ -599,7 +611,6 @@ public:
spdlog
::
info
(
"evdaemon {} edge message processor had setup {}"
,
devSn
,
addr
);
spdlog
::
info
(
"evdaemon {} edge message processor had setup {}"
,
devSn
,
addr
);
// dealer port
// dealer port
strEnv
=
getenv
(
"CLOUD_ADDR"
);
strEnv
=
getenv
(
"CLOUD_ADDR"
);
if
(
strEnv
!=
nullptr
)
{
if
(
strEnv
!=
nullptr
)
{
...
@@ -628,6 +639,7 @@ public:
...
@@ -628,6 +639,7 @@ public:
thCloud
.
detach
();
thCloud
.
detach
();
spdlog
::
info
(
"evdaemon {} cloud message processor had setup {}"
,
devSn
,
cloudAddr
);
spdlog
::
info
(
"evdaemon {} cloud message processor had setup {}"
,
devSn
,
cloudAddr
);
ping
(
pDealer
);
this
->
thIdMain
=
this_thread
::
get_id
();
this
->
thIdMain
=
this_thread
::
get_id
();
...
...
opencv-motion-detect/evpusher.cpp
浏览文件 @
a47cd2e8
...
@@ -346,12 +346,6 @@ protected:
...
@@ -346,12 +346,6 @@ protected:
}
}
zmq_msg_close
(
&
msg
);
zmq_msg_close
(
&
msg
);
// if(pktCnt == 0 && packet.stream_index != 0) {
// pktIgnore++;
// av_packet_unref(&packet);
// continue;
// }
spdlog
::
debug
(
"packet stream indx: {:d}"
,
packet
.
stream_index
);
spdlog
::
debug
(
"packet stream indx: {:d}"
,
packet
.
stream_index
);
// relay
// relay
AVStream
*
in_stream
=
NULL
,
*
out_stream
=
nullptr
;
AVStream
*
in_stream
=
NULL
,
*
out_stream
=
nullptr
;
...
...
opencv-motion-detect/evslicer.cpp
浏览文件 @
a47cd2e8
...
@@ -43,7 +43,6 @@ private:
...
@@ -43,7 +43,6 @@ private:
#define NUM_DAYS_DEFAULT 2
#define NUM_DAYS_DEFAULT 2
#define MINUTES_PER_SLICE_DEFAULT 1
#define MINUTES_PER_SLICE_DEFAULT 1
// 2 days, 5 minutes per record
// 2 days, 5 minutes per record
void
*
pSubCtx
=
nullptr
,
*
pDealerCtx
=
nullptr
;
// for packets relay
void
*
pSubCtx
=
nullptr
,
*
pDealerCtx
=
nullptr
;
// for packets relay
void
*
pSub
=
nullptr
,
*
pDealer
=
nullptr
,
*
pDaemonCtx
=
nullptr
,
*
pDaemon
=
nullptr
;
void
*
pSub
=
nullptr
,
*
pDealer
=
nullptr
,
*
pDaemonCtx
=
nullptr
,
*
pDaemon
=
nullptr
;
string
urlOut
,
urlPub
,
urlRouter
,
devSn
,
mgrSn
,
selfId
,
pullerGid
;
string
urlOut
,
urlPub
,
urlRouter
,
devSn
,
mgrSn
,
selfId
,
pullerGid
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论