video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-26 bfded635a544a1ab5d252739f4be4f7f30b39b7f
apipassive.go
@@ -6,21 +6,24 @@
*/
import "C"
import (
   "fmt"
   "unsafe"
)
// FireRecorder fire recorder
func (h *GoFFMPEG) FireRecorder(id int64) {
   C.wrap_fn_fire_recorder(h.ffmpeg, C.long(id))
func (h *GoFFMPEG) FireRecorder(sid string, id int64) {
   csid := C.CString(sid)
   defer C.free(unsafe.Pointer(csid))
   C.wrap_fn_fire_recorder(h.ffmpeg, csid, C.long(id))
}
// BuildRecorder build recorder
func (h *GoFFMPEG) BuildRecorder(output string, mind, maxd int) {
func (h *GoFFMPEG) BuildRecorder(sid, output string, mind, maxd int) {
   out := C.CString(output)
   defer C.free(unsafe.Pointer(out))
   csid := C.CString(sid)
   defer C.free(unsafe.Pointer(csid))
   C.wrap_fn_recorder(h.ffmpeg, out, C.int(mind), C.int(maxd))
   C.wrap_fn_recorder(h.ffmpeg, csid, out, C.int(mind), C.int(maxd))
}
// GetInfoRecorder info
@@ -35,7 +38,7 @@
   path := C.GoString(p)
   C.free(unsafe.Pointer(p))
   fmt.Println("Go get info : ", path, " len: ", l)
   // fmt.Println("Go get info : ", path, " len: ", l)
   return int(i), path
}