优化rtp性能

This commit is contained in:
xia-chu
2021-02-05 11:28:50 +08:00
parent b0e1d5d6aa
commit c5cfbce241
13 changed files with 44 additions and 31 deletions

View File

@@ -14,7 +14,7 @@ namespace mediakit{
RtpPacket::Ptr RtpInfo::makeRtp(TrackType type, const void* data, size_t len, bool mark, uint32_t stamp) {
uint16_t payload_len = (uint16_t) (len + RtpPacket::kRtpHeaderSize);
auto rtp = ResourcePoolHelper<RtpPacket>::obtainObj();
auto rtp = RtpPacket::create();
rtp->setCapacity(payload_len + RtpPacket::kRtpTcpHeaderSize);
rtp->setSize(payload_len + RtpPacket::kRtpTcpHeaderSize);
rtp->sample_rate = _sample_rate;