From 89c923cf2abe98354998f2887bd3f1df8c2b1dbf Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期三, 04 十二月 2019 18:38:02 +0800
Subject: [PATCH] combine interface
---
capture.go | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/capture.go b/capture.go
index a0bcf09..356648e 100644
--- a/capture.go
+++ b/capture.go
@@ -38,8 +38,8 @@
InvalidFileExt PicExt = PicExt("")
)
-// Capture pic
-func CaptureGB28181(soFile string, url string, maxTry int) ([]byte, error) {
+// capture pic
+func captureGB28181(soFile string, url string, maxTry int) ([]byte, error) {
var ret []byte
var err error
@@ -49,7 +49,7 @@
return nil, err
}
- reterr := errors.New(fmt.Sprintf("try %d times to capture image, is url correct?", maxTry))
+ reterr := errors.New(fmt.Sprintf("gb28181 try %d times to capture image, is url correct?", maxTry))
for i := 0; i < maxTry; i++ {
ret = goffmpeg.GetGBJpg(url)
if len(ret) > 0 {
@@ -69,6 +69,10 @@
return nil, errors.New("there is no this mode, try capture.Rtsp/capture.GB28181")
}
+ if m == GB28181 {
+ return captureGB28181(soFile, url, maxTry)
+ }
+
if ext == InvalidFileExt {
ext = JPEGFileExt
}
--
Gitblit v1.8.0