video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-11-19 f238d052479dbbe0a8d97e231ff74984bf748903
libcffmpeg.c
@@ -63,6 +63,14 @@
    fn_run(h, input);
}
int wrap_fn_fps(void *lib, const cffmpeg h){
    if(!fn_fps){
        fn_fps = (lib_cffmpeg_fps)dlsym(lib, "c_ffmpeg_get_fps");
        if (!fn_fps) return 25;
    }
    return fn_fps(h);
}
void wrap_fn_run_gb28181(void *lib, const cffmpeg h){
    if (!fn_gb28181){
        fn_gb28181 = (lib_cffmpeg_gb28181)dlsym(lib, "c_ffmpeg_run_gb28181");
@@ -169,7 +177,7 @@
    
    uint8_t *out = NULL;
    const int flag = fn_encode(hdl, (uint8_t*)in, w, h, &out, out_size, key);
    if (flag > 0 && out != NULL) {
    if (flag == 0 && out != NULL) {
        return out;
    }
    *out_size = 0;