Skip to content

Commit 308267d

Browse files
committed
modfy:stun port remove rtc port
1 parent 13feea3 commit 308267d

File tree

7 files changed

+22
-8
lines changed

7 files changed

+22
-8
lines changed

XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ typedef struct tag_XEngine_ServiceConfig
2424
int nXStreamPort; //X流协议服务
2525
int nJT1078Port; //JT1078协议流支持
2626
int nSrtPort; //srt协议端口
27+
int nRTCPort; //webrtc推拉流端口
2728
struct
2829
{
2930
int nMaxClient; //最大客户端个数
@@ -92,7 +93,6 @@ typedef struct tag_XEngine_ServiceConfig
9293
XCHAR tszPrivateKey[MAX_PATH];
9394
XCHAR tszPublicKey[MAX_PATH];
9495
XCHAR tszRequestKey[MAX_PATH];
95-
int nSTUNPort;
9696
bool bEnable;
9797
}st_PullWebRtc;
9898
}st_XPull;

XEngine_Source/XEngine_ModuleConfigure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
9090
pSt_ServerConfig->nXStreamPort = st_JsonRoot["nXStreamPort"].asInt();
9191
pSt_ServerConfig->nJT1078Port = st_JsonRoot["nJT1078Port"].asInt();
9292
pSt_ServerConfig->nSrtPort = st_JsonRoot["nSrtPort"].asInt();
93+
pSt_ServerConfig->nRTCPort = st_JsonRoot["nRTCPort"].asInt();
9394
//最大配置
9495
if (st_JsonRoot["XMax"].empty() || (8 != st_JsonRoot["XMax"].size()))
9596
{
@@ -154,7 +155,6 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
154155
pSt_ServerConfig->st_XPull.st_PullHls.nTime = st_PullHls["nTime"].asInt();
155156
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullHls.tszHLSPath, st_PullHls["tszHLSPath"].asCString());
156157

157-
pSt_ServerConfig->st_XPull.st_PullWebRtc.nSTUNPort = st_PullWebRtc["nSTUNPort"].asInt();
158158
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszPrivateKey, st_PullWebRtc["RSAPrivateKey"].asCString());
159159
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszPublicKey, st_PullWebRtc["RSAPublicKey"].asCString());
160160
_tcsxcpy(pSt_ServerConfig->st_XPull.st_PullWebRtc.tszRequestKey, st_PullWebRtc["RSARequestKey"].asCString());

XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Srt/ModuleHelp_SrtCore.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ bool CModuleHelp_SrtCore::ModuleHelp_SrtCore_Send(LPCXSTR lpszClientAddr, LPCXST
158158
bFound = true;
159159
break;
160160
}
161-
else
162-
{
163-
}
164161
}
165162
if (!bFound)
166163
{

XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
<ClInclude Include="ModuleHelp_JT1078\ModuleHelp_JT1078.h" />
177177
<ClInclude Include="ModuleHelp_Rtmp\ModuleHelp_Rtmp.h" />
178178
<ClInclude Include="ModuleHelp_Rtsp\ModuleHelp_Rtsp.h" />
179+
<ClInclude Include="ModuleHelp_SRtp\ModuleHelp_SRTPCore.h" />
179180
<ClInclude Include="ModuleHelp_Srt\ModuleHelp_SrtCore.h" />
180181
<ClInclude Include="pch.h" />
181182
</ItemGroup>
@@ -184,6 +185,7 @@
184185
<ClCompile Include="ModuleHelp_JT1078\ModuleHelp_JT1078.cpp" />
185186
<ClCompile Include="ModuleHelp_Rtmp\ModuleHelp_Rtmp.cpp" />
186187
<ClCompile Include="ModuleHelp_Rtsp\ModuleHelp_Rtsp.cpp" />
188+
<ClCompile Include="ModuleHelp_SRtp\ModuleHelp_SRTPCore.cpp" />
187189
<ClCompile Include="ModuleHelp_Srt\ModuleHelp_SrtCore.cpp" />
188190
<ClCompile Include="pch.cpp">
189191
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

XEngine_Source/XEngine_ModuleHelp/XEngine_ModuleHelp.vcxproj.filters

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
<Filter Include="源文件\ModuleHelp_Rtmp">
3838
<UniqueIdentifier>{301461bf-f0c1-48b4-85e9-5424834f57e7}</UniqueIdentifier>
3939
</Filter>
40+
<Filter Include="头文件\ModuleHelp_SRtp">
41+
<UniqueIdentifier>{3954caa5-b437-4d6d-abfa-6f6cd7354b9c}</UniqueIdentifier>
42+
</Filter>
43+
<Filter Include="源文件\ModuleHelp_SRtp">
44+
<UniqueIdentifier>{ce029e9f-9497-4ec2-8882-8bedd40eb742}</UniqueIdentifier>
45+
</Filter>
4046
</ItemGroup>
4147
<ItemGroup>
4248
<ClInclude Include="framework.h">
@@ -63,6 +69,9 @@
6369
<ClInclude Include="ModuleHelp_Rtmp\ModuleHelp_Rtmp.h">
6470
<Filter>头文件\ModuleHelp_Rtmp</Filter>
6571
</ClInclude>
72+
<ClInclude Include="ModuleHelp_SRtp\ModuleHelp_SRTPCore.h">
73+
<Filter>头文件\ModuleHelp_SRtp</Filter>
74+
</ClInclude>
6675
</ItemGroup>
6776
<ItemGroup>
6877
<ClCompile Include="dllmain.cpp">
@@ -83,6 +92,9 @@
8392
<ClCompile Include="ModuleHelp_Rtmp\ModuleHelp_Rtmp.cpp">
8493
<Filter>源文件\ModuleHelp_Rtmp</Filter>
8594
</ClCompile>
95+
<ClCompile Include="ModuleHelp_SRtp\ModuleHelp_SRTPCore.cpp">
96+
<Filter>源文件\ModuleHelp_SRtp</Filter>
97+
</ClCompile>
8698
</ItemGroup>
8799
<ItemGroup>
88100
<None Include="XEngine_ModuleHelp.def">

XEngine_Source/XEngine_ModuleHelp/pch.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT
2626
#include <srt/srt.h>
2727
#endif
28+
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_RTC
29+
#include <srtp2/srtp.h>
30+
#endif
2831
using namespace std;
2932
#include <XEngine_Include/XEngine_CommHdr.h>
3033
#include <XEngine_Include/XEngine_Types.h>

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ int main(int argc, char** argv)
501501

502502
if (st_ServiceConfig.st_XPull.st_PullWebRtc.bEnable)
503503
{
504-
xhSTUNSocket = NetCore_UDPXCore_StartEx(st_ServiceConfig.st_XPull.st_PullWebRtc.nSTUNPort, 1);
504+
xhSTUNSocket = NetCore_UDPXCore_StartEx(st_ServiceConfig.nRTCPort, 1);
505505
if (NULL == xhSTUNSocket)
506506
{
507-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动WEBRTC的STUN网络端口:%d 失败,错误:%d"), st_ServiceConfig.st_XPull.st_PullWebRtc.nSTUNPort, errno);
507+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("启动服务中,启动WEBRTC网络端口:%d 失败,错误:%d"), st_ServiceConfig.nRTCPort, errno);
508508
goto XENGINE_SERVICEAPP_EXIT;
509509
}
510510
NetCore_UDPXCore_RegisterCallBackEx(xhSTUNSocket, Network_Callback_VideoRTPRecv);
511-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动WEBRTC的STUN端口:%d 成功"), st_ServiceConfig.st_XPull.st_PullWebRtc.nSTUNPort);
511+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("启动服务中,启动WEBRTC端口:%d 成功"), st_ServiceConfig.nRTCPort);
512512
}
513513

514514
if (st_ServiceConfig.st_XPull.st_PullHls.bEnable)

0 commit comments

Comments
 (0)