| | |
| | | |
| | | std::lock_guard<std::mutex> l(mutex_pkt_); |
| | | if (data->getAVPacket().flags & AV_PKT_FLAG_KEY){ |
| | | logIt("new list cpacket start, next %lld, cur %lld", next_idx_, pkt.id); |
| | | list_pkt_.clear(); |
| | | } |
| | | list_pkt_.push_back(pkt); |
| | |
| | | } |
| | | |
| | | void decoder::GetFrame(unsigned char **data, int *w, int *h, int *format, int *length, int64_t *id){ |
| | | *data = NULL; |
| | | *length = 0; |
| | | |
| | | AVFrame *frame = NULL; |
| | | |
| | |
| | | auto check = list_pkt_.front(); |
| | | if (check.id > next_idx_){ |
| | | next_idx_ = -1; |
| | | logIt("decoder new list cpacket"); |
| | | } |
| | | |
| | | for (auto &i : list_pkt_){ |
| | | if (i.id < next_idx_){ |
| | | continue; |
| | | logIt("decoder same list cpacket"); |
| | | } |
| | | |
| | | *id = i.v_id; |