mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge pull request #1631 from runner365/3.0release.srt.dev
add h264 sei filter configure
This commit is contained in:
commit
82824ba98a
5 changed files with 31 additions and 5 deletions
|
@ -3530,7 +3530,7 @@ srs_error_t SrsConfig::check_normal_config()
|
||||||
&& n != "mss" && n != "latency" && n != "recvlatency"
|
&& n != "mss" && n != "latency" && n != "recvlatency"
|
||||||
&& n != "peerlatency" && n != "tlpkdrop" && n != "connect_timeout"
|
&& n != "peerlatency" && n != "tlpkdrop" && n != "connect_timeout"
|
||||||
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize"
|
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize"
|
||||||
&& n != "default_app" && n != "mix_correct") {
|
&& n != "default_app" && n != "mix_correct" && n != "sei_filter") {
|
||||||
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_stream.%s", n.c_str());
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_stream.%s", n.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6838,6 +6838,20 @@ int SrsConfig::get_srto_peer_latency() {
|
||||||
return atoi(conf->arg0().c_str());
|
return atoi(conf->arg0().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SrsConfig::get_srt_sei_filter() {
|
||||||
|
static bool DEFAULT = true;
|
||||||
|
SrsConfDirective* conf = root->get("srt_server");
|
||||||
|
if (!conf) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf = conf->get("sei_filter");
|
||||||
|
if (!conf || conf->arg0().empty()) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
return SRS_CONF_PERFER_TRUE(conf->arg0());
|
||||||
|
}
|
||||||
|
|
||||||
bool SrsConfig::get_srto_tlpkdrop() {
|
bool SrsConfig::get_srto_tlpkdrop() {
|
||||||
static bool DEFAULT = true;
|
static bool DEFAULT = true;
|
||||||
SrsConfDirective* conf = root->get("srt_server");
|
SrsConfDirective* conf = root->get("srt_server");
|
||||||
|
|
|
@ -613,6 +613,8 @@ public:
|
||||||
virtual int get_srto_recv_latency();
|
virtual int get_srto_recv_latency();
|
||||||
// Get the srt SRTO_PEERLATENCY, peer latency, default is 0..
|
// Get the srt SRTO_PEERLATENCY, peer latency, default is 0..
|
||||||
virtual int get_srto_peer_latency();
|
virtual int get_srto_peer_latency();
|
||||||
|
// Get the srt h264 sei filter, default is on, it will drop h264 sei packet.
|
||||||
|
virtual bool get_srt_sei_filter();
|
||||||
// Get the srt SRTO_TLPKDROP, Too-late Packet Drop, default is true.
|
// Get the srt SRTO_TLPKDROP, Too-late Packet Drop, default is true.
|
||||||
virtual bool get_srto_tlpkdrop();
|
virtual bool get_srto_tlpkdrop();
|
||||||
// Get the srt SRTO_CONNTIMEO, connection timeout, default is 3000ms.
|
// Get the srt SRTO_CONNTIMEO, connection timeout, default is 3000ms.
|
||||||
|
|
|
@ -145,7 +145,8 @@ void srt_handle::add_newconn(SRT_CONN_PTR conn_ptr, int events) {
|
||||||
srs_trace("srto SRTO_RCVBUF=%d", val_i);
|
srs_trace("srto SRTO_RCVBUF=%d", val_i);
|
||||||
srt_getsockopt(conn_ptr->get_conn(), 0, SRTO_MAXBW, &val_i, &opt_len);
|
srt_getsockopt(conn_ptr->get_conn(), 0, SRTO_MAXBW, &val_i, &opt_len);
|
||||||
srs_trace("srto SRTO_MAXBW=%d", val_i);
|
srs_trace("srto SRTO_MAXBW=%d", val_i);
|
||||||
srs_trace("srt mix_correct is %s", _srs_config->get_srt_mix_correct() ? "enable" : "disable");
|
srs_trace("srt mix_correct is %s.", _srs_config->get_srt_mix_correct() ? "enable" : "disable");
|
||||||
|
srs_trace("srt h264 sei filter is %s.", _srs_config->get_srt_sei_filter() ? "enable" : "disable");
|
||||||
|
|
||||||
if (conn_ptr->get_mode() == PULL_SRT_MODE) {
|
if (conn_ptr->get_mode() == PULL_SRT_MODE) {
|
||||||
add_new_puller(conn_ptr, conn_ptr->get_subpath());
|
add_new_puller(conn_ptr, conn_ptr->get_subpath());
|
||||||
|
|
|
@ -460,6 +460,12 @@ srs_error_t rtmp_client::on_ts_video(std::shared_ptr<SrsBuffer> avs_ptr, uint64_
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_srs_config->get_srt_sei_filter()) {
|
||||||
|
if (nal_unit_type == SrsAvcNaluTypeSEI) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// for sps
|
// for sps
|
||||||
if (_avc_ptr->is_sps(frame, frame_size)) {
|
if (_avc_ptr->is_sps(frame, frame_size)) {
|
||||||
std::string sps;
|
std::string sps;
|
||||||
|
@ -624,8 +630,7 @@ void rtmp_client::on_data_callback(SRT_DATA_MSG_PTR data_ptr, unsigned int media
|
||||||
} else if (media_type == STREAM_TYPE_AUDIO_AAC) {
|
} else if (media_type == STREAM_TYPE_AUDIO_AAC) {
|
||||||
on_ts_audio(avs_ptr, dts, pts);
|
on_ts_audio(avs_ptr, dts, pts);
|
||||||
} else {
|
} else {
|
||||||
srs_error("mpegts demux unkown stream type:0x%02x", media_type);
|
srs_error("mpegts demux unkown stream type:0x%02x, only support h264+aac", media_type);
|
||||||
assert(0);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -265,7 +265,11 @@ int ts_demux::decode_unit(unsigned char* data_p, std::string key_path, TS_DATA_C
|
||||||
//callback last media data in data buffer
|
//callback last media data in data buffer
|
||||||
on_callback(callback, _last_pid, key_path, _last_dts, _last_pts);
|
on_callback(callback, _last_pid, key_path, _last_dts, _last_pts);
|
||||||
|
|
||||||
pes_parse(data_p+npos, npos, &ret_data_p, ret_size, dts, pts);
|
int ret = pes_parse(data_p+npos, npos, &ret_data_p, ret_size, dts, pts);
|
||||||
|
assert(ret <= 188);
|
||||||
|
if (ret > 188) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
_last_pts = pts;
|
_last_pts = pts;
|
||||||
_last_dts = (dts == 0) ? pts : dts;
|
_last_dts = (dts == 0) ? pts : dts;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue