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:
parent
7b68f55edc
commit
1064429c7e
4 changed files with 94 additions and 53 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue