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

Perf: Avoid RTP packet copy for publisher NACK.

This commit is contained in:
winlin 2021-02-28 07:27:14 +08:00
parent 74f63d6b14
commit 51a5e283fc
4 changed files with 27 additions and 35 deletions

View file

@ -510,9 +510,6 @@ public:
class SrsRtcRecvTrack
{
protected:
// Whether enabled nack.
bool nack_enabled_;
SrsRtcTrackDescription* track_desc_;
SrsRtcTrackStatistic* statistic_;
@ -527,7 +524,6 @@ public:
SrsRtcRecvTrack(SrsRtcConnection* session, SrsRtcTrackDescription* stream_descs, bool is_audio);
virtual ~SrsRtcRecvTrack();
public:
void set_nack_enabled(bool v);
bool has_ssrc(uint32_t ssrc);
uint32_t get_ssrc();
void update_rtt(int rtt);
@ -537,8 +533,10 @@ public:
bool set_track_status(bool active);
bool get_track_status();
std::string get_track_id();
protected:
srs_error_t on_nack(SrsRtpPacket2* pkt);
public:
// Note that we can set the pkt to NULL to avoid copy, for example, if the NACK cache the pkt and
// set to NULL, nack nerver copy it but set the pkt to NULL.
srs_error_t on_nack(SrsRtpPacket2** ppkt);
public:
virtual srs_error_t on_rtp(SrsRtcStream* source, SrsRtpPacket2* pkt) = 0;
virtual srs_error_t check_send_nacks() = 0;