mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
RTC: Rename send_packets api.
This commit is contained in:
parent
9199e40fc1
commit
aaffb8bbd7
2 changed files with 10 additions and 22 deletions
|
@ -646,7 +646,7 @@ srs_error_t SrsRtcPlayer::cycle()
|
||||||
|
|
||||||
// Send-out all RTP packets and do cleanup.
|
// Send-out all RTP packets and do cleanup.
|
||||||
// TODO: FIXME: Handle error.
|
// TODO: FIXME: Handle error.
|
||||||
send_messages(source, pkts, info);
|
send_packets(source, pkts, info);
|
||||||
|
|
||||||
for (int i = 0; i < msg_count; i++) {
|
for (int i = 0; i < msg_count; i++) {
|
||||||
SrsRtpPacket2* pkt = pkts[i];
|
SrsRtpPacket2* pkt = pkts[i];
|
||||||
|
@ -679,7 +679,7 @@ srs_error_t SrsRtcPlayer::cycle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, const vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
|
srs_error_t SrsRtcPlayer::send_packets(SrsRtcSource* source, const vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
@ -689,22 +689,6 @@ srs_error_t SrsRtcPlayer::send_messages(SrsRtcSource* source, const vector<SrsRt
|
||||||
}
|
}
|
||||||
|
|
||||||
// Covert kernel messages to RTP packets.
|
// Covert kernel messages to RTP packets.
|
||||||
if ((err = messages_to_packets(source, pkts, info)) != srs_success) {
|
|
||||||
return srs_error_wrap(err, "messages to packets");
|
|
||||||
}
|
|
||||||
|
|
||||||
// By default, we send packets by sendmmsg.
|
|
||||||
if ((err = send_packets(pkts, info)) != srs_success) {
|
|
||||||
return srs_error_wrap(err, "raw send");
|
|
||||||
}
|
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
srs_error_t SrsRtcPlayer::messages_to_packets(SrsRtcSource* source, const vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
|
|
||||||
{
|
|
||||||
srs_error_t err = srs_success;
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)pkts.size(); i++) {
|
for (int i = 0; i < (int)pkts.size(); i++) {
|
||||||
SrsRtpPacket2* pkt = pkts[i];
|
SrsRtpPacket2* pkt = pkts[i];
|
||||||
|
|
||||||
|
@ -736,10 +720,15 @@ srs_error_t SrsRtcPlayer::messages_to_packets(SrsRtcSource* source, const vector
|
||||||
pkt->header.set_payload_type(video_payload_type);
|
pkt->header.set_payload_type(video_payload_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// By default, we send packets by sendmmsg.
|
||||||
|
if ((err = do_send_packets(pkts, info)) != srs_success) {
|
||||||
|
return srs_error_wrap(err, "raw send");
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsRtcPlayer::send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
|
srs_error_t SrsRtcPlayer::do_send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
|
|
@ -230,9 +230,8 @@ public:
|
||||||
public:
|
public:
|
||||||
virtual srs_error_t cycle();
|
virtual srs_error_t cycle();
|
||||||
private:
|
private:
|
||||||
srs_error_t send_messages(SrsRtcSource* source, const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
srs_error_t send_packets(SrsRtcSource* source, const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||||
srs_error_t messages_to_packets(SrsRtcSource* source, const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
srs_error_t do_send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcOutgoingInfo& info);
|
||||||
srs_error_t send_packets(const 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);
|
||||||
|
|
Loading…
Reference in a new issue