Browse Source

添加来源

leon 1 month ago
parent
commit
ca03331bae
3 changed files with 4 additions and 1 deletions
  1. 2 0
      src/common/meta.hpp
  2. 1 1
      src/nodes/httpPush/httpPush.cpp
  3. 1 0
      src/nodes/stream/streamNode.cpp

+ 2 - 0
src/common/meta.hpp

@@ -3,11 +3,13 @@
 
 #include "common/data.hpp"
 #include <opencv2/opencv.hpp>
+#include <string>
 
 namespace meta
 {
 
 struct MetaData{
+    std::string from;
     cv::Mat image;
     cv::Mat draw_image;
     data::BoxArray boxes;

+ 1 - 1
src/nodes/httpPush/httpPush.cpp

@@ -20,7 +20,7 @@ void HttpPushNode::work()
             // printf("Node %s get data from %s\n", name_.c_str(), input_buffer.first.c_str());
             // do something
             cv::Mat image = metaData->draw_image;
-            std::string image_name = getTimeString() + ".jpg";
+            std::string image_name = metaData->from + "_" + getTimeString() + ".jpg";
             cv::imwrite(image_name, image);
         }
     }

+ 1 - 0
src/nodes/stream/streamNode.cpp

@@ -37,6 +37,7 @@ void StreamNode::work()
 
         auto metaData = std::make_shared<meta::MetaData>();
         metaData->image = frame;
+        metaData->from = name_;
 
         for (auto& output_buffer : output_buffers_)
         {