From b8c5eb8048b566d632b25391a79ccbd6ce33c010 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期六, 30 三月 2019 16:10:01 +0800
Subject: [PATCH] 1.3 增加nsq消息,解决进程重启

---
 QiaoJiaSystem/DataManagerServer/http_configserver.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/QiaoJiaSystem/DataManagerServer/http_configserver.cpp b/QiaoJiaSystem/DataManagerServer/http_configserver.cpp
index 615ff1b..b53818f 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"
+#include <basic/timer_counter/Clocktimer.h>
 
 #include "vss/controller/VssDevTblController.h"
 #include "vss/controller/VssChannelTblController.h"
@@ -1171,8 +1172,8 @@
         std::string publish_basepath = rtmpAddr + "cam" + str_uuid;
         DBG("publish_basepath:" << publish_basepath);
         appPref.setStringData("publish.basepath", publish_basepath);
-        appPref.setIntData("pulish.width", 640);
-        appPref.setIntData("pulish.height", 360);
+//        appPref.setIntData("pulish.width", 1920);
+//        appPref.setIntData("pulish.height", 1080);
 
         if (m_rtmp.find(ip) != m_rtmp.end()) {
             if (m_rtmp[ip].appPC == nullptr) {
@@ -1224,8 +1225,8 @@
         std::string publish_basepath = rtmpAddr + "cam" + str_uuid;
         DBG("publish_basepath:" << publish_basepath);
         appPref.setStringData("publish.basepath", publish_basepath);
-        appPref.setIntData("pulish.width", 640);
-        appPref.setIntData("pulish.height", 360);
+//        appPref.setIntData("pulish.width", 1920);
+//        appPref.setIntData("pulish.height", 1080);
 
         if (m_rtmp.find(ip) != m_rtmp.end()) {
             if (m_rtmp[ip].appPC == nullptr) {
@@ -2679,6 +2680,7 @@
             std::string strSelectTemplate = R"#( -vf "select=eq(n\,%d)")#";
             sprintf(selectExpBuff, strSelectTemplate.c_str(), frameIdDiff - 1);
             if (videoSt.Valid() && imgSt.Valid()) {
+                ClockTimer clockTimer1("ffmpeg getpic");
                 std::string cmd("ffmpeg -i '" + videoPath + "'" + std::string(selectExpBuff) + " -vframes 1" + " -y '" +
                                 str_imgName + "'");
                 INFO("Video To Image Cmd: " << cmd);
@@ -2688,17 +2690,20 @@
                 return "{\"error\":\"鏈煡鍒拌棰戣矾寰刓"}";
             }
 
+            ClockTimer clockTimer2("cv::imread(str_imgName)");
             cv::Mat img = cv::imread(str_imgName);
             if (img.empty()) {
                 ERR("{\"error\":\"Video File error\"}");
                 return "{\"error\":\"瑙嗛鏂囦欢閿欒\"}";
             }
 
+            ClockTimer clockTimer3("CvUtil::cvMat2Buffer(img, buffer)");
             std::vector<unsigned char> buffer;
             CvUtil::cvMat2Buffer(img, buffer);
             std::string img_url = "http://";
             fdfsClient.rwLock.rdlock();
             if (fdfsClient.fastFds != nullptr) {
+                ClockTimer clockTimer4("fdfsClient.fastFds->uploadFile");
                 std::string t_strImg = "";
                 if (!fdfsClient.fastFds->uploadFile(buffer, t_strImg, "jpg")) {
                     img_url = "upload image fail";

--
Gitblit v1.8.0