video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-26 bfded635a544a1ab5d252739f4be4f7f30b39b7f
csrc/cffmpeg.cpp
@@ -58,12 +58,11 @@
    s->FireRecorder(sid, id);
}
char* c_ffmpeg_get_info_recorder(const cffmpeg h, char **sid, int *index, int *length){
char* c_ffmpeg_get_info_recorder(const cffmpeg h, int *index, int *length){
    Wrapper *s = (Wrapper*)h;
    int i;
    std::string p;
    std::string id;
    s->GetInfoRecorder(id, i, p);
    s->GetInfoRecorder(i, p);
    // printf("cffmpeg get info : index : %d, file : %s\n", i, p.c_str());
@@ -72,14 +71,20 @@
    char *path = (char*)malloc(*length + 1);
    memcpy(path, p.c_str(), *length);
    path[*length] = '\0';
    *sid = (char*)malloc(id.length()+1);
    memcpy(*sid, id.c_str(), id.length());
    *sid[id.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();