video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-09-20 be9c1d1f659b0ff31f656424c478e83a4f7c53b5
csrc/worker/rec.cpp
@@ -40,7 +40,7 @@
        list_recInfo_.emplace_back(info);
    }
    std::unique_ptr<buz::Recorder> rec::startRec(std::string id, std::string dir, const int mind, const int maxd){
    std::unique_ptr<buz::Recorder> rec::startRec(std::string id, std::string dir, const int mind, const int maxd, const bool audio){
        if(!recRef_){
            logIt("Init wrapper first");
            return nullptr;
@@ -54,7 +54,7 @@
        int trycnt = 0;
        while(trycnt < 100){
            auto ret = rec->Run(dir.c_str(), mind, maxd);
            auto ret = rec->Run(dir.c_str(), mind, maxd, audio);
            if(ret == 0) break;
            usleep(200000);
        }
@@ -133,7 +133,7 @@
        return recRef_ != NULL;
    }
    
    void rec::NewRec(const char* id, const char *output, const int mindur, const int maxdur){
    void rec::NewRec(const char* id, const char *output, const int mindur, const int maxdur, const bool audio){
        std::string rid(id);
        std::string dir(output);
        
@@ -145,7 +145,7 @@
            if (map_rec_.find(rid) != map_rec_.end()){
                map_rec_.erase(rid);
            }
            map_rec_[rid] = startRec(rid, dir, mindur, maxdur);
            map_rec_[rid] = startRec(rid, dir, mindur, maxdur, audio);
        }
        
    }