Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evcamera
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evcamera
Commits
39bf8d53
提交
39bf8d53
authored
7月 23, 2020
作者:
tobyfan1980
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vgw: add more comments and logs
上级
e65ecfc1
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
0 行删除
+10
-0
videogateway.cc
server/videogateway.cc
+10
-0
没有找到文件。
server/videogateway.cc
浏览文件 @
39bf8d53
...
...
@@ -289,6 +289,8 @@ int setupRouter(void **ctx, void **s, string addr, int rcvQS=0)
if
(
rcvQS
!=
0
)
{
zmq_setsockopt
(
*
s
,
ZMQ_RCVHWM
,
&
rcvQS
,
sizeof
(
rcvQS
));
}
spdlog
::
info
(
"zmq binding {}"
,
addr
);
ret
=
zmq_bind
(
*
s
,
addr
.
c_str
());
if
(
ret
<
0
)
{
spdlog
::
error
(
"failed to bind zmq at {} for reason: {}, retrying load configuration..."
,
addr
,
zmq_strerror
(
zmq_errno
()));
...
...
@@ -314,6 +316,7 @@ int main()
darwinUrl
=
string
(
darwinUrl_
);
}
// set log level
auto
logLevel_
=
getenv
(
"LOG_LEVEL"
);
if
(
logLevel_
)
{
spdlog
::
set_level
(
spdlog
::
level
::
from_str
(
logLevel_
));
...
...
@@ -323,6 +326,7 @@ int main()
spdlog
::
set_level
(
spdlog
::
level
::
debug
);
}
// setup zmq, listening incoming connections
string
addr
=
"tcp://0.0.0.0:7123"
;
if
(
setupRouter
(
&
pRouterCtx
,
&
pRouter
,
addr
)
<
0
)
{
exit
(
1
);
...
...
@@ -372,9 +376,13 @@ int main()
if
(
deviceMap
.
count
(
sn
)
==
0
)
{
deviceLock
.
emplace
(
sn
,
new
mutex
());
deviceMap
.
emplace
(
sn
,
new
packet_processor_t
());
spdlog
::
info
(
"add camera {} to device map"
,
sn
);
deviceMap
[
sn
]
->
sn
=
sn
;
}
}
// for the first packet, change the transmitting state and start a thread to handle
// incoming packets.
if
(
deviceMap
[
sn
]
->
state
==
0
)
{
deviceMap
[
sn
]
->
state
=
1
;
thread
thWorker
=
thread
(
fn_worker
,
deviceMap
[
sn
]);
...
...
@@ -383,6 +391,8 @@ int main()
}
}
// for each camera, we cache at most 10 packets in a queue, when overflow, remove the earliest one
// before pushing to queue.
{
lock_guard
<
mutex
>
lg
(
*
deviceLock
[
sn
]);
if
(
deviceMap
[
sn
]
->
pktQue
.
size
()
>
10
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论