1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

SRT: Use thread-safe log for multiple-threading SRT module. (#2474)

* solve srt push bugs

* solve h264 mutiple nalus in srt when obs is configured in zerolatency

* optimize error code

* optimize error code

* optimize error code

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* add commemnt:we only skip pps/sps frame and send left nalus in srt

* optimize srt log system

* update conf

* update srt hpp

Co-authored-by: shiwei <shiwei05@kuaishou.com>
This commit is contained in:
Alex.CR 2021-07-21 10:15:24 +08:00 committed by winlin
parent 4ca433d3f8
commit 4b7ba0e1e9
12 changed files with 268 additions and 62 deletions

View file

@ -29,6 +29,13 @@ SRT_DATA_MSG::SRT_DATA_MSG(unsigned char* data_p, unsigned int len, const std::s
memcpy(_data_p, data_p, len);
}
SRT_DATA_MSG::SRT_DATA_MSG(LOGGER_LEVEL log_level, const std::string& log_content): _msg_type(SRT_MSG_LOG_TYPE)
,_log_content(log_content)
,_log_level(log_level)
{
}
SRT_DATA_MSG::~SRT_DATA_MSG() {
if (_data_p && (_len > 0)) {
delete[] _data_p;
@ -39,6 +46,10 @@ unsigned int SRT_DATA_MSG::msg_type() {
return _msg_type;
}
void SRT_DATA_MSG::set_msg_type(unsigned int msg_type) {
_msg_type = msg_type;
}
std::string SRT_DATA_MSG::get_path() {
return _key_path;
}
@ -50,3 +61,11 @@ unsigned int SRT_DATA_MSG::data_len() {
unsigned char* SRT_DATA_MSG::get_data() {
return _data_p;
}
LOGGER_LEVEL SRT_DATA_MSG::get_log_level() {
return _log_level;
}
const char* SRT_DATA_MSG::get_log_string() {
return _log_content.c_str();
}