package goffmpeg /* #include #include "libcffmpeg.h" extern void cb_rec_proxy(char*, int); void cb_rec(char* path, int i){ cb_rec_proxy(path, i); } extern void cb_dec_proxy(void *data, int w, int h); void cb_dec(void*data, int w, int h){ cb_dec_proxy(data, w, h); } */ import "C" import ( "unsafe" ) // ActiveRecorder active recorer func (h *GoFFMPEG) ActiveRecorder(output string, mind, maxd int, fn RecorderFunc) { out := C.CString(output) defer C.free(unsafe.Pointer(out)) funcRecorder = fn cFn := (C.rec_func)(unsafe.Pointer(C.cb_rec)) C.wrap_fn_active_recorder(h.ffmpeg, out, C.int(mind), C.int(maxd), cFn) } // ActiveDecoder active decoder func (h *GoFFMPEG) ActiveDecoder(fn DecoderFunc) { funcDecoder = fn cFn := (C.dec_func)(unsafe.Pointer(C.cb_dec)) C.wrap_fn_active_decoder(h.ffmpeg, cFn) }