| | |
| | | ,gb_(0) |
| | | ,cpu_(0) |
| | | ,run_dec_(false) |
| | | ,run_stream_(true) |
| | | ,thread_(nullptr) |
| | | ,stop_stream_(false) |
| | | ,stream_(nullptr) |
| | |
| | | ,gb_(0) |
| | | ,cpu_(0) |
| | | ,run_dec_(false) |
| | | ,run_stream_(true) |
| | | ,thread_(nullptr) |
| | | ,stop_stream_(false) |
| | | ,stream_(nullptr) |
| | |
| | | |
| | | stream_ = new stream(in, 3 * in->getFPS()); |
| | | // stream_->AudioSwitch(audio_); |
| | | |
| | | |
| | | decoder_ = new decoder(in); |
| | | |
| | | rec_->Load(in); |
| | |
| | | p.pts = p.dts = AV_NOPTS_VALUE; |
| | | } |
| | | int flag = 0; |
| | | if (stream_) stream_->SetPacket(pkt); |
| | | if (decoder_ && run_dec_) flag = decoder_->SetFrame(pkt); |
| | | if (run_stream_ && stream_) stream_->SetPacket(pkt); |
| | | if (run_dec_ && decoder_) flag = decoder_->SetFrame(pkt); |
| | | if (rec_->Loaded()) rec_->SetPacket(pkt); |
| | | |
| | | return flag; |
| | |
| | | [=]{rec_->NewRec(rid.c_str(), dir.c_str(), fid, mindur, maxdur, a);}; |
| | | } |
| | | } |
| | | |
| | | int Wrapper::FireRecorder(const char* sid,const int64_t &id){ |
| | | if (rec_->Loaded()){ |
| | | rec_->FireRecSignal(sid, id); |
| | |
| | | } |
| | | } |
| | | |
| | | void Wrapper::CloseStream(){ |
| | | run_stream_ = false; |
| | | } |
| | | |
| | | void Wrapper::GetPacket(unsigned char **pktData, int *size, int *key){ |
| | | if (stream_){ |
| | | stream_->GetPacket(pktData, size, key); |