Skip to content

Commit

Permalink
update:match xengine v9.x support
Browse files Browse the repository at this point in the history
  • Loading branch information
xengine-qyt committed Dec 31, 2024
1 parent 790805b commit d1c50b4
Show file tree
Hide file tree
Showing 26 changed files with 137 additions and 122 deletions.
2 changes: 1 addition & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ install srt library after Configure Xengine to Completed
ubuntu:sudo apt install libsrt-gnutls-dev libsrtp2-dev

Linux use Makefile complie
UBUNTU22.04 x64 or RockyLinux 9 x64
UBUNTU22.04 or above

##### Compile Command
execute command in XEngine_Source path
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ vcpkg.exe install libsrt:x86-windows libsrt:x64-windows libsrtp:x86-windows libs
ubuntu:sudo apt install libsrt-gnutls-dev libsrtp2-dev

Linux使用Makefile编译
UBUNTU22.04 或者 RockyLinux 9 x64均可
UBUNTU22.04或者以上版本

###### 编译命令

Expand Down
4 changes: 3 additions & 1 deletion XEngine_Source/VSCopy_Debug.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseLib.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_BaseSafe.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Algorithm.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Core.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_Cryption.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_ManagePool.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_OPenSsl.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_Stream.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XClient_APIHelp.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_XSocket.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIHelp.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\NetHelp_APIAddr.dll" "./"
copy /y "D:\XEngine\XEngine_SourceCode\Debug\XEngine_SystemApi.dll" "./"

copy /y "D:\XEngine\XEngine_SourceCode\Debug\HelpComponents_Packets.dll" "./"
Expand Down
4 changes: 3 additions & 1 deletion XEngine_Source/VSCopy_x64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Core.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_ManagePool.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_OPenSsl.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Core\XEngine_Cryption.dll" "./"

copy /y "%XEngine_Lib64%\XEngine_Client\XClient_Stream.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_Client\XClient_APIHelp.dll" "./"

copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_XSocket.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./"
copy /y "%XEngine_Lib64%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

copy /y "%XEngine_Lib64%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./"
Expand Down
4 changes: 3 additions & 1 deletion XEngine_Source/VSCopy_x86.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseSafe.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_Algorithm.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Core.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_ManagePool.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Stream.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_XSocket.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIHelp.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_NetHelp\NetHelp_APIAddr.dll" "./"
copy /y "%XEngine_Lib32%\XEngine_SystemSdk\XEngine_SystemApi.dll" "./"

