| | |
| | | |
| | | import "unsafe" |
| | | |
| | | // OpenRecorder rec func open |
| | | func (h *GoFFMPEG) OpenRecorder() { |
| | | C.wrap_fn_open_rec(unsafe.Pointer(libcffmpeg), h.ffmpeg) |
| | | } |
| | | |
| | | // FireRecorder fire recorder |
| | | func (h *GoFFMPEG) FireRecorder(sid string, id int64) { |
| | | func (h *GoFFMPEG) FireRecorder(sid string, id int64) int { |
| | | csid := C.CString(sid) |
| | | defer C.free(unsafe.Pointer(csid)) |
| | | C.wrap_fn_fire_recorder(h.ffmpeg, csid, C.long(id)) |
| | | ret := C.wrap_fn_fire_recorder(unsafe.Pointer(libcffmpeg), h.ffmpeg, csid, C.long(id)) |
| | | return int(ret) |
| | | } |
| | | |
| | | // BuildRecorder build recorder |
| | | func (h *GoFFMPEG) BuildRecorder(sid, output string, mind, maxd int, audio bool) { |
| | | func (h *GoFFMPEG) BuildRecorder(sid, output string, id int64, mind, maxd int, audio bool) { |
| | | out := C.CString(output) |
| | | defer C.free(unsafe.Pointer(out)) |
| | | csid := C.CString(sid) |
| | |
| | | if audio { |
| | | a = 1 |
| | | } |
| | | C.wrap_fn_recorder(h.ffmpeg, csid, out, C.int(mind), C.int(maxd), C.int(a)) |
| | | C.wrap_fn_recorder(unsafe.Pointer(libcffmpeg), h.ffmpeg, csid, out, C.long(id), C.int(mind), C.int(maxd), C.int(a)) |
| | | } |
| | | |
| | | // GetInfoRecorder info |
| | |
| | | var p *C.char |
| | | var pl C.int |
| | | |
| | | C.wrap_fn_info_recorder(h.ffmpeg, &i, &id, &idl, &p, &pl) |
| | | C.wrap_fn_info_recorder(unsafe.Pointer(libcffmpeg), h.ffmpeg, &i, &id, &idl, &p, &pl) |
| | | // if p == nil { |
| | | // return -1, "" |
| | | // } |