From ae5899dc884d8d7e1427e45c35e865d7ca51c34b Mon Sep 17 00:00:00 2001
From: miyanhui <dennismi1024@gmail.com>
Date: 星期五, 15 二月 2019 14:56:24 +0800
Subject: [PATCH] 新的方式解决视频不录的问题

---
 QiaoJiaSystem/StructureApp/FaceExtractElement.cpp |   41 +++++++++++++++++++++++++++++++++--------
 1 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
index f81e18b..cc8b003 100644
--- a/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
+++ b/QiaoJiaSystem/StructureApp/FaceExtractElement.cpp
@@ -45,6 +45,11 @@
     }
 }
 
+FaceExtractElement::FaceExtractElement(std::string shareMemoryName, const SdkRule &rule,
+                                       SaveVideoRpcClient_t &rpcClient):FaceExtractElement(shareMemoryName,rule)
+{
+    m_rpcClient=rpcClient;
+}
 FaceExtractElement::~FaceExtractElement() {
     if (sharedMemory) {
         delete sharedMemory;
@@ -134,20 +139,20 @@
 
                 //#鍦ㄥ姣斾腑娣诲姞鐗瑰緛鍊�
                 t_json["FaceFeature"] = "base64";
-                t_json["personId"] = "wait todo";//鍏宠仈搴曞簱浜哄憳id,浜鸿劯id
-                t_json["BaseName"] = "wait todo";//鍏宠仈搴曞簱琛ㄥ悕
+                t_json["personId"] = "";//鍏宠仈搴曞簱浜哄憳id,浜鸿劯id
+                t_json["BaseName"] = "";//鍏宠仈搴曞簱琛ㄥ悕
                 //#end
 //                t_json["likePer"] = faceExtractQueueTmp[i].scoredRects[j].score;//浜哄憳鐩镐技搴� Score
                 t_json["likeDate"] = AppUtil::getTimeSecString();//"2018-01-01 01:01:01";//姣旇緝鏃堕棿
 
-                t_json["picName"] = "wait todo";
+                t_json["picName"] = "";
 
 
-                t_json["personPicUrl"] = "wait todo";//浜哄憳鍥剧墖 store
+                t_json["personPicUrl"] = "";//浜哄憳鍥剧墖 store
                 t_json["picAddress"] = getProperty("str_addr");//鎶撴媿鍦板潃
                   DBG("picAddress="<< t_json["picAddress"] );
-                t_json["picMaxUrl"] = "wait todo";//澶у浘璺緞
-                t_json["picLocalUrl"] = "wait todo";//鏈湴璺緞
+                t_json["picMaxUrl"] = "";//澶у浘璺緞
+                t_json["picLocalUrl"] = "";//鏈湴璺緞
                 t_json["picSmUrl"] = strImgUrl;//浜哄憳鎶撳皬鍥�
                 //#todo
                 t_json["picDate"] = faceExtractQueueTmp[i].scoredRects[j].properties["time"];
@@ -155,8 +160,9 @@
 //                DBG("timeC ::::B" << t_json["picDate"m_bIsMask].asString());
 //                t_json["picDate"] = AppUtil::getTimeSecString();
 
-                t_json["content"] = "wait todo";
-                t_json["viType"] = "1";//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷
+                t_json["content"] = "";
+                //t_json["viType"] = "2";//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷
+                t_json["sdkType"] = std::to_string(m_sdkRule.nSdkType);//鍙湁4绉嶇被鍨� 1:personface 2:personbody 3:car 4:bicycle 5:none 鏈煡绫诲瀷
                 t_json["personIsHub"] = "4";//1: 鎶ヨ  2: 鍙枒  3: 瀹夊叏  4: 鏈煡
 
 
@@ -211,6 +217,25 @@
                 t_json["indeviceid"] = appPref.getStringData("fxDevID");
                 t_json["indevicename"] = appPref.getStringData("fxDevNAME");
 
+                std::string strImageKey = faceExtractQueueTmp[i].scoredRects[j].properties["imgKey"];
+                INFO("SaveImageKey To ES: "<<strImageKey);
+                t_json["imgKey"] = strImageKey;
+
+                try {
+                    auto server = m_rpcClient.getServer();
+                    if (!server)
+                    {
+                        ERR("server is null");
+                        return;
+                    }
+                    INFO("Record Video "<<strImageKey);
+                    server->recordVideo(strImageKey);
+                }
+                catch (std::exception &e)
+                {
+                    ERR("Record Video Err: "<<strImageKey <<"   Message: "<<e.what());
+                    return;
+                }
                 auto faceSearchServer = faceSearchRpcClient.getServer();
                 if (!faceSearchServer) {
                     ERR("faceSearchServer is null");

--
Gitblit v1.8.0