RtpServer返回更多信息

This commit is contained in:
cqm 2024-10-31 16:21:02 +08:00 committed by cqm
parent 9814992a8e
commit e69c0e648c
3 changed files with 16 additions and 1 deletions

View File

@ -1535,7 +1535,11 @@ void installWebApi() {
obj["vhost"] = vec[0]; obj["vhost"] = vec[0];
obj["app"] = vec[1]; obj["app"] = vec[1];
obj["stream_id"] = vec[2]; obj["stream_id"] = vec[2];
obj["port"] = pr.second->getPort(); auto& rtps = pr.second;
obj["port"] = rtps->getPort();
obj["ssrc"] = rtps->getSSRC();
obj["tcp_mode"] = rtps->getTcpMode();
obj["only_track"] = rtps->getOnlyTrack();
val["data"].append(obj); val["data"].append(obj);
} }
}); });

View File

@ -295,5 +295,13 @@ void RtpServer::updateSSRC(uint32_t ssrc) {
} }
} }
uint32_t RtpServer::getSSRC() const {
if (_ssrc)
return *_ssrc;
else if (_tcp_server)
return (*_tcp_server)[RtpSession::kSSRC];
return 0;
}
}//namespace mediakit }//namespace mediakit
#endif//defined(ENABLE_RTPPROXY) #endif//defined(ENABLE_RTPPROXY)

View File

@ -97,6 +97,9 @@ public:
*/ */
void updateSSRC(uint32_t ssrc); void updateSSRC(uint32_t ssrc);
uint32_t getSSRC() const;
int getOnlyTrack() const { return _only_track; }
TcpMode getTcpMode() const { return _tcp_mode; }
private: private:
// tcp主动模式连接服务器成功回调 [AUTO-TRANSLATED:0775844e] // tcp主动模式连接服务器成功回调 [AUTO-TRANSLATED:0775844e]
// tcp active mode connection server success callback // tcp active mode connection server success callback