RTC: Remove sendmmsg

pull/1809/head
winlin 5 years ago
parent 9dfa0cc099
commit 01f05f920f

@ -166,11 +166,6 @@ if [ $SRS_OSX = YES ]; then
else else
srs_undefine_macro "SRS_OSX" $SRS_AUTO_HEADERS_H srs_undefine_macro "SRS_OSX" $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_SENDMMSG = YES ]; then
srs_define_macro "SRS_SENDMMSG" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_SENDMMSG" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_DEBUG = YES ]; then if [ $SRS_DEBUG = YES ]; then
srs_define_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_DEBUG" $SRS_AUTO_HEADERS_H

@ -432,10 +432,6 @@ rtc_server {
# If not, use RSA certificate. # If not, use RSA certificate.
# default: on # default: on
ecdsa on; ecdsa on;
# The max UDP messages send by sendmmsg.
# @remark Always 1 if OS does not support sendmmsg, like OSX.
# default: 256
sendmmsg 256;
# Whether encrypt RTP packet by SRTP. # Whether encrypt RTP packet by SRTP.
# @remark Should always turn it on, or Chrome will fail. # @remark Should always turn it on, or Chrome will fail.
# default: on # default: on

@ -3644,7 +3644,7 @@ srs_error_t SrsConfig::check_normal_config()
for (int i = 0; conf && i < (int)conf->directives.size(); i++) { for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
string n = conf->at(i)->name; string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa" if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa"
&& n != "sendmmsg" && n != "encrypt" && n != "reuseport" && n != "merge_nalus" && n != "encrypt" && n != "reuseport" && n != "merge_nalus"
&& n != "perf_stat" && n != "queue_length" && n != "black_hole" && n != "perf_stat" && n != "queue_length" && n != "black_hole"
&& n != "ip_family") { && n != "ip_family") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str()); return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
@ -4800,28 +4800,6 @@ bool SrsConfig::get_rtc_server_encrypt()
return SRS_CONF_PERFER_TRUE(conf->arg0()); return SRS_CONF_PERFER_TRUE(conf->arg0());
} }
int SrsConfig::get_rtc_server_sendmmsg()
{
#if !defined(SRS_SENDMMSG)
return 1;
#else
static int DEFAULT = 256;
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("sendmmsg");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
int v = ::atoi(conf->arg0().c_str());
return srs_max(1, v);
#endif
}
int SrsConfig::get_rtc_server_reuseport() int SrsConfig::get_rtc_server_reuseport()
{ {
int v = get_rtc_server_reuseport2(); int v = get_rtc_server_reuseport2();

@ -527,7 +527,6 @@ public:
virtual std::string get_rtc_server_candidates(); virtual std::string get_rtc_server_candidates();
virtual std::string get_rtc_server_ip_family(); virtual std::string get_rtc_server_ip_family();
virtual bool get_rtc_server_ecdsa(); virtual bool get_rtc_server_ecdsa();
virtual int get_rtc_server_sendmmsg();
virtual bool get_rtc_server_encrypt(); virtual bool get_rtc_server_encrypt();
virtual int get_rtc_server_reuseport(); virtual int get_rtc_server_reuseport();
virtual bool get_rtc_server_merge_nalus(); virtual bool get_rtc_server_merge_nalus();

@ -1335,7 +1335,7 @@ srs_error_t SrsGoApiPerf::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage*
p->set("target", SrsJsonAny::str(target.c_str())); p->set("target", SrsJsonAny::str(target.c_str()));
p->set("reset", SrsJsonAny::str(reset.c_str())); p->set("reset", SrsJsonAny::str(reset.c_str()));
p->set("help", SrsJsonAny::str("?target=avframes|rtc|rtp|writev_iovs|sendmmsg|bytes")); p->set("help", SrsJsonAny::str("?target=avframes|rtc|rtp|writev_iovs|bytes"));
p->set("help2", SrsJsonAny::str("?reset=all")); p->set("help2", SrsJsonAny::str("?reset=all"));
} }
@ -1371,15 +1371,6 @@ srs_error_t SrsGoApiPerf::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage*
} }
} }
if (target.empty() || target == "sendmmsg") {
SrsJsonObject* p = SrsJsonAny::object();
data->set("sendmmsg", p);
if ((err = stat->dumps_perf_sendmmsg(p)) != srs_success) {
int code = srs_error_code(err); srs_error_reset(err);
return srs_api_response_code(w, r, code);
}
}
if (target.empty() || target == "writev_iovs") { if (target.empty() || target == "writev_iovs") {
SrsJsonObject* p = SrsJsonAny::object(); SrsJsonObject* p = SrsJsonAny::object();
data->set("writev_iovs", p); data->set("writev_iovs", p);

@ -267,7 +267,6 @@ SrsStatistic::SrsStatistic()
perf_iovs = new SrsStatisticCategory(); perf_iovs = new SrsStatisticCategory();
perf_msgs = new SrsStatisticCategory(); perf_msgs = new SrsStatisticCategory();
perf_sendmmsg = new SrsStatisticCategory();
perf_rtp = new SrsStatisticCategory(); perf_rtp = new SrsStatisticCategory();
perf_rtc = new SrsStatisticCategory(); perf_rtc = new SrsStatisticCategory();
perf_bytes = new SrsStatisticCategory(); perf_bytes = new SrsStatisticCategory();
@ -307,7 +306,6 @@ SrsStatistic::~SrsStatistic()
srs_freep(perf_iovs); srs_freep(perf_iovs);
srs_freep(perf_msgs); srs_freep(perf_msgs);
srs_freep(perf_sendmmsg);
srs_freep(perf_rtp); srs_freep(perf_rtp);
srs_freep(perf_rtc); srs_freep(perf_rtc);
srs_freep(perf_bytes); srs_freep(perf_bytes);
@ -631,16 +629,6 @@ srs_error_t SrsStatistic::dumps_perf_writev_iovs(SrsJsonObject* obj)
return dumps_perf(perf_iovs, obj); return dumps_perf(perf_iovs, obj);
} }
void SrsStatistic::perf_on_sendmmsg_packets(int nb_packets)
{
perf_on_packets(perf_sendmmsg, nb_packets);
}
srs_error_t SrsStatistic::dumps_perf_sendmmsg(SrsJsonObject* obj)
{
return dumps_perf(perf_sendmmsg, obj);
}
void SrsStatistic::perf_on_rtc_bytes(int nn_bytes, int nn_rtp_bytes, int nn_padding) void SrsStatistic::perf_on_rtc_bytes(int nn_bytes, int nn_rtp_bytes, int nn_padding)
{ {
// a: AVFrame bytes. // a: AVFrame bytes.
@ -668,14 +656,12 @@ void SrsStatistic::reset_perf()
{ {
srs_freep(perf_iovs); srs_freep(perf_iovs);
srs_freep(perf_msgs); srs_freep(perf_msgs);
srs_freep(perf_sendmmsg);
srs_freep(perf_rtp); srs_freep(perf_rtp);
srs_freep(perf_rtc); srs_freep(perf_rtc);
srs_freep(perf_bytes); srs_freep(perf_bytes);
perf_iovs = new SrsStatisticCategory(); perf_iovs = new SrsStatisticCategory();
perf_msgs = new SrsStatisticCategory(); perf_msgs = new SrsStatisticCategory();
perf_sendmmsg = new SrsStatisticCategory();
perf_rtp = new SrsStatisticCategory(); perf_rtp = new SrsStatisticCategory();
perf_rtc = new SrsStatisticCategory(); perf_rtc = new SrsStatisticCategory();
perf_bytes = new SrsStatisticCategory(); perf_bytes = new SrsStatisticCategory();

@ -170,7 +170,6 @@ private:
// The perf stat for mw(merged write). // The perf stat for mw(merged write).
SrsStatisticCategory* perf_iovs; SrsStatisticCategory* perf_iovs;
SrsStatisticCategory* perf_msgs; SrsStatisticCategory* perf_msgs;
SrsStatisticCategory* perf_sendmmsg;
SrsStatisticCategory* perf_rtp; SrsStatisticCategory* perf_rtp;
SrsStatisticCategory* perf_rtc; SrsStatisticCategory* perf_rtc;
SrsStatisticCategory* perf_bytes; SrsStatisticCategory* perf_bytes;
@ -250,10 +249,6 @@ public:
// Stat for TCP writev, nb_iovs is the total number of iovec. // Stat for TCP writev, nb_iovs is the total number of iovec.
virtual void perf_on_writev_iovs(int nb_iovs); virtual void perf_on_writev_iovs(int nb_iovs);
virtual srs_error_t dumps_perf_writev_iovs(SrsJsonObject* obj); virtual srs_error_t dumps_perf_writev_iovs(SrsJsonObject* obj);
public:
// Stat for packets UDP sendmmsg, nb_packets is the vlen for sendmmsg.
virtual void perf_on_sendmmsg_packets(int nb_packets);
virtual srs_error_t dumps_perf_sendmmsg(SrsJsonObject* obj);
public: public:
// Stat for bytes, nn_bytes is the size of bytes, nb_padding is padding bytes. // Stat for bytes, nn_bytes is the size of bytes, nb_padding is padding bytes.
virtual void perf_on_rtc_bytes(int nn_bytes, int nn_rtp_bytes, int nn_padding); virtual void perf_on_rtc_bytes(int nn_bytes, int nn_rtp_bytes, int nn_padding);

Loading…
Cancel
Save