Skip to content

Commit dd79a42

Browse files
committed
fixed:example build error
1 parent fd761f5 commit dd79a42

File tree

4 files changed

+43
-37
lines changed

4 files changed

+43
-37
lines changed

XEngine_APPClient/APPClient_JT1078/APPClient_JT1078.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
#include <windows.h>
33
#include <tchar.h>
44
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
5-
#pragma comment(lib,"XEngine_Core/XEngine_OPenSsl")
5+
#pragma comment(lib,"XEngine_Core/XEngine_Cryption")
66
#pragma comment(lib,"XEngine_Client/XClient_Socket")
7+
#pragma comment(lib,"XEngine_AVCodec/XEngine_AVFrame")
78
#pragma comment(lib,"XEngine_AVCodec/XEngine_AVHelp")
89
#pragma comment(lib,"Ws2_32")
910
#endif
@@ -13,26 +14,28 @@
1314
#include <XEngine_Include/XEngine_ProtocolHdr.h>
1415
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Define.h>
1516
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
16-
#include <XEngine_Include/XEngine_Core/OPenSsl_Define.h>
17-
#include <XEngine_Include/XEngine_Core/OPenSsl_Error.h>
17+
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
18+
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
1819
#include <XEngine_Include/XEngine_Client/XClient_Define.h>
1920
#include <XEngine_Include/XEngine_Client/XClient_Error.h>
2021
#include <XEngine_Include/XEngine_AVCodec/AVCollect_Define.h>
2122
#include <XEngine_Include/XEngine_AVCodec/VideoCodec_Define.h>
23+
#include <XEngine_Include/XEngine_AVCodec/AVFrame_Define.h>
24+
#include <XEngine_Include/XEngine_AVCodec/AVFrame_Error.h>
2225
#include <XEngine_Include/XEngine_AVCodec/AVHelp_Define.h>
2326
#include <XEngine_Include/XEngine_AVCodec/AVHelp_Error.h>
2427
#include "../../XEngine_Source/XEngine_UserProtocol.h"
2528
using namespace std;
2629

2730
//需要优先配置XEngine
2831
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
29-
//g++ -std=c++17 -Wall -g APPClient_JT1078.cpp -o APPClient_JT1078.exe -lXEngine_BaseLib -lXEngine_OPenSsl -lXClient_Socket -lXEngine_AVHelp
32+
//g++ -std=c++17 -Wall -g APPClient_JT1078.cpp -o APPClient_JT1078.exe -lXEngine_BaseLib -lXEngine_Cryption -lXClient_Socket -lXEngine_AVFrame -lXEngine_AVHelp
3033

3134
void XEngine_Device_StrtoBCD(LPCXSTR lpszPhoneCode, XBYTE* ptszBCD)
3235
{
3336
for (int i = 0, nPos = 0; i < 6; i++)
3437
{
35-
OPenSsl_Codec_2BytesToBCD(&lpszPhoneCode[nPos], ptszBCD[i]);
38+
Cryption_Codec_2BytesToBCD(&lpszPhoneCode[nPos], ptszBCD[i]);
3639
nPos += 2;
3740
}
3841
}
@@ -63,7 +66,7 @@ int main()
6366

6467
int nSeq = 0;
6568
XNETHANDLE xhToken = 0;
66-
AVHelp_Parse_FrameInit(&xhToken, ENUM_XENGINE_AVCODEC_VIDEO_TYPE_H264);
69+
AVFrame_Frame_ParseInit(&xhToken, ENUM_XENGINE_AVCODEC_VIDEO_TYPE_H264);
6770

