openRtpServer新增ssrc参数修改为追加至函数末尾, 确保代码逻辑一致无歧义: #1572

This commit is contained in:
ziyue 2022-04-28 17:44:35 +08:00
parent 85399015f9
commit 200a193c04
3 changed files with 5 additions and 4 deletions

View File

@ -1056,8 +1056,8 @@ void installWebApi() {
} }
RtpServer::Ptr server = std::make_shared<RtpServer>(); RtpServer::Ptr server = std::make_shared<RtpServer>();
server->start(allArgs["port"], stream_id, allArgs["ssrc"].as<uint32_t>(), allArgs["enable_tcp"].as<bool>(), server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(), "0.0.0.0",
"0.0.0.0", allArgs["re_use_port"].as<bool>()); allArgs["re_use_port"].as<bool>(), allArgs["ssrc"].as<uint32_t>());
server->setOnDetach([stream_id]() { server->setOnDetach([stream_id]() {
//设置rtp超时移除事件 //设置rtp超时移除事件
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx); lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);

View File

@ -88,7 +88,7 @@ private:
std::shared_ptr<struct sockaddr> _rtcp_addr; std::shared_ptr<struct sockaddr> _rtcp_addr;
}; };
void RtpServer::start(uint16_t local_port, const string &stream_id, uint32_t ssrc, bool enable_tcp, const char *local_ip, bool re_use_port) { void RtpServer::start(uint16_t local_port, const string &stream_id, bool enable_tcp, const char *local_ip, bool re_use_port, uint32_t ssrc) {
//创建udp服务器 //创建udp服务器
Socket::Ptr rtp_socket = Socket::createSocket(nullptr, true); Socket::Ptr rtp_socket = Socket::createSocket(nullptr, true);
Socket::Ptr rtcp_socket = Socket::createSocket(nullptr, true); Socket::Ptr rtcp_socket = Socket::createSocket(nullptr, true);

View File

@ -39,7 +39,8 @@ public:
* @param local_ip ip * @param local_ip ip
* @param re_use_port socket为re_use属性 * @param re_use_port socket为re_use属性
*/ */
void start(uint16_t local_port, const std::string &stream_id = "", uint32_t ssrc = 0, bool enable_tcp = true, const char *local_ip = "0.0.0.0", bool re_use_port = true); void start(uint16_t local_port, const std::string &stream_id = "", bool enable_tcp = true,
const char *local_ip = "0.0.0.0", bool re_use_port = true, uint32_t ssrc = 0);
/** /**
* *