Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
E
evsuits
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
OpsTeam
evsuits
Commits
942115d7
提交
942115d7
authored
9月 23, 2019
作者:
blu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
big refacting of communitation architect
上级
697a290a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
65 行增加
和
2 行删除
+65
-2
.gitmodules
.gitmodules
+3
-0
c_cpp_properties.json
.vscode/c_cpp_properties.json
+2
-0
dirmon.cpp
opencv-motion-detect/dirmon.cpp
+40
-0
dirmon.h
opencv-motion-detect/dirmon.h
+17
-0
fs_test.cpp
opencv-motion-detect/fs_test.cpp
+2
-2
fswatch
opencv-motion-detect/vendor/fswatch
+1
-0
没有找到文件。
.gitmodules
浏览文件 @
942115d7
...
...
@@ -7,3 +7,6 @@
[submodule "opencv-motion-detect/vendor/curl"]
path = opencv-motion-detect/vendor/curl
url = https://github.com/curl/curl
[submodule "opencv-motion-detect/vendor/fswatch"]
path = opencv-motion-detect/vendor/fswatch
url = https://github.com/emcrisostomo/fswatch
.vscode/c_cpp_properties.json
浏览文件 @
942115d7
...
...
@@ -7,6 +7,8 @@
"${workspaceFolder}/opencv-motion-detect/vendor/include/**"
,
"/usr/local/Cellar/opencv/4.1.0_2/include/opencv4"
,
"/usr/local/Cellar/ffmpeg/4.1.4_1/include"
,
"vendor/include"
,
"vendor/include/**"
,
"${workspaceFolder}/opencv-motion-detect/vendor/leveldb/include"
],
"defines"
:
[],
...
...
opencv-motion-detect/dirmon.cpp
0 → 100644
浏览文件 @
942115d7
#include "dirmon.h"
using
namespace
std
;
using
namespace
fsw
;
void
fileEventHandler
(
const
std
::
vector
<
event
>&
evts
,
void
*
pUser
){
for
(
auto
&
i
:
evts
)
{
spdlog
::
info
(
"path: {}, time: {}"
,
i
.
get_path
(),
i
.
get_time
());
}
}
int
CreateDirMon
(
monitor
**
m
,
string
path
,
string
ext
,
vector
<
string
>
&&
events
,
FSW_EVENT_CALLBACK
cb
){
vector
<
string
>
paths
=
{
path
};
vector
<
fsw_event_type_filter
>
event_filters
=
{{
fsw_event_flag
::
Created
}};
*
m
=
monitor_factory
::
create_monitor
(
fsw_monitor_type
::
system_default_monitor_type
,
paths
,
fileEventHandler
);
(
*
m
)
->
start
();
return
0
;
}
int
CloseDirMon
(){
}
#define DEBUG
#ifdef DEBUG
int
main
(){
monitor
*
mon
=
nullptr
;
CreateDirMon
(
&
mon
,
"./slices"
,
".mp4"
,
vector
<
string
>
(),
nullptr
);
}
#endif
\ No newline at end of file
opencv-motion-detect/dirmon.h
0 → 100644
浏览文件 @
942115d7
#ifndef __EV_DIR_MON_H__
#define __EV_DIR_MON_H__
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include "libfswatch/c++/path_utils.hpp"
#include "libfswatch/c++/event.hpp"
#include "libfswatch/c++/monitor.hpp"
#include "libfswatch/c++/monitor_factory.hpp"
#include "libfswatch/c++/libfswatch_exception.hpp"
#include "inc/spdlog/spdlog.h"
#endif
\ No newline at end of file
opencv-motion-detect/fs_test.cpp
浏览文件 @
942115d7
...
...
@@ -48,6 +48,7 @@ vector<long> LoadVideoFiles(string path, int days, int maxSlices, map<long, stri
spdlog
::
warn
(
"LoasdVideoFiles skipped {} (empty/directory/!mp4)"
,
entry
.
path
().
c_str
());
continue
;
}
auto
ftime
=
fs
::
last_write_time
(
entry
.
path
());
auto
ts
=
decltype
(
ftime
)
::
clock
::
to_time_t
(
ftime
);
...
...
@@ -99,7 +100,6 @@ vector<long> LoadVideoFiles(string path, int days, int maxSlices, map<long, stri
int
main
(
int
argc
,
const
char
*
argv
[])
{
std
::
string
path
=
argv
[
1
];
list
<
long
>
tsRing
;
list
<
long
>
tsProcess
;
...
...
@@ -108,7 +108,7 @@ int main(int argc, const char *argv[])
auto
v
=
LoadVideoFiles
(
path
,
2
,
3
,
ts2fileName
,
tsRing
,
tsProcess
);
for
(
auto
&
i
:
v
)
{
spdlog
::
info
(
"tsRing: {}
f
ile: {}"
,
i
,
ts2fileName
[
i
]);
spdlog
::
info
(
"tsRing: {}
F
ile: {}"
,
i
,
ts2fileName
[
i
]);
}
return
0
;
...
...
fswatch
@
18aacf1b
Subproject commit 18aacf1b4a2ed99513692027eac2c32cf9d7df2d
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论