candidate foundation改为string类型

This commit is contained in:
ziyue 2021-03-29 12:28:47 +08:00
parent ba06def4d8
commit 9d2498a694
4 changed files with 16 additions and 12 deletions

View File

@ -140,14 +140,14 @@ maxReqSize=4096
#404网页内容用户可以自定义404网页 #404网页内容用户可以自定义404网页
notFound=<html><head><title>404 Not Found</title></head><body bgcolor="white"><center><h1>您访问的资源不存在!</h1></center><hr><center>ZLMediaKit-4.0</center></body></html> notFound=<html><head><title>404 Not Found</title></head><body bgcolor="white"><center><h1>您访问的资源不存在!</h1></center><hr><center>ZLMediaKit-4.0</center></body></html>
#http服务器监听端口 #http服务器监听端口
port=80 port=0
#http文件服务器根目录 #http文件服务器根目录
#可以为相对(相对于本可执行程序目录)或绝对路径 #可以为相对(相对于本可执行程序目录)或绝对路径
rootPath=./www rootPath=./www
#http文件服务器读文件缓存大小单位BYTE调整该参数可以优化文件io性能 #http文件服务器读文件缓存大小单位BYTE调整该参数可以优化文件io性能
sendBufSize=65536 sendBufSize=65536
#https服务器监听端口 #https服务器监听端口
sslport=443 sslport=20443
#是否显示文件夹菜单,开启后可以浏览文件夹 #是否显示文件夹菜单,开启后可以浏览文件夹
dirMenu=1 dirMenu=1
@ -187,9 +187,9 @@ keepAliveSecond=15
#在接收rtmp推流时是否重新生成时间戳(很多推流器的时间戳着实很烂) #在接收rtmp推流时是否重新生成时间戳(很多推流器的时间戳着实很烂)
modifyStamp=0 modifyStamp=0
#rtmp服务器监听端口 #rtmp服务器监听端口
port=1935 port=8935
#rtmps服务器监听地址 #rtmps服务器监听地址
sslport=19350 sslport=0
[rtp] [rtp]
#音频mtu大小该参数限制rtp最大字节数推荐不要超过1400 #音频mtu大小该参数限制rtp最大字节数推荐不要超过1400
@ -202,7 +202,7 @@ videoMtuSize=1400
#导出调试数据(包括rtp/ps/h264)至该目录,置空则关闭数据导出 #导出调试数据(包括rtp/ps/h264)至该目录,置空则关闭数据导出
dumpDir= dumpDir=
#udp和tcp代理服务器支持rtp(必须是ts或ps类型)代理 #udp和tcp代理服务器支持rtp(必须是ts或ps类型)代理
port=10000 port=0
#rtp超时时间单位秒 #rtp超时时间单位秒
timeoutSec=15 timeoutSec=15
@ -221,13 +221,13 @@ handshakeSecond=15
#或者tcp发送缓存超过这个时间则会断开连接单位秒 #或者tcp发送缓存超过这个时间则会断开连接单位秒
keepAliveSecond=15 keepAliveSecond=15
#rtsp服务器监听地址 #rtsp服务器监听地址
port=554 port=8554
#rtsps服务器监听地址 #rtsps服务器监听地址
sslport=322 sslport=0
[shell] [shell]
#调试telnet服务器接受最大bufffer大小 #调试telnet服务器接受最大bufffer大小
maxReqSize=1024 maxReqSize=1024
#调试telnet服务器监听端口 #调试telnet服务器监听端口
port=9000 port=0

View File

@ -209,6 +209,7 @@ static void inline listen_shell_input(){
//全局变量在WebApi中用于保存配置文件用 //全局变量在WebApi中用于保存配置文件用
string g_ini_file; string g_ini_file;
extern void test_sdp();
int start_main(int argc,char *argv[]) { int start_main(int argc,char *argv[]) {
{ {
CMD_main cmd_main; CMD_main cmd_main;
@ -266,6 +267,7 @@ int start_main(int argc,char *argv[]) {
}); });
} }
test_sdp();
uint16_t shellPort = mINI::Instance()[Shell::kPort]; uint16_t shellPort = mINI::Instance()[Shell::kPort];
uint16_t rtspPort = mINI::Instance()[Rtsp::kPort]; uint16_t rtspPort = mINI::Instance()[Rtsp::kPort];
uint16_t rtspsPort = mINI::Instance()[Rtsp::kSSLPort]; uint16_t rtspsPort = mINI::Instance()[Rtsp::kSSLPort];

View File

@ -689,14 +689,16 @@ string SdpAttrSctpMap::toString() const {
} }
void SdpAttrCandidate::parse(const string &str) { void SdpAttrCandidate::parse(const string &str) {
char foundation_buf[32] = {0};
char transport_buf[16] = {0}; char transport_buf[16] = {0};
char address_buf[32] = {0}; char address_buf[32] = {0};
char type_buf[16] = {0}; char type_buf[16] = {0};
if (7 != sscanf(str.data(), "%" SCNu32 " %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]", if (7 != sscanf(str.data(), "%31[^ ] %" SCNu32 " %15[^ ] %" SCNu32 " %31[^ ] %" SCNu16 " typ %15[^ ]",
&foundation, &component, transport_buf, &priority, address_buf, &port, type_buf)) { foundation_buf, &component, transport_buf, &priority, address_buf, &port, type_buf)) {
SDP_THROW(); SDP_THROW();
} }
foundation = foundation_buf;
transport = transport_buf; transport = transport_buf;
address = address_buf; address = address_buf;
type = type_buf; type = type_buf;
@ -720,7 +722,7 @@ void SdpAttrCandidate::parse(const string &str) {
string SdpAttrCandidate::toString() const { string SdpAttrCandidate::toString() const {
if (value.empty()) { if (value.empty()) {
value = to_string(foundation) + " " + to_string(component) + " " + transport + " " + to_string(priority) + value = foundation + " " + to_string(component) + " " + transport + " " + to_string(priority) +
" " + address + " " + to_string(port) + " typ " + type; " " + address + " " + to_string(port) + " typ " + type;
for (auto &pr : arr) { for (auto &pr : arr) {
value += ' '; value += ' ';

View File

@ -407,7 +407,7 @@ public:
//15.1. "candidate" Attribute //15.1. "candidate" Attribute
//a=candidate:4 1 udp 2 192.168.1.7 58107 typ host //a=candidate:4 1 udp 2 192.168.1.7 58107 typ host
//a=candidate:<foundation> <component-id> <transport> <priority> <address> <port> typ <cand-type> //a=candidate:<foundation> <component-id> <transport> <priority> <address> <port> typ <cand-type>
uint32_t foundation; string foundation;
uint32_t component; uint32_t component;
string transport {"udp"}; string transport {"udp"};
uint32_t priority; uint32_t priority;