Skip to content

Commit 0304bd4

Browse files
committed
modify:srt and rtc off by default
fixed:disable compile options not work for srt and rtc
1 parent e31f1e7 commit 0304bd4

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

XEngine_Source/XEngine_BuildSwitch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
// Purpose: 编译开关选项
1111
// History:
1212
*********************************************************************/
13-
#define _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT 1 //SRT协议编译开关选项
14-
#define _XENGINE_STREAMMEDIA_BUILDSWITCH_RTC 1 //WEBRTC协议编译开关选项
13+
#define _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT 0 //SRT协议编译开关选项
14+
#define _XENGINE_STREAMMEDIA_BUILDSWITCH_RTC 0 //WEBRTC协议编译开关选项

XEngine_Source/XEngine_ModuleHelp/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ LOADHDR = -I ./
1010
LOADSO =
1111
LIB = -lXEngine_OPenSsl
1212
LIBEX =
13-
OBJECTS = ModuleHelp_JT1078.o ModuleHelp_SrtCore.o ModuleHelp_Rtsp.o ModuleHelp_Rtmp.o pch.o
13+
OBJECTS = ModuleHelp_JT1078.o ModuleHelp_SrtCore.o ModuleHelp_Rtsp.o ModuleHelp_Rtmp.o ModuleHelp_SRTPCore.o pch.o
1414

1515
MACRO_SRT_SUPPORT := $(shell gcc -E -dM ../XEngine_BuildSwitch.h | grep _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT | cut -d ' ' -f 3)
1616
MACRO_RTC_SUPPORT := $(shell gcc -E -dM ../XEngine_BuildSwitch.h | grep _XENGINE_STREAMMEDIA_BUILDSWITCH_RTC | cut -d ' ' -f 3)
1717

1818
ifeq ($(MACRO_SRT_SUPPORT),1)
1919
LIB += -lsrt-gnutls
2020
endif
21+
ifeq ($(MACRO_SRT_SUPPORT),1)
22+
LIB += -lsrtp2
23+
endif
2124

2225
ifeq ($(RELEASE),1)
2326
FLAGS = -c
@@ -67,6 +70,8 @@ ModuleHelp_Rtsp.o:./ModuleHelp_Rtsp/ModuleHelp_Rtsp.cpp
6770
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./ModuleHelp_Rtsp/ModuleHelp_Rtsp.cpp
6871
ModuleHelp_Rtmp.o:./ModuleHelp_Rtmp/ModuleHelp_Rtmp.cpp
6972
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./ModuleHelp_Rtmp/ModuleHelp_Rtmp.cpp
73+
ModuleHelp_SRTPCore.o:./ModuleHelp_SRtp/ModuleHelp_SRTPCore.cpp
74+
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./ModuleHelp_SRtp/ModuleHelp_SRTPCore.cpp
7075

7176
pch.o:./pch.cpp
7277
$(CC) $(DEBUG) $(FLAGS) $(UNICODE) $(PLATVER) $(LOADHDR) ./pch.cpp

XEngine_Source/XEngine_ModuleHelp/ModuleHelp_SRtp/ModuleHelp_SRTPCore.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ bool CModuleHelp_SRTPCore::ModuleHelp_SRTPCore_Create(LPCXBTR lpszKEYBuffer)
7575
const int SRTP_MASTER_KEY_KEY_LEN = 16;
7676
const int SRTP_MASTER_KEY_SALT_LEN = 14;
7777

78-
std::string m_StrClientKey(reinterpret_cast<LPCXSTR>(lpszKEYBuffer), 16);
79-
nPos += 16;
80-
std::string m_StrServerKey(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), 16);
81-
nPos += 16;
82-
std::string m_StrClientSalt(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), 14);
83-
nPos += 14;
84-
std::string m_StrServerSalt(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), 14);
78+
std::string m_StrClientKey(reinterpret_cast<LPCXSTR>(lpszKEYBuffer), SRTP_MASTER_KEY_KEY_LEN);
79+
nPos += SRTP_MASTER_KEY_KEY_LEN;
80+
std::string m_StrServerKey(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), SRTP_MASTER_KEY_KEY_LEN);
81+
nPos += SRTP_MASTER_KEY_KEY_LEN;
82+
std::string m_StrClientSalt(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), SRTP_MASTER_KEY_SALT_LEN);
83+
nPos += SRTP_MASTER_KEY_SALT_LEN;
84+
std::string m_StrServerSalt(reinterpret_cast<LPCXSTR>(lpszKEYBuffer + nPos), SRTP_MASTER_KEY_SALT_LEN);
8585

8686
std::string m_ClientKey = m_StrClientKey + m_StrClientSalt;
8787
std::string m_ServerKey = m_StrServerKey + m_StrServerSalt;

XEngine_Source/XEngine_ModuleHelp/ModuleHelp_Srt/ModuleHelp_SrtCore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ bool CModuleHelp_SrtCore::ModuleHelp_SrtCore_Leave(XSOCKET hSocket)
490490
//////////////////////////////////////////////////////////////////////////
491491
XHTHREAD CALLBACK CModuleHelp_SrtCore::ModuleHelp_SrtCore_Thread(XPVOID lParam)
492492
{
493+
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT
493494
CModuleHelp_SrtCore* pClass_This = (CModuleHelp_SrtCore*)lParam;
494495

495-
#if 1 == _XENGINE_STREAMMEDIA_BUILDSWITCH_SRT
496496
while (pClass_This->bRun)
497497
{
498498
int nSRTCount = 100;

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LOADSO = -L ../../XEngine_ModuleConfigure -L ../../XEngine_ModuleProtocol -L ../
99
-L ../../XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Depend/XEngine_Module/XEngine_InfoReport
1010
LIB = -lXEngine_BaseLib -lXEngine_Algorithm -lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl -lXClient_Stream -lHelpComponents_XLog -lHelpComponents_Packets -lNetHelp_APIHelp -lNetHelp_XSocket -lRfcComponents_HttpProtocol -lRfcComponents_NatProtocol -lXEngine_AVHelp -lStreamMedia_FLVProtocol -lStreamMedia_RTMPProtocol -lStreamMedia_SDPProtocol -lStreamMedia_HLSProtocol -lStreamMedia_RTSPProtocol -lStreamMedia_RTPProtocol -lStreamMedia_RTCPProtocol \
1111
-lXEngine_ModuleConfigure -lXEngine_ModuleProtocol -lXEngine_ModuleSession -lXEngine_ModuleHelp -lXEngine_ModuleQueue \
12-
-ljsoncpp -lXEngine_InfoReport -lsrt-gnutls
12+
-ljsoncpp -lXEngine_InfoReport
1313
LIBEX =
1414
OBJECTS = PullStream_ClientGet.o PullStream_ClientRtsp.o PullStream_ClientWebRtc.o \
1515
PushStream_JT1078Task.o PushStream_RTMPTask.o PushStream_XStreamTask.o PushStream_SrtTask.o \

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/StreamMedia_PushStream/PushStream_SrtTask.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
// Purpose: SRT推拉流代码
1111
// History:
1212
*********************************************************************/
13-
bool PushStream_SrtTask_Connct(LPCXSTR lpszClientAddr, SRTSOCKET hSocket)
13+
bool PushStream_SrtTask_Connct(LPCXSTR lpszClientAddr, XSOCKET hSocket)
1414
{
1515
bool bPublish = false;
1616
XCHAR tszSMSAddr[MAX_PATH];
1717
memset(tszSMSAddr, '\0', sizeof(tszSMSAddr));
1818

1919
if (!ModuleHelp_SrtCore_GetStreamID(hSocket, tszSMSAddr, &bPublish))
2020
{
21-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("SRT客户端:获取流ID信息失败,错误码:%lX,错误信息:%s"), ModuleHelp_GetLastError(), srt_getlasterror_str());
21+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("SRT客户端:获取流ID信息失败,错误码:%lX"), ModuleHelp_GetLastError());
2222
return false;
2323
}
2424

@@ -48,7 +48,7 @@ bool PushStream_SrtTask_Connct(LPCXSTR lpszClientAddr, SRTSOCKET hSocket)
4848
return true;
4949
}
5050

51-
bool PushStream_SrtTask_Handle(LPCXSTR lpszClientAddr, SRTSOCKET hSocket, LPCXSTR lpszMsgBuffer, int nMsgLen)
51+
bool PushStream_SrtTask_Handle(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPCXSTR lpszMsgBuffer, int nMsgLen)
5252
{
5353
if (!HLSProtocol_TSParse_Send(lpszClientAddr, lpszMsgBuffer, nMsgLen))
5454
{

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/StreamMedia_PushStream/PushStream_SrtTask.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
// Purpose: SRT推拉流代码
1111
// History:
1212
*********************************************************************/
13-
bool PushStream_SrtTask_Connct(LPCXSTR lpszClientAddr, SRTSOCKET hSocket);
13+
bool PushStream_SrtTask_Connct(LPCXSTR lpszClientAddr, XSOCKET hSocket);
1414
//任务处理相关函数,处理包的内容
15-
bool PushStream_SrtTask_Handle(LPCXSTR lpszClientAddr, SRTSOCKET hSocket, LPCXSTR lpszMsgBuffer, int nMsgLen);
15+
bool PushStream_SrtTask_Handle(LPCXSTR lpszClientAddr, XSOCKET hSocket, LPCXSTR lpszMsgBuffer, int nMsgLen);
1616

1717
XHTHREAD CALLBACK PushStream_SRTTask_Thread(XPVOID lParam);
1818
bool PushStream_SrtTask_ThreadProcess(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, XBYTE byAVType);

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_Hdr.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <thread>
99
#include <list>
1010
#include <string>
11-
#include <srt/srt.h>
1211
#ifdef _MSC_BUILD
1312
#include <Windows.h>
1413
#include <tchar.h>

0 commit comments

Comments
 (0)