6871
while (true)
6972
{
@@ -81,8 +84,8 @@ int main()
8184
}
8285
}
8386
int nListCount = 0;
84-
AVHELP_FRAMEDATA** ppSt_Frame;
85-
AVHelp_Parse_FrameGet(xhToken, tszRVBuffer, nRet, &ppSt_Frame, &nListCount);
87+
AVFRAME_PARSEDATA** ppSt_Frame;
88+
AVFrame_Frame_ParseGet(xhToken, tszRVBuffer, nRet, &ppSt_Frame, &nListCount);
8689
for (int i = 0; i < nListCount; i++)
8790
{
8891
bool bFirst = true;
@@ -147,7 +150,7 @@ int main()
147150

148151
st_RTPPacket.wSerial = htons(nSeq++);
149152
XEngine_Device_StrtoBCD(lpszPhone, st_RTPPacket.bySIMNumber);
150-
BaseLib_OperatorTime_SetXTPTime(&st_RTPPacket.ullTimestamp);
153+
BaseLib_Time_SetXTPTime(&st_RTPPacket.ullTimestamp);
151154

152155
int nPos = 0;
153156
XCHAR tszMsgBuffer[2048];
@@ -168,12 +171,12 @@ int main()
168171
nUseCount += nCpyCount;
169172
nMsgCount -= nCpyCount;
170173
}
171-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ppSt_Frame[i]->ptszMsgBuffer);
174+
BaseLib_Memory_FreeCStyle((XPPMEM)&ppSt_Frame[i]->ptszMsgBuffer);
172175
}
173-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_Frame, nListCount);
176+
BaseLib_Memory_Free((XPPPMEM)&ppSt_Frame, nListCount);
174177
std::this_thread::sleep_for(std::chrono::milliseconds(40));
175178
}
176-
AVHelp_Parse_FrameClose(xhToken);
179+
AVFrame_Frame_ParseClose(xhToken);
177180

178181
WSACleanup();
179182
return 0;

