video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-12-03 783b80757681c1cc08eeb7aac55f446244d7bc46
csrc/wrapper.cpp
@@ -47,6 +47,7 @@
    ,cpu_(0)
    ,run_dec_(false)
    ,run_stream_(true)
    ,run_rec_(false)
    ,thread_(nullptr)
    ,stop_stream_(false)
    ,stream_(nullptr)
@@ -65,6 +66,7 @@
    ,cpu_(0)
    ,run_dec_(false)
    ,run_stream_(true)
    ,run_rec_(false)
    ,thread_(nullptr)
    ,stop_stream_(false)
    ,stream_(nullptr)
@@ -170,7 +172,7 @@
        int flag = 0;
        if (run_stream_ && stream_) stream_->SetPacket(pkt);
        if (run_dec_ && decoder_) flag = decoder_->SetFrame(pkt);
        if (rec_->Loaded()) rec_->SetPacket(pkt);
        if (run_rec_ && rec_->Loaded()) rec_->SetPacket(pkt);
        return flag;
    }
@@ -251,6 +253,10 @@
        rec_->SetRecMinCacheTime(mind);
    }
    void Wrapper::OpenRecorder(){
        run_rec_ = true;
    }
    void Wrapper::BuildRecorder(const char* id, const char *output, const int64_t &fid, const int mindur, const int maxdur, const bool audio){
        bool a = audio;
        if (gb_) a = false;
@@ -275,7 +281,7 @@
        }
    }
    ////////decoder
    void Wrapper::BuildDecoder(){
    void Wrapper::OpenDecoder(){
        run_dec_ = true;
    }