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

Cache RTP packets

This commit is contained in:
winlin 2020-04-15 22:46:06 +08:00
parent 7b68f55edc
commit 1064429c7e
4 changed files with 94 additions and 53 deletions

View file

@ -171,6 +171,13 @@ void SrsRtpPacket2::set_padding(int size)
padding = size;
}
void SrsRtpPacket2::reset()
{
memset((void*)&rtp_header, 0, sizeof(SrsRtpHeader));
padding = 0;
srs_freep(payload);
}
int SrsRtpPacket2::nb_bytes()
{
return rtp_header.header_size() + (payload? payload->nb_bytes():0) + padding;