XEngine_APPClient/APPClient_WebRTC/APPClient_WebRTC.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <windows.h>
66
#include <tchar.h>
77
#pragma comment(lib,"XEngine_BaseLib/XEngine_BaseLib")
8+
#pragma comment(lib,"XEngine_Core/XEngine_Cryption")
89
#pragma comment(lib,"XEngine_Client/XClient_Socket")
9-
#pragma comment(lib,"XEngine_Client/XClient_OPenSsl")
1010
#pragma comment(lib,"XEngine_Client/XClient_APIHelp")
1111
#pragma comment(lib,"XEngine_StreamMedia/StreamMedia_SDPProtocol")
1212
#pragma comment(lib,"XEngine_StreamMedia/StreamMedia_RTPProtocol")
@@ -25,12 +25,12 @@
2525
#include <XEngine_Include/XEngine_BaseLib/BaseLib_Error.h>
2626
#include <XEngine_Include/XEngine_Core/ManagePool_Define.h>
2727
#include <XEngine_Include/XEngine_Core/ManagePool_Error.h>
28+
#include <XEngine_Include/XEngine_Core/Cryption_Define.h>
29+
#include <XEngine_Include/XEngine_Core/Cryption_Error.h>
2830
#include <XEngine_Include/XEngine_Client/XClient_Define.h>
2931
#include <XEngine_Include/XEngine_Client/XClient_Error.h>
3032
#include <XEngine_Include/XEngine_Client/APIClient_Define.h>
3133
#include <XEngine_Include/XEngine_Client/APIClient_Error.h>
32-
#include <XEngine_Include/XEngine_Client/SslClient_Define.h>
33-
#include <XEngine_Include/XEngine_Client/SslClient_Error.h>
3434
#include <XEngine_Include/XEngine_StreamMedia/SDPProtocol_Define.h>
3535
#include <XEngine_Include/XEngine_StreamMedia/SDPProtocol_Error.h>
3636
#include <XEngine_Include/XEngine_StreamMedia/RTPProtocol_Define.h>
@@ -69,7 +69,7 @@ bool APPClient_WEBRTC_SDPPacket(LPCXSTR lpszAPIUrl, LPCXSTR lpszFileCert, XCHAR*
6969

7070
int nAVCount = 1;
7171
XCHAR** pptszAVList;
72-
BaseLib_OperatorMemory_Malloc((XPPPMEM)&pptszAVList, nAVCount, 64);/*
72+
BaseLib_Memory_Malloc((XPPPMEM)&pptszAVList, nAVCount, 64);/*
7373
_xstprintf(pptszAVList[0], _X("111"));
7474
7575
SDPProtocol_Packet_AddMedia(xhToken, _X("audio"), _X("UDP/TLS/RTP/SAVPF"), &pptszAVList, nAVCount, 0, 9);
@@ -156,8 +156,8 @@ bool APPClient_WEBRTC_SDPParse(LPCXSTR lpszMSGBuffer, int nMSGLen, XCHAR* ptszIC
156156
XCHAR tszAlgorithmVlu[MAX_PATH] = {};
157157
SDPProtocol_Parse_AttrFinger(&ppSt_ListAttr, nAttrCount, tszAlgorithmKey, tszAlgorithmVlu);
158158

159-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_AVMedia, nListCount);
160-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_ListAttr, nAttrCount);
159+
BaseLib_Memory_Free((XPPPMEM)&ppSt_AVMedia, nListCount);
160+
BaseLib_Memory_Free((XPPPMEM)&ppSt_ListAttr, nAttrCount);
161161
SDPProtocol_Parse_Destory(xhParse);
162162
return true;
163163
}
@@ -171,12 +171,12 @@ bool APPClient_WEBRTC_StunSend(XSOCKET hSocket, LPCXSTR lpszICEUser, LPCXSTR lps
171171
XCHAR tszRandomStr[10] = {};
172172

173173
_xstprintf(tszICEUser, _X("%s:nzWE"), lpszICEUser);
174-
BaseLib_OperatorHandle_CreateStr(tszRandomStr, 8, 0, 2);
174+
BaseLib_Handle_CreateStr(tszRandomStr, 8, 0, 2);
175175
NatProtocol_StunNat_BuildAttr(tszTmpBuffer, &nMSGLen, RFCCOMPONENTS_NATCLIENT_PROTOCOL_STUN_ATTR_USERNAME, tszICEUser, 13);
176176
NatProtocol_StunNat_BuildAttr(tszTmpBuffer + nMSGLen, &nMSGLen, RFCCOMPONENTS_NATCLIENT_PROTOCOL_STUN_ATTR_ICE_CONTROLLING, tszRandomStr, 8);
177177
NatProtocol_StunNat_BuildPriority(tszTmpBuffer + nMSGLen, &nMSGLen);
178178

179-
BaseLib_OperatorHandle_CreateStr(tszTokenStr, 12, 0, 2);
179+
BaseLib_Handle_CreateStr(tszTokenStr, 12, 0, 2);
180180
NatProtocol_StunNat_Packet(tszMSGBuffer, &nMSGLen, tszTokenStr, RFCCOMPONENTS_NATCLIENT_PROTOCOL_STUN_CLASS_REQUEST, RFCCOMPONENTS_NATCLIENT_PROTOCOL_STUN_ATTR_MAPPED_ADDRESS, tszTmpBuffer, true, lpszICEPass, true);
181181

182182
while (true)
@@ -238,22 +238,21 @@ bool APPClient_WEBRTC_Dlts(XSOCKET hSocket)
238238
LPCXSTR lpszCertFile = _X("D:\\XEngine_StreamMedia\\XEngine_APPClient\\Debug\\certificate.crt");
239239
LPCXSTR lpszPrivateFile = _X("D:\\XEngine_StreamMedia\\XEngine_APPClient\\Debug\\private.key");
240240

241-
XHANDLE xhSsl = XClient_OPenSsl_InitEx(ENUM_XCLIENT_SSL_TYPE_DTL_VERSION, false, lpszCertFile, NULL, lpszPrivateFile);
241+
XHANDLE xhSsl = Cryption_Client_InitEx(XENGINE_CRYPTION_PROTOCOL_DTL, false, lpszCertFile, NULL, lpszPrivateFile);
242242
if (NULL == xhSsl)
243243
{
244244
return false;
245245
}
246246
RTPProtocol_Parse_Init(1);
247247
RTPProtocol_Parse_Insert(lpszRTPClient);
248248

249-
XClient_OPenSsl_ConfigEx(xhSsl);
249+
Cryption_Client_ConfigEx(xhSsl);
250250

251-
XCLIENT_SSLCERT_SRVINFO st_SslInfo = {};
252251
SRTPCORE_CLIENTINFO st_SRTPInfo = {};
253-
XClient_OPenSsl_ConnectEx(xhSsl, hSocket, &st_SslInfo);
252+
Cryption_Client_ConnectEx(xhSsl, hSocket);
254253

255254
XBYTE byKEYBuffer[128] = {};
256-
XClient_OPenSsl_GetKeyEx(xhSsl, byKEYBuffer);
255+
Cryption_Client_GetKeyEx(xhSsl, byKEYBuffer);
257256
for (int i = 0; i < 60; i++)
258257
{
259258
printf("0x%02X, ", byKEYBuffer[i]);
@@ -343,7 +342,7 @@ bool APPClient_WEBRTC_Dlts(XSOCKET hSocket)
343342
free(ptszRTPBuffer);
344343
ptszRTPBuffer = NULL;
345344
fclose(pSt_264File);
346-
XClient_OPenSsl_CloseEx(xhSsl);
345+
Cryption_Client_CloseEx(xhSsl);
347346
RTPProtocol_Parse_Destory();
348347
return true;
349348
}
@@ -371,7 +370,7 @@ int main()
371370
XCHAR tszICEUser[128] = {};
372371
XCHAR tszICEPass[128] = {};
373372
APPClient_WEBRTC_SDPParse(ptszMSGBuffer, nMSGLen, tszICEUser, tszICEPass);
374-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMSGBuffer);
373+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMSGBuffer);
375374

376375
XClient_UDPSelect_Create(&hSocket);
377376
//XClient_UDPSelect_Connect(hSocket, "10.0.3.154", 8000);

XEngine_APPClient/APPClient_XStream/APPClient_XStream.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ XNETHANDLE xhVideo = 0;
3535
__int64u nTimeVideo = 0;
3636
FILE* pSt_File = NULL;
3737

38-
void CALLBACK XEngine_AVCollect_CBVideo(uint8_t* punStringY, int nYLen, uint8_t* punStringU, int nULen, uint8_t* punStringV, int nVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam)
38+
void CALLBACK XEngine_AVCollect_CBVideo(uint8_t* ptszAVBuffer, int nAVLen, AVCOLLECT_TIMEINFO* pSt_TimeInfo, XPVOID lParam)
3939
{
4040
XCHAR* ptszMsgBuffer = (XCHAR*)malloc(XENGINE_MEMORY_SIZE_MAX);
4141
XENGINE_PROTOCOLHDR st_ProtocolHdr;
@@ -54,24 +54,24 @@ void CALLBACK XEngine_AVCollect_CBVideo(uint8_t* punStringY, int nYLen, uint8_t*
5454

5555
int nListCount = 0;
5656
AVCODEC_VIDEO_MSGBUFFER** ppSt_MSGBuffer;
57-
VideoCodec_Stream_EnCodec(xhVideo, punStringY, punStringU, punStringV, nYLen, nULen, nVLen, &ppSt_MSGBuffer, &nListCount);
57+
VideoCodec_Stream_EnCodec(xhVideo, ptszAVBuffer, nAVLen, &ppSt_MSGBuffer, &nListCount);
5858
for (int i = 0; i < nListCount; i++)
5959
{
6060
nTimeVideo += (1000 / 24);
6161
st_ProtocolData.byAVType = 0;
6262
st_ProtocolData.nTimeStamp = nTimeVideo;
6363
st_ProtocolData.byFrameType = ppSt_MSGBuffer[i]->st_VideoInfo.nFrameType;
64-
st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_AVDATA) + ppSt_MSGBuffer[i]->nYLen;
64+
st_ProtocolHdr.unPacketSize = sizeof(XENGINE_PROTOCOL_AVDATA) + ppSt_MSGBuffer[i]->nAVLen;
6565

6666
memcpy(ptszMsgBuffer, &st_ProtocolHdr, sizeof(XENGINE_PROTOCOLHDR));
6767
memcpy(ptszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR), &st_ProtocolData, sizeof(XENGINE_PROTOCOL_AVDATA));
68-
memcpy(ptszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR) + sizeof(XENGINE_PROTOCOL_AVDATA), ppSt_MSGBuffer[i]->ptszYBuffer, ppSt_MSGBuffer[i]->nYLen);
69-
XClient_TCPSelect_SendMsg(hSocket, ptszMsgBuffer, sizeof(XENGINE_PROTOCOLHDR) + sizeof(XENGINE_PROTOCOL_AVDATA) + ppSt_MSGBuffer[i]->nYLen);
70-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ppSt_MSGBuffer[i]->ptszYBuffer);
68+
memcpy(ptszMsgBuffer + sizeof(XENGINE_PROTOCOLHDR) + sizeof(XENGINE_PROTOCOL_AVDATA), ppSt_MSGBuffer[i]->ptszAVBuffer, ppSt_MSGBuffer[i]->nAVLen);
69+
XClient_TCPSelect_SendMsg(hSocket, ptszMsgBuffer, sizeof(XENGINE_PROTOCOLHDR) + sizeof(XENGINE_PROTOCOL_AVDATA) + ppSt_MSGBuffer[i]->nAVLen);
70+
BaseLib_Memory_FreeCStyle((XPPMEM)&ppSt_MSGBuffer[i]->ptszAVBuffer);
7171

72-
printf("Time:%llu Size:%d Type:%d\n", nTimeVideo, ppSt_MSGBuffer[i]->nYLen, ppSt_MSGBuffer[i]->st_VideoInfo.nFrameType);
72+
printf("Time:%llu Size:%d Type:%d\n", nTimeVideo, ppSt_MSGBuffer[i]->nAVLen, ppSt_MSGBuffer[i]->st_VideoInfo.nFrameType);
7373
}
74-
BaseLib_OperatorMemory_Free((XPPPMEM)&ppSt_MSGBuffer, nListCount);
74+
BaseLib_Memory_Free((XPPPMEM)&ppSt_MSGBuffer, nListCount);
7575
free(ptszMsgBuffer);
7676
ptszMsgBuffer = NULL;
7777
}
@@ -147,7 +147,7 @@ int XStream_Push()
147147
_xtprintf("%d\n", st_ProtocolHdr.wReserve);
148148
if (nLen > 0)
149149
{
150-
BaseLib_OperatorMemory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
150+
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
151151
}
152152

153153
AVCollect_Video_Start(xhScreen);

XEngine_APPClient/VSCopy-x86.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
copy /y "%XEngine_Lib32%\XEngine_BaseLib\XEngine_BaseLib.dll" "./"
2-
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_OPenSsl.dll" "./"
2+
3+
copy /y "%XEngine_Lib32%\XEngine_Core\XEngine_Cryption.dll" "./"
4+
35
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_Socket.dll" "./"
46
copy /y "%XEngine_Lib32%\XEngine_Client\XClient_APIHelp.dll" "./"
7+
58
copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AVHelp.dll" "./"
69
copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AVCollect.dll" "./"
710
copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_VideoCodec.dll" "./"
11+
copy /y "%XEngine_Lib32%\XEngine_AVCodec\XEngine_AVFrame.dll" "./"
812

913
copy /y "%XEngine_Lib32%\XEngine_StreamMedia\StreamMedia_SDPProtocol.dll" "./"
1014

0 commit comments

Comments
 (0)