From 8d1ead663449e6bf508d4d703b6d56381141daeb Mon Sep 17 00:00:00 2001
From: pansen <pansen626@sina.com>
Date: 星期一, 25 二月 2019 15:02:15 +0800
Subject: [PATCH] GPU idx 变更

---
 QiaoJiaSystem/StructureApp/AppPipeController.cpp      |    6 
 QiaoJiaSystem/YoloServer/main.cpp                     |    2 
 QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp  |    3 
 QiaoJiaSystem/DataManagerServer/http_configserver.cpp |  200 ++++++++++++++++++++++---------------------------
 QiaoJiaSystem/FaceDetectServer/main_detect.cpp        |    2 
 QiaoJiaSystem/FaceDetectServer/FaceExtractServerI.cpp |    3 
 QiaoJiaSystem/VideoToImageMulth/main.cpp              |   13 +-
 QiaoJiaSystem/StructureApp/AppPipeController.h        |    4 
 8 files changed, 109 insertions(+), 124 deletions(-)

diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
index 07a20cf..bc9b6f0 100644
--- a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
+++ b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
@@ -22,6 +22,7 @@
 #include <time.h>
 #include <dirent.h>
 #include "basic/pipe_element/ffmpeg/basic_struct_for_video_image.h"
+
 using namespace std;
 
 devHttpServer_c::devHttpServer_c()
@@ -70,7 +71,7 @@
     m_batch = strDevId.substr(5, 2);
     m_SerialNumber = strDevId.substr(7, 2);
 
-    DBG("DevID: "<<strDevId<<" Batch: "<<m_batch <<" SerNum: "<<m_SerialNumber);
+    DBG("DevID: " << strDevId << " Batch: " << m_batch << " SerNum: " << m_SerialNumber);
 
     fdfsClient.rwLock.wrlock();
     fdfsClient.fastFds = new FastFds("WebFDSClient.conf");
@@ -397,7 +398,7 @@
     /*sdk login*/
     ulRet = IMOS_MW_Login(username, passwd, ip, 0, szUserID);
     if (ERR_COMMON_SUCCEED != ulRet) {
-         (VOID) IMOS_MW_Cleanup();
+        (VOID) IMOS_MW_Cleanup();
         printf("Login error ulRet[%lu]", ulRet);
         return false;
     }
@@ -1004,8 +1005,10 @@
     std::string out = value.size() > 0 ? value.toStyledString() : "[]";
     return out;
 }
+
 #define ADD_CAMERA 0
 #define EDIT_CAMERA 1
