| | |
| | | using namespace ffwrapper; |
| | | using namespace cffmpeg_wrap::buz; |
| | | |
| | | static const int cache_time = 6 * 60; |
| | | static const int cache_time = 3 * 60 + 30; |
| | | |
| | | namespace cffmpeg_wrap |
| | | { |
| | |
| | | |
| | | void rec::SetRecMinCacheTime(const int min){ |
| | | // 由于整个流程耗时,补偿time_offset_ |
| | | int fps = 25; |
| | | if (recRef_){ |
| | | fps = recRef_->getFPS(); |
| | | } |
| | | min_cache_len_ += min * fps; |
| | | // int fps = 25; |
| | | // if (recRef_){ |
| | | // fps = recRef_->getFPS(); |
| | | // } |
| | | // if (min_cache_len_ > (cache_time+min) * fps){ |
| | | // return; |
| | | // } |
| | | // min_cache_len_ += min * fps; |
| | | } |
| | | |
| | | int rec::shrinkCache(){ |
| | | //超过最大缓存,丢弃gop |
| | | |
| | | while (list_pkt_.size() > min_cache_len_) { |
| | | list_pkt_.pop_front(); |
| | | while(!list_pkt_.empty()){ |