video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2020-09-17 48a70bb5b8b4d2daf24462d94fcc1bc3e3f85858
libcffmpeg.h
@@ -28,6 +28,8 @@
typedef void (*lib_cffmpeg_close_stream)(const cffmpeg);
typedef void*(*lib_cffmpeg_avpacket)(const cffmpeg, int*, int*);
typedef int (*lib_cffmpeg_avpacket2)(const cffmpeg, unsigned char**, int*, int*);
typedef int (*lib_cffmpeg_devid)(const cffmpeg, const int devid);
typedef void(*lib_cffmpeg_release_buf) (void*);
static lib_cffmpeg_create              fn_create = NULL;
static lib_cffmpeg_create2             fn_create2 = NULL;
@@ -46,7 +48,9 @@
static lib_cffmpeg_pic                 fn_decoder_pic = NULL;
static lib_cffmpeg_close_stream        fn_close_stream = NULL;
static lib_cffmpeg_avpacket            fn_get_avpacket = NULL;
static lib_cffmpeg_avpacket2            fn_get_avpacket2 = NULL;
static lib_cffmpeg_avpacket2           fn_get_avpacket2 = NULL;
static lib_cffmpeg_devid               fn_set_devid = NULL;
static lib_cffmpeg_release_buf         fn_release_buf = NULL;
typedef void* libcffmpeg;
libcffmpeg init_libcffmpeg(const char *so_file);
@@ -70,6 +74,9 @@
void wrap_fn_close_stream(void *lib, const cffmpeg h);
void* wrap_fn_get_avpacket(void *lib, const cffmpeg h, int* size, int* key);
int wrap_fn_get_avpacket2(void *lib, const cffmpeg h, unsigned char **data, int* size, int* key);
int wrap_fn_set_devid(void *lib, const cffmpeg h, const int devid);
void wrap_fn_release_buf(void *lib, void *buf);
// for encoder
typedef void* cencoder;
typedef cencoder (*lib_cffmpeg_create_encoder)(const int w, const int h, const int fps, const int br, const int pix_fmt, const int scale_flag, const int gi);