video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2020-01-19 d0b8204e3939e1e2d841a90ea254bc4b91309ab5
libcffmpeg.c
@@ -79,6 +79,17 @@
    fn_gb28181(h);
}
char * wrap_fn_get_gb28181_pic(void *lib, const char *rtspUrl, int *retDataLen){
    if (!fn_get_gb28181_pic){
        fn_get_gb28181_pic = (lib_cffmpeg_get_gb28181_pic)dlsym(lib, "c_ffmpeg_get_gb28181_pic");
        if(!fn_get_gb28181_pic) {
            *retDataLen = 0;
            return NULL;
        }
    }
    return fn_get_gb28181_pic(rtspUrl, retDataLen);
}
void wrap_fn_use_cpu(void *lib, const cffmpeg h){
    if (!fn_cpu){
        fn_cpu = (lib_cffmpeg_cpu)dlsym(lib, "c_ffmepg_use_cpu");
@@ -87,6 +98,14 @@
    fn_cpu(h);
}
void wrap_fn_open_rec(void *lib, const cffmpeg h){
    if (!fn_open_recorder){
        fn_open_recorder = (lib_cffmpeg_open_recorder)dlsym(lib, "c_ffmpeg_open_recorder");
        if (!fn_open_recorder) return;
    }
    fn_open_recorder(h);
}
void wrap_fn_recorder(void *lib, const cffmpeg h, const char* id, const char* dir, const int64_t fid, int mind, int maxd, int audio){
    if (!fn_recorder){
        fn_recorder = (lib_cffmpeg_recorder)dlsym(lib, "c_ffmpeg_build_recorder");