+
 //缂栬緫鎽勫儚鏈�
 std::string devHttpServer_c::cam_edit(std::string ip, unsigned int port, std::string content, PResponse &response) {
     DBG("ip:" << ip << "; port:" << port);
@@ -1017,7 +1020,7 @@
     Record_Cam_Dev rec;
     Record_Cam_Sdk rec_sdk_old;
     Record_Cam_Sdk rec_sdk;
-    int type=-1;
+    int type = -1;
     int dev_type = db_c.searchDevTypeFromConfigTable();
     if (DEV_STORAGE == dev_type) {
         return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
@@ -1043,45 +1046,34 @@
         rec.str_username = QString::fromStdString(value["str_username"].asString());
         rec.str_password = QString::fromStdString(value["str_password"].asString());
         rec.str_brand = QString::fromStdString(value["str_brand"].asString());
-        type=value["n_type"].asInt();
+        type = value["n_type"].asInt();
 //        rec_sdk_old = db_c.searchCamSdkTableByCamId(rec.str_cam_dev_id);
 
 //        rec_sdk.str_cam_dev_id = rec.str_cam_dev_id;
 //        rec_sdk.str_sdks = QString::fromStdString(value["str_sdks"].asString());
 //        rec_sdk.str_det_thr = QString::fromStdString(value["str_det_thr"].asString());
 //        rec_sdk.str_cmp_thr = QString::fromStdString(value["str_cmp_thr"].asString());
-        bool is_exist=db_c.searchCamDevByCamId(rec.str_cam_dev_id);
-        if(ADD_CAMERA == type )
-        {
-           if(is_exist)
-           {
-               return "{\"ret_status\": \"璇峰嬁閲嶅娣诲姞!\"}";
-           }
-           else
-           {
-               ret =db_c.insertCamDevTable(rec);
-               if (!ret) {
-                   return "err_db_content";
-               }
-           }
-        }
-        else if(EDIT_CAMERA == type )
-        {
-            if(is_exist)
-            {
-                ret = db_c.updateCamDevTable(rec);
+        bool is_exist = db_c.searchCamDevByCamId(rec.str_cam_dev_id);
+        if (ADD_CAMERA == type) {
+            if (is_exist) {
+                return "{\"ret_status\": \"璇峰嬁閲嶅娣诲姞!\"}";
+            } else {
+                ret = db_c.insertCamDevTable(rec);
                 if (!ret) {
                     return "err_db_content";
                 }
             }
-            else
-            {
-                 return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
+        } else if (EDIT_CAMERA == type) {
+            if (is_exist) {
+                ret = db_c.updateCamDevTable(rec);
+                if (!ret) {
+                    return "err_db_content";
+                }
+            } else {
+                return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
             }
-        }
-        else
-        {
-             return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
+        } else {
+            return "{\"ret_status\": \"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
         }
 
 
@@ -1093,7 +1085,7 @@
         db_c.updateConfigTableByDevType(DEV_CAMERA);
         runAllApp();
     }
-    //edit camera's sdks
+        //edit camera's sdks
     else/* if ((rec_sdk_old.str_sdks != rec_sdk.str_sdks) ||
              (rec_sdk_old.str_det_thr != rec_sdk.str_det_thr) ||
              (rec_sdk_old.str_cmp_thr != rec_sdk.str_cmp_thr)) */
@@ -2410,11 +2402,10 @@
 }
 
 
-std::string devHttpServer_c::getAlarmImageByPicDateAndDevId(const std::string& picDate,const std::string& devId,
-                                                        PResponse &response) {
+std::string devHttpServer_c::getAlarmImageByPicDateAndDevId(const std::string &picDate, const std::string &devId,
+                                                            PResponse &response) {
     try {
-        if(!devId.empty() && !picDate.empty())    
-        {   
+        if (!devId.empty() && !picDate.empty()) {
             std::string videoPath;
             qint64 sub;
             std::string path = getVideoPathByPicDate(picDate, devId, sub);
@@ -2524,9 +2515,8 @@
 }
 
 
-
 std::string devHttpServer_c::getAlarmImageFromVideoFile(std::string ip, unsigned int port, std::string content,
-                                                        PResponse &response)  {
+                                                        PResponse &response) {
     INFO("ip:" << ip << "; port:" << port << "content: " << content);
     Json::Reader reader;
     Json::Value value;
@@ -2536,16 +2526,14 @@
             std::string picDate = value["picDate"].asString();
             std::string imgKey = value["imgKey"].asString();
             //鍏煎鏃х増鏈�
-            if(imgKey=="undefined" || imgKey.empty())
-            {
-                return getAlarmImageByPicDateAndDevId(picDate,devId,response);
-            }   
-            else
-            {
-                return getAlarmImageByImageKeyAndDevId(imgKey,devId,response);
-            }    
-        }
-        else{
+            if (imgKey == "undefined" || imgKey.empty()) {
+                DBG("getAlarmImageByPicDateAndDevId " << imgKey);
+                return getAlarmImageByPicDateAndDevId(picDate, devId, response);
+            } else {
+                DBG("getAlarmImageByImageKeyAndDevId " << imgKey);
+                return getAlarmImageByImageKeyAndDevId(imgKey, devId, response);
+            }
+        } else {
             response->write(SimpleWeb::StatusCode::server_error_not_implemented, "{\"error\":\"浼犺緭閿欒锛岃妫�鏌ワ紒\"}");
             ERR("ImageURL:浼犺緭閿欒锛岃妫�鏌�");
             return "";
@@ -2555,21 +2543,20 @@
         std::string message = "{\"error\":\"寮傚父閿欒锛�";
         message.append(const_cast<char *>(ex.what())).append("\"}");
         response->write(SimpleWeb::StatusCode::server_error_not_implemented, message);
-        ERR("ImageURL:寮傚父閿欒   "<<ex.what());
+        ERR("ImageURL:寮傚父閿欒   " << ex.what());
         return "";
     }
 }
 
 
-
-std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string& imgKey,const std::string& devId,
-                                                        PResponse &response)  {
+std::string devHttpServer_c::getAlarmImageByImageKeyAndDevId(const std::string &imgKey, const std::string &devId,
+                                                             PResponse &response) {
     try {
         if (!devId.empty() && !imgKey.empty()) {
             std::string videoPath;
             std::string path = getVideoPathByImgKey(imgKey, devId);
             if (path.empty()) {
-                ERR("Not Find Path: "<<path);
+                ERR("Not Find Path: " << path);
                 return "{\"error\":\"鏈煡鍒拌棰戣矾寰刓"}";
             }
             videoPath.clear();
@@ -2581,17 +2568,17 @@
             //#todo 鎸夌収鏃堕棿鍛藉悕
             std::string str_imgName(AppUtil::getTimeString() + ".jpg");// = "test.jpg";
 
-            auto frameIdDiff = imgSt.m_frameId-videoSt.m_startFrameId;
-            char selectExpBuff[32]={0};
-            std::string strSelectTemplate=R"#( -vf "select=eq(n\,%d)")#";
-            sprintf(selectExpBuff,strSelectTemplate.c_str(),frameIdDiff-1);
-            if(videoSt.Valid() && imgSt.Valid() ) {
-                std::string cmd("ffmpeg -i '" + videoPath+"'"+std::string(selectExpBuff)+" -vframes 1" +" -y '" + str_imgName + "'");
-                INFO("Video To Image Cmd: "<<cmd);
+            auto frameIdDiff = imgSt.m_frameId - videoSt.m_startFrameId;
+            char selectExpBuff[32] = {0};
+            std::string strSelectTemplate = R"#( -vf "select=eq(n\,%d)")#";
+            sprintf(selectExpBuff, strSelectTemplate.c_str(), frameIdDiff - 1);
+            if (videoSt.Valid() && imgSt.Valid()) {
+                std::string cmd("ffmpeg -i '" + videoPath + "'" + std::string(selectExpBuff) + " -vframes 1" + " -y '" +
+                                str_imgName + "'");
+                INFO("Video To Image Cmd: " << cmd);
                 system(cmd.c_str());
-            }
-            else {
-                ERR("Parse Video and Image Failed Path: "<<path <<" ImageId: "<<imgKey);
+            } else {
+                ERR("Parse Video and Image Failed Path: " << path << " ImageId: " << imgKey);
                 return "{\"error\":\"鏈煡鍒拌棰戣矾寰刓"}";
             }
 
@@ -2609,7 +2596,7 @@
                 std::string t_strImg = "";
                 if (!fdfsClient.fastFds->uploadFile(buffer, t_strImg, "jpg")) {
                     img_url = "upload image fail";
-                    ERR("Upload Image Failed "<<str_imgName);
+                    ERR("Upload Image Failed " << str_imgName);
                 } else {
                     std::string str_tmp_cmd("rm -f '" + str_imgName + "'");
                     system(str_tmp_cmd.c_str());
@@ -2620,7 +2607,7 @@
             }
             fdfsClient.rwLock.unlock();
             std::string result("{\"img_url\":\"" + img_url + "\"}");
-            INFO("ImageURL:"<<img_url);
+            INFO("ImageURL:" << img_url);
             return result;
         } else {
             response->write(SimpleWeb::StatusCode::server_error_not_implemented, "{\"error\":\"浼犺緭閿欒锛岃妫�鏌ワ紒\"}");
@@ -2632,7 +2619,7 @@
         std::string message = "{\"error\":\"寮傚父閿欒锛�";
         message.append(const_cast<char *>(ex.what())).append("\"}");
         response->write(SimpleWeb::StatusCode::server_error_not_implemented, message);
-        ERR("ImageURL:寮傚父閿欒   "<<ex.what());
+        ERR("ImageURL:寮傚父閿欒   " << ex.what());
         return "";
     }
 }
@@ -2644,7 +2631,7 @@
     Json::Reader reader;
     Json::Value value;
 
-    INFO("REQ From: "<<ip<<":"<<port<<" Content:"<<content);
+    INFO("REQ From: " << ip << ":" << port << " Content:" << content);
     if (reader.parse(content, value)) {
         std::string devId = value["videoNum"].asString();
         std::string picDate = value["picDate"].asString();
@@ -2652,29 +2639,26 @@
         std::string path;
 
         //鍏煎鏃х増鏈�
-        if(imgKey=="undefined"||imgKey.empty())
-        {
+        if (imgKey == "undefined" || imgKey.empty()) {
             qint64 sub;
-            path = getVideoPathByPicDate(picDate,devId,sub);
-        }
-        else
-        {
-            path = getVideoPathByImgKey(imgKey,devId);
+            path = getVideoPathByPicDate(picDate, devId, sub);
+        } else {
+            path = getVideoPathByImgKey(imgKey, devId);
         }
         //std::string path = getVideoPathByImgKey(imgKey, devId, sub);
-        ERR("VideoNum: "<<devId <<"  PicDate: "<<picDate<<" imgKey: "<<imgKey);
+        ERR("VideoNum: " << devId << "  PicDate: " << picDate << " imgKey: " << imgKey);
         if (path.empty()) {
-            std::string strRsp =  "{\"ret_status\":\"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
-            ERR("RSP:"<< strRsp);
+            std::string strRsp = "{\"ret_status\":\"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
+            ERR("RSP:" << strRsp);
             return strRsp;
         } else {
             std::string result = "{\"file_path\":\"" + path + "\"}";
-            INFO("RSP:"<<result);
+            INFO("RSP:" << result);
             return result;
         }
     } else {
-        std::string strRsp="{\"ret_status\":\"浼犺緭閿欒锛岃妫�鏌ワ紒\"}";
-        ERR("RSP:"<< strRsp);
+        std::string strRsp = "{\"ret_status\":\"浼犺緭閿欒锛岃妫�鏌ワ紒\"}";
+        ERR("RSP:" << strRsp);
         return strRsp;
     }
 }
@@ -2818,14 +2802,13 @@
 }
 
 
-std::string devHttpServer_c::GetVideoNameByImgKey(const std::string& imgKey,const std::string& strPath) {
+std::string devHttpServer_c::GetVideoNameByImgKey(const std::string &imgKey, const std::string &strPath) {
     static std::mutex g_mutex;
     std::lock_guard<std::mutex> lock(g_mutex);
     std::vector<std::string> vec = forEachFileByImgKey(strPath);
     ImageName_s_t imgSt = ImageName_s_t::fromString(imgKey);
-    if(!imgSt.Valid())
-    {
-        ERR("ParseImageName Failed : "<<imgKey);
+    if (!imgSt.Valid()) {
+        ERR("ParseImageName Failed : " << imgKey);
         return "";
     }
     std::vector<VideoName_s_t> videoStVec;
@@ -2842,8 +2825,9 @@
                 } else {
                     ERR("Image " << imgKey << "   Video: " << item << " Not Match");
                 }
-            } else{
-                ERR("ImageID: "<<imgSt.m_frameId <<" VideoRange: "<<videoParseResult.m_startFrameId<<" , "<<videoParseResult.m_endFrameId);
+            } else {
+                ERR("ImageID: " << imgSt.m_frameId << " VideoRange: " << videoParseResult.m_startFrameId << " , "
+                                << videoParseResult.m_endFrameId);
             }
 
         } else {
@@ -2853,35 +2837,32 @@
 
     if (videoStVec.size() >= 1) {
         std::string strVideoName = strPath + videoStVec[0].ToVideoName();
-        INFO("ImageName: "<<imgKey<<"  SingleMatchVideo: "<<strVideoName);
+        INFO("ImageName: " << imgKey << "  SingleMatchVideo: " << strVideoName);
         return strVideoName;
     } else {
-        ERR("ImageName: "<<imgKey<<"  MatchVideoCount: "<<videoStVec.size());
-        for(auto& item:vec)
-        {
-            ERR("VideoName: "<<item);
+        ERR("ImageName: " << imgKey << "  MatchVideoCount: " << videoStVec.size());
+        for (auto &item:vec) {
+            ERR("VideoName: " << item);
         }
         return "";
     }
 }
 
 //鏂扮殑鏍规嵁鍥剧墖鍚嶇О鑾峰彇璺緞鐨勬柟娉�
-std::string devHttpServer_c::getVideoPathByImgKey(const std::string &imgKey, const std::string &camId)
-{
-    INFO("GetVideoFor: "<<imgKey<<" CamID:"<<camId);
-    ImageName_s_t imgSt= ImageName_s_t::fromString(imgKey);
+std::string devHttpServer_c::getVideoPathByImgKey(const std::string &imgKey, const std::string &camId) {
+    INFO("GetVideoFor: " << imgKey << " CamID:" << camId);
+    ImageName_s_t imgSt = ImageName_s_t::fromString(imgKey);
 
     struct tm imgTime = AppUtil::ParseFromHypenTimeStr(imgSt.m_timeStamp);
-    char curFolder[128]={0};
+    char curFolder[128] = {0};
     // 201901/26/2019012614 ---- 201901/26/2019012615 {骞存湀}/{鏃/{骞存湀鏃ユ椂}/
-    sprintf(curFolder,"%04d%02d/%02d/%04d%02d%02d%02d/",imgTime.tm_year+1900,imgTime.tm_mon+1,
-                                  imgTime.tm_mday,
-                                  imgTime.tm_year+1900,imgTime.tm_mon+1,imgTime.tm_mday,imgTime.tm_hour);
+    sprintf(curFolder, "%04d%02d/%02d/%04d%02d%02d%02d/", imgTime.tm_year + 1900, imgTime.tm_mon + 1,
+            imgTime.tm_mday,
+            imgTime.tm_year + 1900, imgTime.tm_mon + 1, imgTime.tm_mday, imgTime.tm_hour);
     std::string t_FilePath = appConfig.getStringProperty("cutPath");
-    std::string videoPath = t_FilePath+"/"+camId+"/"+std::string(curFolder);
-    return GetVideoNameByImgKey(imgKey,videoPath);
+    std::string videoPath = t_FilePath + "/" + camId + "/" + std::string(curFolder);
+    return GetVideoNameByImgKey(imgKey, videoPath);
 }
-
 
 
 qint64 devHttpServer_c::getVideoTime(/*const std::string &videoPath,*/std::string &str_tmpTime) {
@@ -3271,8 +3252,7 @@
         std::string pass = value["str_password"].asString();
         std::string brand = value["str_brand"].asString();
         std::string rtsp_url = rtspAddrBuild(ip, port, username, pass, brand);
-        if (rtsp_url.empty() )
-        {
+        if (rtsp_url.empty()) {
             return "{\"ret_status\":\"鍐呭鏈夎锛岃妫�鏌ワ紒\"}";
         }
 //        unsigned char serialnumber[SERIALNO_LEN] = {0};
@@ -3290,11 +3270,13 @@
         if (str_imgName.back() != '/') {
             str_imgName.push_back('/');
         }
-        str_imgName +=ip;
-        str_imgName +="-";
+        str_imgName += ip;
+        str_imgName += "-";
         str_imgName += "snapshot.jpg";
         //admin:a1234567@192.168.1.201:554/h264/ch1/main/av_stream -r 1/25 -f image2 -s 1920*1080 /home/basic/work_src/a.jpg
-        std::string cmd("ffmpeg -i " + rtsp_url + " -vf select='eq(pict_type\\,I)',setpts='N/(25*TB)' -f image2 -s 1920*1080 -y " + str_imgName);
+        std::string cmd(
+            "ffmpeg -i " + rtsp_url + " -vf select='eq(pict_type\\,I)',setpts='N/(25*TB)' -f image2 -s 1920*1080 -y " +
+            str_imgName);
 //        std::string cmd("ffmpeg -i " + rtsp_url + " -r 1/25  -f image2 -s 1920*1080 -y " + str_imgName);
         DBG(cmd);
         system(cmd.c_str());
@@ -3312,14 +3294,14 @@
             CvUtil::cvMat2Buffer(img, buffer);
             std::string strImgUrlTmp = "";
             fdfsClient.fastFds->uploadFile(buffer, strImgUrlTmp, "jpg");
-          //  strImgUrl.append(fdfsClient.fastFds->getIp() + "/" + strImgUrlTmp);
+            //  strImgUrl.append(fdfsClient.fastFds->getIp() + "/" + strImgUrlTmp);
             strImgUrl.clear();
             strImgUrl = strImgUrlTmp;
         }
         fdfsClient.rwLock.unlock();
         Json::Value result;
         result["imgUrl"] = strImgUrl;
-        db_c.updateCamDevSnapshot(QString::fromStdString(ip),QString::fromStdString(strImgUrl));
+        db_c.updateCamDevSnapshot(QString::fromStdString(ip), QString::fromStdString(strImgUrl));
 
         return result.toStyledString();
 
diff --git a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
index 6380718..b9206a9 100644
--- a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
+++ b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
@@ -90,6 +90,7 @@
         }
         return thftResult;
     } else {
-        throw std::runtime_error("shareMemory attach faild");
+        ERR("shareMemory error  " << shareMemoryName);
+//        throw std::runtime_error("shareMemory attach faild");
     }
 }
diff --git a/QiaoJiaSystem/FaceDetectServer/FaceExtractServerI.cpp b/QiaoJiaSystem/FaceDetectServer/FaceExtractServerI.cpp
index 33d6ec5..0c82dfc 100644
--- a/QiaoJiaSystem/FaceDetectServer/FaceExtractServerI.cpp
+++ b/QiaoJiaSystem/FaceDetectServer/FaceExtractServerI.cpp
@@ -47,7 +47,8 @@
         }
         return feature;
     } else {
-        throw std::runtime_error("shareMemory attach faild");
+        ERR("shareMemory attach faild");
+//        throw std::runtime_error("shareMemory attach faild");
     }
 
 }
diff --git a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
index dabd089..e086792 100644
--- a/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
+++ b/QiaoJiaSystem/FaceDetectServer/main_detect.cpp
@@ -47,7 +47,7 @@
     ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
     auto ich = Ice::initialize(argc, argv);
 
-    appPref.setLongData("gpu.index", 0);
+    appPref.setLongData("gpu.index", 1);
     appPref.setLongData("thread.max", 32);
 
     IceRpcServer<FaceDetectServerI> server("faceServer", 10002, "tcp");
diff --git a/QiaoJiaSystem/StructureApp/AppPipeController.cpp b/QiaoJiaSystem/StructureApp/AppPipeController.cpp
index 7b38b75..710118b 100644
--- a/QiaoJiaSystem/StructureApp/AppPipeController.cpp
+++ b/QiaoJiaSystem/StructureApp/AppPipeController.cpp
@@ -30,7 +30,7 @@
     faceRpcElement(folderPath + "faceRpc", ruleMap[FaceSdk]),
     faceExtractElement(folderPath + "faceExtract", ruleMap[FaceSdk]),
     triggerElement(25, 10),
-    recordVideoElement(-1, ""),
+//    recordVideoElement(-1, ""),
     bRecordVideoEnable(false),
 
     m_bSetWH(false)
@@ -80,8 +80,8 @@
     faceRpcElement(camId + "faceRpc", ruleMap[FaceSdk]),
     faceExtractElement(camId + "faceExtract", ruleMap[FaceSdk]),
     triggerElement(25, 4),
-    recordVideoElement(camId, appPref.getStringData(camId + "rtsp")),
-    newRecordVideoElement(camId),
+//    recordVideoElement(camId, appPref.getStringData(camId + "rtsp")),
+//    newRecordVideoElement(camId),
     perimeterElement(ruleMap[PerimeterSdk]),
     crowdElement(ruleMap[CrowdSdk]),
     perStaticElement(ruleMap[PerStaticSdk]),
diff --git a/QiaoJiaSystem/StructureApp/AppPipeController.h b/QiaoJiaSystem/StructureApp/AppPipeController.h
index e46de35..2018f12 100644
--- a/QiaoJiaSystem/StructureApp/AppPipeController.h
+++ b/QiaoJiaSystem/StructureApp/AppPipeController.h
@@ -109,8 +109,8 @@
     FaceRpcElement faceRpcElement;
     FaceExtractElement faceExtractElement;
     ImageDrawElement imageDrawElement;
-    RecordVideoElement recordVideoElement;
-    NewRecordVideoElement newRecordVideoElement;
+//    RecordVideoElement recordVideoElement;
+//    NewRecordVideoElement newRecordVideoElement;
     PersonElement personElement;
 
     int m_index;
diff --git a/QiaoJiaSystem/VideoToImageMulth/main.cpp b/QiaoJiaSystem/VideoToImageMulth/main.cpp
index b45f104..4eced3d 100644
--- a/QiaoJiaSystem/VideoToImageMulth/main.cpp
+++ b/QiaoJiaSystem/VideoToImageMulth/main.cpp
@@ -24,25 +24,26 @@
 }
 
 
-
 int main(int argc, char **argv) {
-    std::cout<<__DATE__<<" "<<__TIME__<<std::endl;
+    std::cout << __DATE__ << " " << __TIME__ << std::endl;
     SAVE_APP_ARGS
 
 #ifdef GLOG
-        ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
+    ENABLEGLOG(GET_STR_CONFIG("logPath").c_str());
 #endif
 
-    appPref.setLongData("gpu.index", 1);
+    int gindx = atoi(argv[1]) % 2;
+    DBG(gindx);
+    appPref.setLongData("gpu.index", gindx);
     appPref.setIntData("show.image", 0);
 
     //todo
     appPref.setIntData("CamStart", atoi(argv[1]));
     appPref.setIntData("CamStep", atoi(argv[2]));
-    appPref.setIntData("RpcServerPort",atoi(argv[3]));
+    appPref.setIntData("RpcServerPort", atoi(argv[3]));
 
     appPref.setStringData("user.loop.absolute.path", appConfig.getStringProperty("cutPath"));
-    IceRpcServer<RtspAnalysManager> server("RtspAnalysServer",appPref.getIntData("RpcServerPort"), "tcp");
+    IceRpcServer<RtspAnalysManager> server("RtspAnalysServer", appPref.getIntData("RpcServerPort"), "tcp");
     server.setMessageSizeMax(1024 * 1024 * 50);
     server.setPoolInitSize(1);
     server.setPoolMaxSize(1);
diff --git a/QiaoJiaSystem/YoloServer/main.cpp b/QiaoJiaSystem/YoloServer/main.cpp
index 238a50f..bd62a14 100644
--- a/QiaoJiaSystem/YoloServer/main.cpp
+++ b/QiaoJiaSystem/YoloServer/main.cpp
@@ -30,7 +30,7 @@
 //        return -1;
 //    }
 
-    int gpuindex = 0;
+    int gpuindex = 1;
     int poolNum = 1;
     int portNum = 10003;
 

--
Gitblit v1.8.0