提交 039ad9e8 authored 作者: blu's avatar blu

feature: video record

上级 04755383
...@@ -181,9 +181,9 @@ private: ...@@ -181,9 +181,9 @@ private:
else if(metaValue == "debug:record") { else if(metaValue == "debug:record") {
try { try {
json body = json::parse(body2str(v[2])); json body = json::parse(body2str(v[2]));
if(body.count("data") != 0 && body["data"].is_object() && body["data"].count("start") != 0 && body["data"]["start"].is_number() && body["data"].count("end") != 0 && body["data"]["end"].is_number()) { if(body.count("data") != 0 && body["data"].is_object() && body["data"].count("start") != 0 && body["data"]["start"].is_number() && body["data"].count("end") != 0 && body["data"]["end"].is_number() && body["data"].count("type") != 0 && body["data"]["type"].is_string()) {
json evt; json evt;
evt["type"] = "event"; evt["type"] = body["data"]["type"];
evt["start"] = body["data"]["start"]; evt["start"] = body["data"]["start"];
evt["end"] = body["data"]["end"]; evt["end"] = body["data"]["end"];
{ {
...@@ -1022,7 +1022,7 @@ public: ...@@ -1022,7 +1022,7 @@ public:
json jEvt = json::parse(evt); json jEvt = json::parse(evt);
if(jEvt["type"] == "event") { if(jEvt["type"] == "event"|| jEvt["type"] == "record") {
auto tss = jEvt["start"].get<long>(); auto tss = jEvt["start"].get<long>();
auto tse = jEvt["end"].get<long>(); auto tse = jEvt["end"].get<long>();
long offsetS = 0; long offsetS = 0;
...@@ -1070,6 +1070,7 @@ public: ...@@ -1070,6 +1070,7 @@ public:
params["cameraId"] = ipcSn; params["cameraId"] = ipcSn;
params["headOffset"] = to_string(offsetS); params["headOffset"] = to_string(offsetS);
params["tailOffset"] = to_string(offsetE); params["tailOffset"] = to_string(offsetE);
params["type"] = jEvt["type"].get<string>();
json fileNames; json fileNames;
string sf; string sf;
bool hasError = false; bool hasError = false;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论