1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 20:01:56 +00:00

RTC: Refactor, rename SrsRtcOutgoingPackets to SrsRtcOutgoingInfo

This commit is contained in:
winlin 2020-05-14 14:45:54 +08:00
parent 5e2a3572eb
commit e8973c2343
2 changed files with 14 additions and 14 deletions

View file

@ -469,7 +469,7 @@ srs_error_t SrsRtcDtls::unprotect_rtcp(char* out_buf, const char* in_buf, int& n
return srs_error_new(ERROR_RTC_SRTP_UNPROTECT, "rtcp unprotect failed"); return srs_error_new(ERROR_RTC_SRTP_UNPROTECT, "rtcp unprotect failed");
} }
SrsRtcOutgoingPackets::SrsRtcOutgoingPackets() SrsRtcOutgoingInfo::SrsRtcOutgoingInfo()
{ {
#if defined(SRS_DEBUG) #if defined(SRS_DEBUG)
debug_id = 0; debug_id = 0;
@ -484,7 +484,7 @@ SrsRtcOutgoingPackets::SrsRtcOutgoingPackets()
nn_dropped = 0; nn_dropped = 0;
} }
SrsRtcOutgoingPackets::~SrsRtcOutgoingPackets() SrsRtcOutgoingInfo::~SrsRtcOutgoingInfo()
{ {
} }
@ -650,7 +650,7 @@ srs_error_t SrsRtcPlayer::cycle()
// TODO: FIXME: Use cache for performance? // TODO: FIXME: Use cache for performance?
vector<SrsRtpPacket2*> pkts; vector<SrsRtpPacket2*> pkts;
SrsRtcOutgoingPackets info; SrsRtcOutgoingInfo info;
while (true) { while (true) {
if ((err = trd->pull()) != srs_success) { if ((err = trd->pull()) != srs_success) {
@ -707,7 +707,7 @@ srs_error_t SrsRtcPlayer::cycle()
} }
} }
srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info) srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
@ -741,7 +741,7 @@ srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, vector<SrsRtpPacke
return err; return err;
} }
srs_error_t SrsRtcPlayer::messages_to_packets(SrsRtcSource* source, vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info) srs_error_t SrsRtcPlayer::messages_to_packets(SrsRtcSource* source, vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
@ -811,7 +811,7 @@ srs_error_t SrsRtcPlayer::package_video(SrsRtpPacket2* pkt)
return err; return err;
} }
srs_error_t SrsRtcPlayer::send_packets(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info) srs_error_t SrsRtcPlayer::send_packets(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
@ -906,7 +906,7 @@ srs_error_t SrsRtcPlayer::send_packets(std::vector<SrsRtpPacket2*>& pkts, SrsRtc
} }
// TODO: FIXME: We can gather and pad audios, because they have similar size. // TODO: FIXME: We can gather and pad audios, because they have similar size.
srs_error_t SrsRtcPlayer::send_packets_gso(vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info) srs_error_t SrsRtcPlayer::send_packets_gso(vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;

View file

@ -150,7 +150,7 @@ private:
// A group of RTP packets for outgoing(send to players). // A group of RTP packets for outgoing(send to players).
// TODO: FIXME: Rename to stat for RTP packets. // TODO: FIXME: Rename to stat for RTP packets.
class SrsRtcOutgoingPackets class SrsRtcOutgoingInfo
{ {
public: public:
bool use_gso; bool use_gso;
@ -186,8 +186,8 @@ public:
// The number of dropped messages. // The number of dropped messages.
int nn_dropped; int nn_dropped;
public: public:
SrsRtcOutgoingPackets(); SrsRtcOutgoingInfo();
virtual ~SrsRtcOutgoingPackets(); virtual ~SrsRtcOutgoingInfo();
}; };
class SrsRtcPlayer : virtual public ISrsCoroutineHandler, virtual public ISrsReloadHandler class SrsRtcPlayer : virtual public ISrsCoroutineHandler, virtual public ISrsReloadHandler
@ -240,12 +240,12 @@ public:
public: public:
virtual srs_error_t cycle(); virtual srs_error_t cycle();
private: private:
srs_error_t send_messages(SrsRtcSource* source, std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info); srs_error_t send_messages(SrsRtcSource* source, std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
srs_error_t messages_to_packets(SrsRtcSource* source, std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info); srs_error_t messages_to_packets(SrsRtcSource* source, std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
srs_error_t package_opus(SrsRtpPacket2* pkt); srs_error_t package_opus(SrsRtpPacket2* pkt);
srs_error_t package_video(SrsRtpPacket2* pkt); srs_error_t package_video(SrsRtpPacket2* pkt);
srs_error_t send_packets(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info); srs_error_t send_packets(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
srs_error_t send_packets_gso(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingPackets& info); srs_error_t send_packets_gso(std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
public: public:
void nack_fetch(std::vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, uint16_t seq); void nack_fetch(std::vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, uint16_t seq);
void simulate_nack_drop(int nn); void simulate_nack_drop(int nn);