优化http/rtsp推流器/rtmp推流器内存占用

This commit is contained in:
xiongziliang
2019-04-23 12:16:14 +08:00
parent ebd2ed2d97
commit 74621618ff
3 changed files with 13 additions and 0 deletions

View File

@@ -130,6 +130,9 @@ void RtmpPusher::onConnect(const SockException &err){
onPublishResult(err);
return;
}
//推流器不需要多大的接收缓存,节省内存占用
_sock->setReadBuffer(std::make_shared<BufferRaw>(1 * 1024));
weak_ptr<RtmpPusher> weakSelf = dynamic_pointer_cast<RtmpPusher>(shared_from_this());
startClientSession([weakSelf](){
auto strongSelf=weakSelf.lock();