mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-28 21:52:22 +08:00
大幅提升接收推流性能以及降低内存占用
This commit is contained in:
@@ -121,8 +121,6 @@ void RtspPusher::onConnect(const SockException &err) {
|
||||
onPublishResult(err, false);
|
||||
return;
|
||||
}
|
||||
//推流器不需要多大的接收缓存,节省内存占用
|
||||
getSock()->setReadBuffer(std::make_shared<BufferRaw>(1 * 1024));
|
||||
sendAnnounce();
|
||||
}
|
||||
|
||||
@@ -318,7 +316,7 @@ inline void RtspPusher::sendRtpPacket(const RtspMediaSource::RingDataType &pkt)
|
||||
setSendFlushFlag(true);
|
||||
}
|
||||
BufferRtp::Ptr buffer(new BufferRtp(rtp));
|
||||
send(buffer);
|
||||
send(std::move(buffer));
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -335,7 +333,7 @@ inline void RtspPusher::sendRtpPacket(const RtspMediaSource::RingDataType &pkt)
|
||||
}
|
||||
|
||||
BufferRtp::Ptr buffer(new BufferRtp(rtp, 4));
|
||||
pSock->send(buffer, nullptr, 0, ++i == size);
|
||||
pSock->send(std::move(buffer), nullptr, 0, ++i == size);
|
||||
});
|
||||
break;
|
||||
}
|
||||
@@ -475,7 +473,7 @@ void RtspPusher::sendRtspRequest(const string &cmd, const string &url,const StrC
|
||||
if (!sdp.empty()) {
|
||||
printer << sdp;
|
||||
}
|
||||
SockSender::send(printer);
|
||||
SockSender::send(std::move(printer));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user