From f963cd025c1aa88ac8b211e24f46ceb0eb64c418 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期二, 07 五月 2019 14:19:29 +0800 Subject: [PATCH] 多个解码单元同时运行,注意tcp地址 --- analysis/main.go | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/analysis/main.go b/analysis/main.go index 2da6327..98269d6 100644 --- a/analysis/main.go +++ b/analysis/main.go @@ -10,6 +10,8 @@ var ( streamURL string picFolder string + + asServer bool ) func init() { @@ -18,6 +20,8 @@ flag.StringVar(&ipcURL, "ipc", "ipc:///tmp/pic.ipc", "ipc label") flag.StringVar(&proc, "proc", "", "proc name") + + flag.BoolVar(&asServer, "server", false, "run ipc as server") } const ( @@ -31,9 +35,13 @@ fmt.Println("start test, pic folder: ", picFolder) imageChan := make(chan srv.ImageInfo) - d := srv.NewReciever(ipcURL, imageChan) - go d.RunAsServer() + + if asServer { + go d.RunAsServer() + } else { + go d.RunAsClient() + } demo.ShowYolo(imageChan) -- Gitblit v1.8.0