From 6f9d46539bce25828e3229db6cd9c0dbae1f3e11 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期日, 19 一月 2020 11:43:34 +0800
Subject: [PATCH] update ffmpeg

---
 goffmpeg.go |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/goffmpeg.go b/goffmpeg.go
index 252e7a1..1844a22 100644
--- a/goffmpeg.go
+++ b/goffmpeg.go
@@ -12,6 +12,39 @@
 	"unsafe"
 )
 
+const (
+	// ScaleNone self add no scale raw frame data
+	ScaleNone = 0
+	// ScaleFastBilinear SWS_FAST_BILINEAR
+	ScaleFastBilinear = 1
+	// ScaleBilinear SWS_BILINEAR
+	ScaleBilinear = 2
+	// ScaleBicubic SWS_BICUBIC
+	ScaleBicubic = 4
+	// ScaleX SWS_X
+	ScaleX = 8
+	// ScalePoint SWS_POINT
+	ScalePoint = 0x10
+	// ScaleArea SWS_AREA
+	ScaleArea = 0x20
+	// ScaleBicublin SWS_BICUBLIN
+	ScaleBicublin = 0x40
+	// ScaleGauss SWS_GAUSS
+	ScaleGauss = 0x80
+	// ScaleSinc SWS_SINC
+	ScaleSinc = 0x100
+	// ScaleLancZos SWS_LANCZOS
+	ScaleLancZos = 0x200
+	// ScaleSpline SWS_SPLINE
+	ScaleSpline = 0x400
+)
+
+// SrcFormat format NV
+const SrcFormat = 23
+
+// DstFormat format
+const DstFormat = 3
+
 var libcffmpeg C.libcffmpeg
 
 // InitFFmpeg init ffmepg
@@ -107,3 +140,16 @@
 	}
 	C.free(unsafe.Pointer(p))
 }
+
+// GetGBJpg Get GB28181 Jpg
+func GetGBJpg(rtspUrl string) []byte {
+    rtsp := C.CString(rtspUrl)
+    defer C.free(unsafe.Pointer(rtsp))
+    var jpgLen C.int
+
+    pic := C.wrap_fn_get_gb28181_pic(unsafe.Pointer(libcffmpeg), rtsp, &jpgLen)
+    defer C.free(unsafe.Pointer(pic))
+
+    retJpg := C.GoBytes(unsafe.Pointer(pic), jpgLen)
+    return retJpg
+}
\ No newline at end of file

--
Gitblit v1.8.0