From a3365259bd9c51db3b5cfcf013ed323f27d1725a Mon Sep 17 00:00:00 2001
From: pansen <pansen626@sina.com>
Date: 星期三, 26 十二月 2018 15:01:51 +0800
Subject: [PATCH] 添加人脸时,裁剪图片

---
 QiaoJiaSystem/StructureApp/NewRecordVideoElement.h |   31 ++++++++++++++++++++++++++-----
 1 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/QiaoJiaSystem/StructureApp/NewRecordVideoElement.h b/QiaoJiaSystem/StructureApp/NewRecordVideoElement.h
index 8da45c7..4d56bc1 100644
--- a/QiaoJiaSystem/StructureApp/NewRecordVideoElement.h
+++ b/QiaoJiaSystem/StructureApp/NewRecordVideoElement.h
@@ -1,13 +1,13 @@
 #ifndef NEWRECORDVIDEOELEMENT_H
 #define NEWRECORDVIDEOELEMENT_H
-
+#include <basic/pipe/PipeElement.h>
 #include <basic/pipe_element/ffmpeg/FfmpegElement.h>
 struct ImgInfo
 {
     std::string time;
     cv::Mat img;
 };
-class NewRecordVideoElement {
+class NewRecordVideoElement : public basic::PipeElement{
 
 public:
 
@@ -17,14 +17,35 @@
     ~NewRecordVideoElement();
 
     std::string startRecord();
-
+    void setSdkTrigger(bool isTrigger);
     void doRecord();
 
     void endRecord();
 
-    void pushImgBuf(const std::string& time,cv::Mat img);
+    void pushImgBuf(const std::string& time,cv::Mat& img);
 
     void getImg(ImgInfo& info);
+private:
+    virtual void threadFunc() override;
+    virtual void threadInitial() override;
+private:
+    void recordInit(int videoMin, int videoMax);
+
+    void Record();
+    int fileMin;
+    int fileMax;
+    bool sdkTrigger;
+    int triggerDelay;
+
+#define RECORD_STOP (0)
+#define RECORD_DOING (1)
+#define RECORD_ENDING (2)
+
+    int recordStatus;
+    int videoLength;
+    int recordDelay;
+
+
 
 private:
     std::string getFileName(std::string timeStamp);
@@ -32,7 +53,7 @@
     ffmpeg::VideoEncodeElement videoEncoderElement;
     std::string camID;
     std::string m_cutPath;
-    std::list<ImgInfo> m_imgBufQue;
+    std::queue<ImgInfo> m_imgBufQue;
 };
 
 #endif // RECORDVIDEOELEMENT_H

--
Gitblit v1.8.0