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

RTC: Cache the RTP payload objects

This commit is contained in:
winlin 2021-02-26 20:28:05 +08:00
parent 4d0863468a
commit fc4d7080c6
4 changed files with 38 additions and 19 deletions

View file

@ -394,12 +394,6 @@ public:
}
};
// For RTP packets cache.
extern SrsRtpObjectCacheManager<SrsRtpPacket2>* _srs_rtp_cache;
// For RTP packet shared messages cache.
extern SrsRtpObjectCacheManager<SrsSharedPtrMessage>* _srs_rtp_msg_cache;
// Single payload data.
class SrsRtpRawPayload : public ISrsRtpPayloader
{
@ -411,6 +405,8 @@ public:
public:
SrsRtpRawPayload();
virtual ~SrsRtpRawPayload();
public:
bool reset() { return true; }
// interface ISrsRtpPayloader
public:
virtual uint64_t nb_bytes();
@ -509,6 +505,8 @@ public:
public:
SrsRtpFUAPayload2();
virtual ~SrsRtpFUAPayload2();
public:
bool reset() { return true; }
// interface ISrsRtpPayloader
public:
virtual uint64_t nb_bytes();
@ -517,4 +515,12 @@ public:
virtual ISrsRtpPayloader* copy();
};
// For RTP packets cache.
extern SrsRtpObjectCacheManager<SrsRtpPacket2>* _srs_rtp_cache;
extern SrsRtpObjectCacheManager<SrsRtpRawPayload>* _srs_rtp_raw_cache;
extern SrsRtpObjectCacheManager<SrsRtpFUAPayload2>* _srs_rtp_fua_cache;
// For RTP packet shared messages cache.
extern SrsRtpObjectCacheManager<SrsSharedPtrMessage>* _srs_rtp_msg_cache;
#endif