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");
}
SrsRtcOutgoingPackets::SrsRtcOutgoingPackets()
SrsRtcOutgoingInfo::SrsRtcOutgoingInfo()
{
#if defined(SRS_DEBUG)
debug_id = 0;
@ -484,7 +484,7 @@ SrsRtcOutgoingPackets::SrsRtcOutgoingPackets()
nn_dropped = 0;
}
SrsRtcOutgoingPackets::~SrsRtcOutgoingPackets()
SrsRtcOutgoingInfo::~SrsRtcOutgoingInfo()
{
}
@ -650,7 +650,7 @@ srs_error_t SrsRtcPlayer::cycle()
// TODO: FIXME: Use cache for performance?
vector<SrsRtpPacket2*> pkts;
SrsRtcOutgoingPackets info;
SrsRtcOutgoingInfo info;
while (true) {
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;
@ -741,7 +741,7 @@ srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, vector<SrsRtpPacke
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;
@ -811,7 +811,7 @@ srs_error_t SrsRtcPlayer::package_video(SrsRtpPacket2* pkt)
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;
@ -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.
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;

View file

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