From f93ee1a42e8c47e472332287b7350b66a6b0fa11 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期五, 24 七月 2020 18:28:57 +0800
Subject: [PATCH] 保存触发id之后的视频作为触发视频

---
 csrc/worker/stream.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/csrc/worker/stream.cpp b/csrc/worker/stream.cpp
index 9fe11da..94e5ac3 100644
--- a/csrc/worker/stream.cpp
+++ b/csrc/worker/stream.cpp
@@ -6,6 +6,8 @@
 
 #include "../ffmpeg/format/FormatIn.hpp"
 #include "../ffmpeg/data/CodedData.hpp"
+#include "../ffmpeg/log/log.hpp"
+using namespace logif;
 
 namespace cffmpeg_wrap{
     stream::stream(ffwrapper::FormatIn *in, const int maxSize)
@@ -19,16 +21,15 @@
         list_pkt_.clear();
     }
 
-    int stream::SetPacket(std::shared_ptr<ffwrapper::CodedData> data, int64_t &id){
-        if (data){
-
+    int stream::SetPacket(const CPacket &pkt){
+        if (pkt.data){
             // 濡傛灉鍖呮槸闊抽鍖�,浣嗘槸涓嶄娇鐢ㄩ煶棰�,鐩存帴杩斿洖
-            if (!audio_ && streamRef_->isAudioPkt(&data->getAVPacket())){
+            if (!audio_ && streamRef_->isAudioPkt(&pkt.data->getAVPacket())){
                 return 0;
             }
             
             std::lock_guard<std::mutex> locker(mutex_avpkt_);
-            list_pkt_.push_back({data, id});
+            list_pkt_.push_back(pkt);
             
             while(list_pkt_.size() > max_size_/2*3){
                 list_pkt_.pop_front();

--
Gitblit v1.8.0