| | |
| | | ) |
| | | |
| | | // 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 |
| | | func (h *GoFFMPEG) GetInfoRecorder() (int, string) { |
| | | func (h *GoFFMPEG) GetInfoRecorder() (string, int, string) { |
| | | var i C.int = -1 |
| | | var l C.int |
| | | |
| | | p := C.wrap_fn_info_recorder(h.ffmpeg, &i, &l) |
| | | var sid *C.char |
| | | p := C.wrap_fn_info_recorder(h.ffmpeg, &sid, &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 int(i), path |
| | | return goid, int(i), path |
| | | } |
| | | |
| | | // BuildDecoder build decoder |