Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
e64ec7c5
提交
e64ec7c5
authored
10月 28, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compiler warnings
上级
23f5fa90
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
3 行增加
和
69 行删除
+3
-69
evdaemon.cpp
opencv-motion-detect/evdaemon.cpp
+2
-9
evmgr.cpp
opencv-motion-detect/evmgr.cpp
+0
-11
evmlmotion.cpp
opencv-motion-detect/evmlmotion.cpp
+0
-13
evpuller.cpp
opencv-motion-detect/evpuller.cpp
+1
-9
evpusher.cpp
opencv-motion-detect/evpusher.cpp
+0
-12
evslicer.cpp
opencv-motion-detect/evslicer.cpp
+0
-12
av_common.hpp
opencv-motion-detect/inc/av_common.hpp
+0
-1
avcvhelpers.hpp
opencv-motion-detect/inc/avcvhelpers.hpp
+0
-2
没有找到文件。
opencv-motion-detect/evdaemon.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,10 +6,6 @@ created: 2019/09/04
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-lambda-capture"
#include <queue>
#include <cstdlib>
#include <algorithm>
...
...
@@ -64,7 +60,7 @@ private:
thread
thHeartBeat
;
mutex
mutHeartBeat
;
bool
bGotHeartBeat
=
false
;
//
bool bGotHeartBeat = false;
int
heartBeatTimeout
=
60
*
1000
;
...
...
@@ -107,7 +103,6 @@ private:
// lock_guard<mutex> lock(cacheLock);
json
&
data
=
this
->
config
;
string
peerId
;
pid_t
pid
;
for
(
auto
&
[
k
,
v
]
:
data
.
items
())
{
if
(
k
==
this
->
devSn
)
{
peerId
=
v
[
"sn"
].
get
<
string
>
()
+
":evmgr:0"
;
...
...
@@ -368,7 +363,6 @@ private:
int
handleEdgeMsg
(
vector
<
vector
<
uint8_t
>
>
&
body
)
{
int
ret
=
0
;
zmq_msg_t
msg
;
// ID_SENDER, ID_TARGET, meta ,MSG
string
selfId
,
peerId
,
meta
;
if
(
body
.
size
()
==
2
&&
body
[
1
].
size
()
==
0
)
{
...
...
@@ -718,7 +712,7 @@ public:
res
.
set_content
(
this
->
config
.
dump
(),
"text/json"
);
});
svr
.
Post
(
"/config"
,
[
this
](
const
Request
&
req
,
Response
&
res
)
{
svr
.
Post
(
"/config"
,
[](
const
Request
&
req
,
Response
&
res
)
{
json
ret
;
ret
[
"code"
]
=
0
;
ret
[
"msg"
]
=
"ok"
;
...
...
@@ -894,7 +888,6 @@ public:
void
cleanup
(
int
signal
)
{
int
status
;
while
(
waitpid
((
pid_t
)
(
-
1
),
0
,
WNOHANG
)
>
0
)
{}
}
...
...
opencv-motion-detect/evmgr.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h>
#include <string>
#include <thread>
...
...
@@ -42,7 +35,6 @@ private:
mutex
cacheLock
;
queue
<
string
>
eventQue
;
mutex
eventQLock
;
time_t
tsLastBoot
,
tsUpdateTime
;
string
drport
=
"5549"
;
thread
thCloudMsgHandler
;
...
...
@@ -171,7 +163,6 @@ error_exit:
int
handleEdgeMsg
(
vector
<
vector
<
uint8_t
>
>
&
body
)
{
int
ret
=
0
;
zmq_msg_t
msg
;
// ID_SENDER, ID_TARGET, meta ,MSG
string
selfId
,
peerId
,
meta
;
bool
bProcessed
=
false
;
...
...
@@ -342,8 +333,6 @@ protected:
void
run
()
{
bool
bStopSig
=
false
;
int
ret
=
0
;
while
(
true
)
{
if
(
checkStop
()
==
true
)
{
bStopSig
=
true
;
...
...
opencv-motion-detect/evmlmotion.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h>
#include <string>
#include <thread>
...
...
@@ -70,13 +63,11 @@ private:
int
iid
;
AVFormatContext
*
pAVFormatInput
=
nullptr
;
AVCodecContext
*
pCodecCtx
=
nullptr
;
AVDictionary
*
pOptsRemux
=
nullptr
;
DetectParam
detPara
=
{
25
,
500
,
-
1
,
10
,
3
,
30
,
0.3
};
EventState
evtState
=
EventState
::
NONE
;
chrono
::
system_clock
::
time_point
evtStartTm
,
evtStartTmLast
;
queue
<
string
>
*
evtQueue
;
int
streamIdx
=
-
1
;
time_t
tsLastBoot
,
tsUpdateTime
;
json
config
;
thread
thEdgeMsgHandler
,
thCloudMsgHandler
;
thread
thEvent
;
...
...
@@ -88,7 +79,6 @@ private:
long
long
packetTsDelta
=
0
;
float
pps
=
0
;
int
pktLag
=
0
;
int
schmittriStatus
=
0
;
//
int
handleCloudMsg
(
vector
<
vector
<
uint8_t
>
>
v
)
...
...
@@ -415,7 +405,6 @@ private:
int
ret
=
0
;
// find video
for
(
int
i
=
0
;
i
<
pAVFormatInput
->
nb_streams
;
i
++
)
{
AVStream
*
out_stream
;
AVStream
*
in_stream
=
pAVFormatInput
->
streams
[
i
];
AVCodecParameters
*
in_codecpar
=
in_stream
->
codecpar
;
if
(
in_codecpar
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
)
{
...
...
@@ -693,8 +682,6 @@ protected:
void
run
()
{
bool
bStopSig
=
false
;
int
ret
=
0
;
int
idx
=
0
;
uint64_t
pktCnt
=
0
;
zmq_msg_t
msg
;
AVPacket
packet
;
...
...
opencv-motion-detect/evpuller.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h>
#include <string>
#include <thread>
...
...
@@ -40,8 +33,7 @@ private:
char
*
pAVFmtCtxBytes
=
nullptr
;
int
lenAVFmtCtxBytes
=
0
;
string
urlIn
,
urlPub
,
urlDealer
,
mgrSn
,
devSn
,
selfId
,
ipcPort
;
int
*
streamList
=
nullptr
,
numStreams
=
0
,
iid
;
time_t
tsLastBoot
,
tsUpdateTime
;
int
numStreams
=
0
,
iid
;
json
config
;
thread
thEdgeMsgHandler
,
thCloudMsgHandler
;
string
proto
=
"rtsp"
;
...
...
opencv-motion-detect/evpusher.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h>
#include <string>
#include <thread>
...
...
@@ -36,11 +29,9 @@ private:
void
*
pSub
=
nullptr
,
*
pDealer
=
nullptr
,
*
pDaemonCtx
=
nullptr
,
*
pDaemon
=
nullptr
;
string
urlOut
,
urlPub
,
urlDealer
,
devSn
,
pullerGid
,
mgrSn
,
selfId
;
int
iid
;
bool
enablePush
=
false
;
int
*
streamList
=
nullptr
;
AVFormatContext
*
pAVFormatRemux
=
nullptr
;
AVFormatContext
*
pAVFormatInput
=
nullptr
;
time_t
tsLastBoot
,
tsUpdateTime
;
json
config
;
thread
thCloudMsgHandler
,
thEdgeMsgHandler
;
string
drport
=
"5549"
;
...
...
@@ -414,12 +405,9 @@ protected:
void
run
()
{
int
ret
=
0
;
bool
bStopSig
=
false
;
zmq_msg_t
msg
;
AVPacket
packet
;
uint64_t
pktCnt
=
0
;
int
pktIgnore
=
0
;
int64_t
lastPts
=
0
;
while
(
true
)
{
ret
=
zmq_msg_init
(
&
msg
);
if
(
ret
!=
0
)
{
...
...
opencv-motion-detect/evslicer.cpp
浏览文件 @
e64ec7c5
...
...
@@ -6,13 +6,6 @@ created: 2019/08/23
update: 2019/09/10
*/
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunused-private-field"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wsign-compare"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#include <stdlib.h>
#include <string>
#include <thread>
...
...
@@ -50,12 +43,10 @@ private:
string
urlOut
,
urlPub
,
urlRouter
,
devSn
,
mgrSn
,
selfId
,
pullerGid
,
ipcSn
;
int
iid
,
hours
,
seconds
,
numSlices
;
long
bootTime
=
0
;
bool
enablePush
=
false
;
AVFormatContext
*
pAVFormatRemux
=
nullptr
;
AVFormatContext
*
pAVFormatInput
=
nullptr
;
AVDictionary
*
pOptsRemux
=
nullptr
;
int
*
streamList
=
nullptr
;
time_t
tsLastBoot
,
tsUpdateTime
;
json
config
;
thread
thEdgeMsgHandler
,
thCloudMsgHandler
,
thSliceMgr
;
string
drport
=
"5549"
;
...
...
@@ -448,7 +439,6 @@ private:
// find all video & audio streams for remuxing
streamList
=
(
int
*
)
av_mallocz_array
(
pAVFormatInput
->
nb_streams
,
sizeof
(
*
streamList
));
for
(
int
i
=
0
;
i
<
pAVFormatInput
->
nb_streams
;
i
++
)
{
AVStream
*
out_stream
;
AVStream
*
in_stream
=
pAVFormatInput
->
streams
[
i
];
AVCodecParameters
*
in_codecpar
=
in_stream
->
codecpar
;
if
(
in_codecpar
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
&&
...
...
@@ -497,9 +487,7 @@ private:
protected
:
void
run
()
{
bool
bStopSig
=
false
;
int
ret
=
0
;
int
idx
=
0
;
int
pktCnt
=
0
;
AVStream
*
out_stream
=
nullptr
;
zmq_msg_t
msg
;
...
...
opencv-motion-detect/inc/av_common.hpp
浏览文件 @
e64ec7c5
...
...
@@ -197,7 +197,6 @@ namespace AVFormatCtxSerializer
int
encode
(
AVFormatContext
*
ctx
,
char
**
bytes
)
{
int
ret
=
0
;
int
wholeSize
=
0
;
int
got
=
0
;
// calc total size
...
...
opencv-motion-detect/inc/avcvhelpers.hpp
浏览文件 @
e64ec7c5
...
...
@@ -95,8 +95,6 @@ float getEntropy(cv::Mat &frame){
/// Set the ranges ( for B,G,R) )
float
range
[]
=
{
0
,
256
}
;
const
float
*
histRange
=
{
range
};
bool
uniform
=
true
;
bool
accumulate
=
false
;
/// Compute the histograms:
cv
::
Mat
hist
;
cv
::
calcHist
(
&
frame
,
1
,
0
,
cv
::
Mat
(),
hist
,
1
,
&
histSize
,
&
histRange
,
true
,
false
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论