From dd56c126c4e2ac2b309e05b47aa9477dee8ed318 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期一, 13 一月 2020 09:44:58 +0800
Subject: [PATCH] debug

---
 run.go |   30 ++++++++----------------------
 1 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/run.go b/run.go
index 06eb86a..023e949 100644
--- a/run.go
+++ b/run.go
@@ -195,9 +195,8 @@
 
 	for _, msg := range msgs {
 		if c, ok := f.channelExist(msg.Cid); ok {
-			f.fnLogger("######push image: ", c.index)
+			f.fnLogger("######recv from :", msg.Cid, " Chan:", c.index)
 			c.msgs.Push(msg)
-			f.fnLogger("######push over image: ", c.index)
 		} else {
 
 			nc := f.channelNew(msg.Cid)
@@ -223,11 +222,8 @@
 }
 
 func (f *face) detectTrackOneChn(c *channel, out chan<- sdkstruct.MsgSDK) {
-	tm := time.Now()
-	sc := 0
 
 	dtchn := c.index
-	f.fnLogger("DETECTTRACKONECHN DTCHN: ", dtchn)
 	var curCid string
 
 	for {
@@ -250,7 +246,7 @@
 
 				if !sdkhelper.ValidRemoteMessage(rMsg, f.typ, f.fnLogger) {
 					sdkhelper.EjectResult(nil, rMsg, out)
-					f.fnLogger("Face!!!!!!SkdMessage Invalid")
+					f.fnLogger("Face!!!!!!SkdMessage Invalid: ", dtchn)
 
 					continue
 				}
@@ -258,7 +254,7 @@
 				i := sdkhelper.UnpackImage(rMsg, f.typ, f.fnLogger)
 				if i == nil || i.Data == nil || i.Width <= 0 || i.Height <= 0 {
 					sdkhelper.EjectResult(nil, rMsg, out)
-					f.fnLogger("Face!!!!!!Unpack Image From SkdMessage Failed")
+					f.fnLogger("Face!!!!!!Unpack Image From SkdMessage Failed: ", dtchn)
 
 					continue
 				}
@@ -268,30 +264,20 @@
 				// conv to bgr24 and resize
 				imgW, imgH := int(i.Width), int(i.Height)
 
+				f.fnLogger("######run cid:", rMsg.Cid, "chan: ", dtchn)
 				count, data, _ := f.handle.Run(i.Data, imgW, imgH, 3, dtchn)
+				f.fnLogger("######over run cid:", rMsg.Cid, "chan: ", dtchn)
 
+				f.fnLogger("######eject cid:", rMsg.Cid, "chan: ", dtchn)
 				sdkhelper.EjectResult(data, rMsg, out)
+				f.fnLogger("######over eject cid:", rMsg.Cid, "chan: ", dtchn)
 
 				var id, name string
 				if rMsg.Tasklab != nil {
 					id, name = rMsg.Tasklab.Taskid, rMsg.Tasklab.Taskname
 				}
-				f.fnLogger("CAMERAID: ", rMsg.Cid, " TASKID: ", id, " TASKNAME: ", name, " DETECT ", f.typ, " COUNT: ", count)
+				f.fnLogger("Chan: ", dtchn, "CAMERAID: ", rMsg.Cid, " TASKID: ", id, " TASKNAME: ", name, " DETECT ", f.typ, " COUNT: ", count)
 			}
-
-			sc++
-			if sc == 25 {
-				f.fnLogger("CHAN:%d, FACE RUN 25 FRAME USE TIME: ", dtchn, time.Since(tm))
-				sc = 0
-				tm = time.Now()
-			}
-
-			if time.Since(tm) > time.Second {
-				f.fnLogger("CHAN: ", dtchn, " FACE RUN ", sc, " FRAME USE TIME: ", time.Since(tm))
-				sc = 0
-				tm = time.Now()
-			}
-
 		}
 	}
 }

--
Gitblit v1.8.0