1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refine publisher memory allocate, by packet itself

This commit is contained in:
winlin 2021-02-26 11:18:15 +08:00
parent 81060a17e6
commit 0cb125e53d
3 changed files with 30 additions and 13 deletions

View file

@ -268,6 +268,7 @@ class SrsRtpPacket2
public:
SrsRtpHeader header;
ISrsRtpPayloader* payload;
SrsBuffer* cache_buffer_;
// Helper fields.
public:
// The first byte as nalu type, for video decoder only.
@ -285,6 +286,10 @@ private:
public:
SrsRtpPacket2();
virtual ~SrsRtpPacket2();
public:
// Wrap buffer to shared_message, which is managed by us.
void wrap(char* data, int size);
SrsBuffer* cache_buffer();
public:
// Set the padding of RTP packet.
void set_padding(int size);