video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-07-26 1518fb1f0e59beedfa32663adb3d0bee302f1ad5
bug fix
4个文件已修改
12 ■■■■■ 已修改文件
apipassive.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/buz/recorder.cpp 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/cffmpeg.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/wrapper.cpp 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
apipassive.go
@@ -26,10 +26,10 @@
    var l C.int
    p := C.wrap_fn_info_recorder(h.ffmpeg, &i, &l)
    if i == -1 {
    if p == nil {
        return -1, ""
    }
    defer C.free(unsafe.Pointer(p))
    C.free(unsafe.Pointer(p))
    return int(i), C.GoString(p)
}
csrc/buz/recorder.cpp
@@ -96,6 +96,9 @@
            //callback to frame index and path
            if(func_rec_info_){
                func_rec_info_(file_frame_index_, file_path_);
                logIt("recoder index %d, file name %s\n", file_frame_index_, file_path_.c_str());
            }else{
                logIt("recorder has no func_rec_info");
            }
        }
@@ -222,7 +225,7 @@
        void Recorder::maybe_dump_gop(){
            //超过min/2,丢弃gop
            while (list_pkt_.size() > minduration) {
            while (list_pkt_.size() > maxduration) {
                list_pkt_.pop_front();
                while(!list_pkt_.empty()){
                    auto &cache = list_pkt_.front();
csrc/cffmpeg.cpp
@@ -63,7 +63,7 @@
    int i;
    std::string p;
    s->GetInfoRecorder(i, p);
    if(i < 0){
    if(p.empty()){
        return NULL;
    }
    *index = i;
csrc/wrapper.cpp
@@ -277,6 +277,7 @@
            info.file_frame_index = index;
            info.file_path = path;
            list_rec_.emplace_back(info);
            logIt("list rec files count : %d", list_rec_.size());
        }
    }