video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-26 28253fd3dc1615fee92832baf56b4b2c4e883194
apipassive.go
@@ -27,22 +27,33 @@
}
// GetInfoRecorder info
func (h *GoFFMPEG) GetInfoRecorder() (string, int, string) {
func (h *GoFFMPEG) GetInfoRecorder() (int, string) {
   var i C.int = -1
   var l C.int
   var sid *C.char
   p := C.wrap_fn_info_recorder(h.ffmpeg, &sid, &i, &l)
   p := C.wrap_fn_info_recorder(h.ffmpeg, &i, &l)
   // if p == nil {
   //    return -1, ""
   // }
   path := C.GoString(p)
   C.free(unsafe.Pointer(p))
   goid := C.GoString(sid)
   C.free(unsafe.Pointer(sid))
   // fmt.Println("Go get info : ", path, " len: ", l)
   return goid, int(i), path
   return int(i), path
}
func (h *GoFFMPEG) GetRecID(p string) string {
   pt := C.CString(p)
   defer C.free(unsafe.Pointer(pt))
   var i C.int
   cid := C.wrap_fn_rec_id(h.ffmpeg, pt, &i)
   id := C.GoString(cid)
   C.free(unsafe.Pointer(cid))
   return id
}
// BuildDecoder build decoder