copy /y "%XEngine_Lib32%\XEngine_HelpComponents\HelpComponents_Packets.dll" "./"
Expand Down
2 changes: 1 addition & 1 deletion XEngine_Source/XEngine_ModuleHelp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RELEASE = 0
UNICODE = 0
LOADHDR = -I ./
LOADSO =
LIB = -lXEngine_BaseLib -lXEngine_OPenSsl
LIB = -lXEngine_BaseLib -lXEngine_Cryption -lNetHelp_APIAddr
LIBEX =
OBJECTS = ModuleHelp_JT1078.o ModuleHelp_SrtCore.o ModuleHelp_Rtsp.o ModuleHelp_Rtmp.o ModuleHelp_SRTPCore.o pch.o

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool CModuleHelp_JT1078::ModuleHelp_JT1078_BCDToString(XBYTE bySIMNumber[6], XCH
}
for (int i = 0, nPos = 0; i < 6; i++)
{
OPenSsl_Codec_BCDTo2Bytes(bySIMNumber[i], &ptszMsgBuffer[nPos]);
Cryption_Codec_BCDTo2Bytes(bySIMNumber[i], &ptszMsgBuffer[nPos]);
nPos += 2;
}
return true;
Expand Down Expand Up @@ -81,7 +81,7 @@ bool CModuleHelp_JT1078::ModuleHelp_JT1078_StringToBCD(LPCXSTR lpszMsgBuffer, XB
}
for (int i = 0, nPos = 0; i < 6; i++)
{
OPenSsl_Codec_2BytesToBCD(&lpszMsgBuffer[i], pbySIMNumber[nPos]);
Cryption_Codec_2BytesToBCD(&lpszMsgBuffer[i], pbySIMNumber[nPos]);
nPos += 2;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bool CModuleHelp_Rtsp::ModuleHelp_Rtsp_GetRTPAddr(LPCXSTR lpszClientID, XCHAR* p
XCHAR tszIPAddr[128] = {};
_tcsxcpy(tszIPAddr, lpszClientID);

BaseLib_OperatorIPAddr_SegAddr(tszIPAddr, &nPort);
APIAddr_IPAddr_SegAddr(tszIPAddr, &nPort);
if (bVideo)
{
_xstprintf(ptszADDRStr, _X("%s:%d"), tszIPAddr, stl_MapIterator->second.nVideoRTPPort);
Expand Down Expand Up @@ -506,7 +506,7 @@ bool CModuleHelp_Rtsp::ModuleHelp_Rtsp_GetRTCPAddr(LPCXSTR lpszClientID, XCHAR*
}
int nPort = 0;
XCHAR tszIPAddr[128] = {};
BaseLib_OperatorIPAddr_SegAddr(tszIPAddr, &nPort);
APIAddr_IPAddr_SegAddr(tszIPAddr, &nPort);
if (bVideo)
{
_xstprintf(ptszADDRStr, _X("%s:%d"), tszIPAddr, stl_MapIterator->second.nVideoRTCPPort);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ bool CModuleHelp_SrtCore::ModuleHelp_SrtCore_GetStreamID(XSOCKET hSocket, XCHAR*
memset(tszSMSAddr, '\0', sizeof(tszSMSAddr));
memset(tszSMSMode, '\0', sizeof(tszSMSMode));

BaseLib_OperatorString_GetKeyValue(stl_MapIterator->second.tszStreamBuffer + 4, _X(","), tszSMSAddr, tszSMSMode);
BaseLib_OperatorString_GetKeyValue(tszSMSAddr, _X("="), tszTmpStr, ptszSMSAddr);
BaseLib_String_GetKeyValue(stl_MapIterator->second.tszStreamBuffer + 4, _X(","), tszSMSAddr, tszSMSMode);
BaseLib_String_GetKeyValue(tszSMSAddr, _X("="), tszTmpStr, ptszSMSAddr);

if (NULL != _tcsxstr(tszSMSMode, _X("publish")))
{
Expand Down
9 changes: 6 additions & 3 deletions XEngine_Source/XEngine_ModuleHelp/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ using namespace std;
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
#include <XEngine_Include/XEngine_Core/NetCore_Define.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
#include <XEngine_Include/XEngine_NetHelp/APIAddr_Define.h>
#include <XEngine_Include/XEngine_NetHelp/APIAddr_Error.h>
#include "../XEngine_UserProtocol.h"
#include "ModuleHelp_Define.h"
#include "ModuleHelp_Error.h"
Expand All @@ -58,6 +60,7 @@ extern XLONG ModuleHelp_dwErrorCode;

#ifdef _MSC_BUILD
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
#pragma comment(lib,"XEngine_Core/XEngine_Cryption")
#pragma comment(lib,"XEngine_NetHelp/NetHelp_APIAddr")
#pragma comment(lib,"Ws2_32")
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ bool CModuleSession_PullStream::ModuleSession_PullStream_GetList(STREAMMEDIA_PUL
st_Locker.lock_shared();

*pInt_ListCount = stl_MapClient.size();
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_PullList, stl_MapClient.size(), sizeof(STREAMMEDIA_PULLLISTINFO));
BaseLib_Memory_Malloc((XPPPMEM)pppSt_PullList, stl_MapClient.size(), sizeof(STREAMMEDIA_PULLLISTINFO));

auto stl_MapIterator = stl_MapClient.begin();
for (int i = 0; stl_MapIterator != stl_MapClient.end(); stl_MapIterator++, i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ bool CModuleSession_PushStream::ModuleSession_PushStream_GetInfo(STREAMMEDIA_PUB
st_Locker.lock_shared();

*pInt_ListCount = stl_MapPushStream.size();
BaseLib_OperatorMemory_Malloc((XPPPMEM)pppSt_ProtocolStream, stl_MapPushStream.size(), sizeof(STREAMMEDIA_PUBLISHINFO));
BaseLib_Memory_Malloc((XPPPMEM)pppSt_ProtocolStream, stl_MapPushStream.size(), sizeof(STREAMMEDIA_PUBLISHINFO));

unordered_map<xstring, PUSHSTREAM_PACKET*>::iterator stl_MapIterator = stl_MapPushStream.begin();
for (int i = 0; stl_MapIterator != stl_MapPushStream.end(); stl_MapIterator++, i++)
Expand Down Expand Up @@ -550,7 +550,7 @@ bool CModuleSession_PushStream::ModuleSession_PushStream_HLSInsert(LPCXSTR lpszC
XCHAR tszFilePath[MAX_PATH] = {};
XCHAR tszFileName[MAX_PATH] = {};
//获得文件名和路径
BaseLib_OperatorString_GetFileAndPath(lpszTSFile, tszFilePath, tszFileName);
BaseLib_String_GetFileAndPath(lpszTSFile, tszFilePath, tszFileName);
SystemApi_File_CreateMutilFolder(tszFilePath);

_tcsxcpy(stl_MapIterator->second->st_HLSFile.tszFileName, lpszTSFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ LOADHDR = -I ./
LOADSO = -L ../../XEngine_ModuleConfigure -L ../../XEngine_ModuleProtocol -L ../../XEngine_ModuleSession -L ../../XEngine_ModuleHelp -L ../../XEngine_ModuleQueue \
-L ../../XEngine_Depend/XEngine_Module/jsoncpp -L ../../XEngine_Depend/XEngine_Module/XEngine_InfoReport
LIB = -lXEngine_BaseLib -lXEngine_Algorithm \
-lXEngine_Core -lXEngine_ManagePool -lXEngine_OPenSsl \
-lXEngine_Core -lXEngine_ManagePool -lXEngine_Cryption \
-lXClient_Stream \
-lHelpComponents_XLog -lHelpComponents_Packets \
-lNetHelp_APIHelp -lNetHelp_XSocket \
-lNetHelp_APIHelp -lNetHelp_XSocket lNetHelp_APIAddr \
-lRfcComponents_HttpProtocol -lRfcComponents_NatProtocol \
-lXEngine_AVHelp -lXEngine_AudioCodec \
-lStreamMedia_FLVProtocol -lStreamMedia_RTMPProtocol -lStreamMedia_SDPProtocol -lStreamMedia_HLSProtocol -lStreamMedia_RTSPProtocol -lStreamMedia_RTPProtocol -lStreamMedia_RTCPProtocol \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ bool HTTPApi_Management_Task(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr, int
st_HDRParam.nHttpCode = 200; //HTTP CODE码
st_HDRParam.bIsClose = true; //收到回复后就关闭

BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[0], "=", tszKeyBuffer, tszVluBuffer);
BaseLib_String_GetKeyValue((*ppptszListHdr)[0], "=", tszKeyBuffer, tszVluBuffer);

if (0 == _tcsxnicmp(lpszAPIPublish, tszVluBuffer, _tcsxlen(lpszAPIPublish)))
{
//获取发布流:http://127.0.0.1:5600?api?function=publish&method=get
memset(tszKeyBuffer, '\0', sizeof(tszKeyBuffer));
memset(tszVluBuffer, '\0', sizeof(tszVluBuffer));

BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszVluBuffer);
BaseLib_String_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszVluBuffer);
if (0 == _tcsxnicmp(lpszAPIGet, tszVluBuffer, _tcsxlen(lpszAPIGet)))
{
int nListCount = 0;
Expand All @@ -50,7 +50,7 @@ bool HTTPApi_Management_Task(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr, int
HttpProtocol_Server_SendMsgEx(xhHttpPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen);
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen, ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE_HTTP);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP接口:%s,请求获取发布流信息成功,个数:%d"), lpszClientAddr, nListCount);
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ProtocolStream, nListCount);
BaseLib_Memory_Free((XPPPMEM)&ppSt_ProtocolStream, nListCount);
}
}
else if (0 == _tcsxnicmp(lpszAPIPull, tszVluBuffer, _tcsxlen(lpszAPIPull)))
Expand All @@ -59,7 +59,7 @@ bool HTTPApi_Management_Task(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr, int
memset(tszKeyBuffer, '\0', sizeof(tszKeyBuffer));
memset(tszVluBuffer, '\0', sizeof(tszVluBuffer));

BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszVluBuffer);
BaseLib_String_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszVluBuffer);
if (0 == _tcsxnicmp(lpszAPIGet, tszVluBuffer, _tcsxlen(lpszAPIGet)))
{
int nListCount = 0;
Expand All @@ -69,7 +69,7 @@ bool HTTPApi_Management_Task(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr, int
HttpProtocol_Server_SendMsgEx(xhHttpPacket, tszSDBuffer, &nSDLen, &st_HDRParam, tszRVBuffer, nRVLen);
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen, ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE_HTTP);
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP接口:%s,请求获取订阅流信息成功,个数:%d"), lpszClientAddr, nListCount);
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_PullList, nListCount);
BaseLib_Memory_Free((XPPPMEM)&ppSt_PullList, nListCount);
}
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
st_HDRParam.nHttpCode = 200; //HTTP CODE码
st_HDRParam.bIsClose = true; //收到回复后就关闭

BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[0], "=", tszKeyBuffer, tszVluBuffer);
BaseLib_String_GetKeyValue((*ppptszListHdr)[0], "=", tszKeyBuffer, tszVluBuffer);

if (0 == _tcsxnicmp(lpszStreamPlay, tszVluBuffer, _tcsxlen(lpszStreamPlay)))
{
Expand All @@ -44,7 +44,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
memset(tszKeyBuffer, '\0', sizeof(tszKeyBuffer));
memset(tszVluBuffer, '\0', sizeof(tszVluBuffer));

BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszSMSAddr);
BaseLib_String_GetKeyValue((*ppptszListHdr)[1], "=", tszKeyBuffer, tszSMSAddr);

if (!ModuleSession_PushStream_FindStream(tszSMSAddr, tszPushAddr))
{
Expand All @@ -55,7 +55,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
return false;
}
memset(tszVluBuffer, '\0', sizeof(tszVluBuffer));
BaseLib_OperatorString_GetKeyValue((*ppptszListHdr)[2], "=", tszKeyBuffer, tszVluBuffer);
BaseLib_String_GetKeyValue((*ppptszListHdr)[2], "=", tszKeyBuffer, tszVluBuffer);

ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE enStreamType;
if (0 == _tcsxnicmp(tszVluBuffer, "flv", 3))
Expand All @@ -72,7 +72,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Credentials: true\r\n"
"Transfer-Encoding: chunked\r\n\r\n"
"%x\r\n"), BaseLib_OperatorVer_XTypeStr(), nRVLen);
"%x\r\n"), BaseLib_Version_XTypeStr(), nRVLen);
memcpy(tszSDBuffer + nSDLen, tszRVBuffer, nRVLen);
nSDLen += nRVLen;
memcpy(tszSDBuffer + nSDLen, _X("\r\n"), 2);
Expand Down Expand Up @@ -139,7 +139,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Credentials: true\r\n"
"Transfer-Encoding: chunked\r\n\r\n"
"%x\r\n"), BaseLib_OperatorVer_XTypeStr(), nRVLen);
"%x\r\n"), BaseLib_Version_XTypeStr(), nRVLen);
memcpy(tszSDBuffer + nSDLen, &st_AVInfo, nRVLen);
nSDLen += nRVLen;
memcpy(tszSDBuffer + nSDLen, _X("\r\n"), 2);
Expand All @@ -160,7 +160,7 @@ bool PullStream_ClientGet_Handle(LPCXSTR lpszClientAddr, XCHAR*** ppptszListHdr,
"Server: XEngine/%s\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Access-Control-Allow-Credentials: true\r\n"
"Transfer-Encoding: chunked\r\n\r\n"), BaseLib_OperatorVer_XTypeStr());
"Transfer-Encoding: chunked\r\n\r\n"), BaseLib_Version_XTypeStr());
XEngine_Network_Send(lpszClientAddr, tszSDBuffer, nSDLen, ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE_HTTP);

ModuleSession_PullStream_Insert(lpszClientAddr, tszSMSAddr, tszPushAddr, enStreamType);
Expand Down
Loading

0 comments on commit d1c50b4

Please sign in to comment.