rtsp播放器支持rtcp

This commit is contained in:
xiongziliang
2019-05-09 13:35:54 +08:00
parent 9d92f613e2
commit 304275a0e4
7 changed files with 174 additions and 40 deletions

View File

@@ -116,11 +116,12 @@ bool RtpReceiver::handleOneRtp(int iTrackidx,SdpTrack::Ptr &track, unsigned char
_aui32SeqOkCnt[iTrackidx] = 0;
_abSortStarted[iTrackidx] = true;
// WarnL << "包乱序或丢包:" << iTrackidx <<" " << rtppt.sequence << " " << _aui16LastSeq[iTrackidx];
if(_aui16LastSeq[iTrackidx] > rtppt.sequence && _aui16LastSeq[iTrackidx] - rtppt.sequence > 0x7FFF){
if(_aui16LastSeq[iTrackidx] > rtppt.sequence && _aui16LastSeq[iTrackidx] - rtppt.sequence > 0xFF){
//sequence回环清空所有排序缓存
while (_amapRtpSort[iTrackidx].size()) {
POP_HEAD(iTrackidx)
}
++_clcyeCount[iTrackidx];
}
}else{
//正确序列的包
@@ -157,6 +158,7 @@ void RtpReceiver::clear() {
CLEAR_ARR(_aui32SsrcErrorCnt)
CLEAR_ARR(_aui32SeqOkCnt)
CLEAR_ARR(_abSortStarted)
CLEAR_ARR(_clcyeCount)
_amapRtpSort[0].clear();
_amapRtpSort[1].clear();
@@ -166,4 +168,13 @@ void RtpReceiver::setPoolSize(int size) {
_pktPool.setSize(size);
}
int RtpReceiver::getJitterSize(int iTrackidx){
return _amapRtpSort[iTrackidx].size();
}
int RtpReceiver::getCycleCount(int iTrackidx){
return _clcyeCount[iTrackidx];
}
}//namespace mediakit