通过减少线程切换提高服务器性能

This commit is contained in:
xiongziliang
2019-03-21 22:28:12 +08:00
parent 6238f5aa58
commit b78c14a2a3
9 changed files with 33 additions and 65 deletions

View File

@@ -203,7 +203,7 @@ inline void RtmpPusher::send_metaData(){
sendRtmp(pkt->typeId, _ui32StreamId, pkt->strBuf, pkt->timeStamp, pkt->chunkId );
});
_pRtmpReader = src->getRing()->attach();
_pRtmpReader = src->getRing()->attach(getPoller());
weak_ptr<RtmpPusher> weakSelf = dynamic_pointer_cast<RtmpPusher>(shared_from_this());
_pRtmpReader->setReadCB([weakSelf](const RtmpPacket::Ptr &pkt){
auto strongSelf = weakSelf.lock();