video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-26 28253fd3dc1615fee92832baf56b4b2c4e883194
csrc/cffmpeg.cpp
@@ -48,14 +48,14 @@
//////passive api
void c_ffmpeg_build_recorder(const cffmpeg h, const char *dir, int mind, int maxd){
void c_ffmpeg_build_recorder(const cffmpeg h, const char* id, const char *dir, int mind, int maxd){
    Wrapper *s = (Wrapper*)h;
    s->BuildRecorder(dir, mind, maxd);
    s->BuildRecorder(id, dir, mind, maxd);
}
void c_ffmpeg_fire_recorder(const cffmpeg h, const int64_t id){
void c_ffmpeg_fire_recorder(const cffmpeg h, const char* sid, const int64_t id){
    Wrapper *s = (Wrapper*)h;
    s->FireRecorder(id);
    s->FireRecorder(sid, id);
}
char* c_ffmpeg_get_info_recorder(const cffmpeg h, int *index, int *length){
@@ -63,18 +63,28 @@
    int i;
    std::string p;
    s->GetInfoRecorder(i, p);
    if(p.empty()){
        return NULL;
    }
    // printf("cffmpeg get info : index : %d, file : %s\n", i, p.c_str());
    *index = i;
    *length = p.length();
    char *path = (char*)malloc(*length + 1);
    memcpy(path, p.c_str(), *length);
    path[*length] = '\0';
    return path;
}
char* c_ffmpeg_get_rec_id(const cffmpeg h, const char* p, int *length){
    Wrapper *s = (Wrapper*)h;
    std::string id = s->GetRecorderID(p);
    *length = id.length();
    char *i = (char*)malloc(*length+1);
    memcpy(i, id.c_str(), *length);
    i[*length] = '\0';
    return i;
}
void c_ffmpeg_build_decoder(const cffmpeg h){
    Wrapper *s = (Wrapper*)h;
    s->BuildDecoder();