Commit 200a193c by ziyue

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

parent 85399015
......@@ -1056,8 +1056,8 @@ void installWebApi() {
}
RtpServer::Ptr server = std::make_shared<RtpServer>();
server->start(allArgs["port"], stream_id, allArgs["ssrc"].as<uint32_t>(), allArgs["enable_tcp"].as<bool>(),
"0.0.0.0", allArgs["re_use_port"].as<bool>());
server->start(allArgs["port"], stream_id, allArgs["enable_tcp"].as<bool>(), "0.0.0.0",
allArgs["re_use_port"].as<bool>(), allArgs["ssrc"].as<uint32_t>());
server->setOnDetach([stream_id]() {
//设置rtp超时移除事件
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
......
......@@ -88,7 +88,7 @@ private:
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服务器
Socket::Ptr rtp_socket = Socket::createSocket(nullptr, true);
Socket::Ptr rtcp_socket = Socket::createSocket(nullptr, true);
......
......@@ -39,7 +39,8 @@ public:
* @param local_ip 绑定的本地网卡ip
* @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);
/**
* 获取绑定的本地端口
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论