添加性能测试模式

This commit is contained in:
xiongziliang
2020-04-08 11:16:09 +08:00
parent 5025d7d4cc
commit 0fc1499643
7 changed files with 23 additions and 0 deletions

View File

@@ -112,6 +112,11 @@ void RtspPlayer::onConnect(const SockException &err){
}
void RtspPlayer::onRecv(const Buffer::Ptr& pBuf) {
if(_benchmark_mode && !_pPlayTimer){
//在性能测试模式下如果rtsp握手完毕后不再解析rtp包
_rtpTicker.resetTime();
return;
}
input(pBuf->data(),pBuf->size());
}
void RtspPlayer::onErr(const SockException &ex) {
@@ -750,6 +755,8 @@ void RtspPlayer::onPlayResult_l(const SockException &ex , bool handshakeComplete
//开始播放阶段
_pPlayTimer.reset();
onPlayResult(ex);
//是否为性能测试模式
_benchmark_mode = (*this)[Client::kBenchmarkMode].as<int>();
} else if (ex) {
//播放成功后异常断开回调
onShutdown(ex);