From b155ce2c1df73154a1f559b00ef8fb570230fc77 Mon Sep 17 00:00:00 2001 From: lijun Date: Mon, 20 Jan 2025 18:13:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8v3=E8=8E=B7=E5=8F=96=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/handler/tool.go b/handler/tool.go index 000bc10..52ba04f 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -213,10 +213,9 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { count := 0 //定时器,发送计数器 t_count := 0 - img := gocv.NewMat() for { //从service获取当前帧 - c := service.GetDeviceCurrentFrameV2(&img, device_id) + img, c := service.GetDeviceCurrentFrameV3(device_id) if c != count { if c == -1 { log.Printf("device:%d get frame err!", device_id) @@ -260,11 +259,6 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { time.Sleep(100 * time.Millisecond) t_count++ } - // 关闭img - err := img.Close() - if err != nil { - log.Printf("device:%d img close err:%v", device_id, err) - } // 查看是否还有其他连接,没有则设置 is_play 为 0 if worker.IsContainKey(online_conn_key) == false {