Skip to content

Commit 3c0e33b

Browse files
committed
modify:create new field for api address report for back service
1 parent e81eef6 commit 3c0e33b

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Define.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,12 @@ extern "C" bool ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffer, int nMsgL
11091109
类型:字符指针
11101110
可空:N
11111111
意思:输出解析好的信息
1112-
参数.五:pInt_BSType
1112+
参数.五:ptszAPIBuffer
1113+
In/Out:Out
1114+
类型:字符指针
1115+
可空:N
1116+
意思:输出反驳地址
1117+
参数.六:pInt_BSType
11131118
In/Out:Out
11141119
类型:整数型指针
11151120
可空:N
@@ -1119,7 +1124,7 @@ extern "C" bool ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffer, int nMsgL
11191124
意思:是否成功
11201125
备注:输出的内容具体参考协议文档
11211126
*********************************************************************/
1122-
extern "C" bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer = NULL, XCHAR* ptszDstBuffer = NULL, int* pInt_BSType = NULL);
1127+
extern "C" bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer = NULL, XCHAR* ptszDstBuffer = NULL, XCHAR* ptszAPIBuffer = NULL, int* pInt_BSType = NULL);
11231128
/********************************************************************
11241129
函数名称:ModuleProtocol_Parse_Verifcation
11251130
函数功能:解析验证协议

XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,12 @@ bool CModuleProtocol_Parse::ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffe
780780
类型:字符指针
781781
可空:N
782782
意思:输出解析好的信息
783-
参数.五:pInt_BSType
783+
参数.五:ptszAPIBuffer
784+
In/Out:Out
785+
类型:字符指针
786+
可空:N
787+
意思:输出反驳地址
788+
参数.六:pInt_BSType
784789
In/Out:Out
785790
类型:整数型指针
786791
可空:N
@@ -790,7 +795,7 @@ bool CModuleProtocol_Parse::ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffe
790795
意思:是否成功
791796
备注:输出的内容具体参考协议文档
792797
*********************************************************************/
793-
bool CModuleProtocol_Parse::ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer, XCHAR* ptszDstBuffer, int* pInt_BSType)
798+
bool CModuleProtocol_Parse::ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer, XCHAR* ptszDstBuffer, XCHAR* ptszAPIBuffer, int* pInt_BSType)
794799
{
795800
ModuleProtocol_IsErrorOccur = false;
796801

@@ -826,6 +831,13 @@ bool CModuleProtocol_Parse::ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuff
826831
_tcsxcpy(ptszDstBuffer, st_JsonRoot["tszDstBuffer"].asCString());
827832
}
828833
}
834+
if (!st_JsonRoot["tszAPIBuffer"].isNull())
835+
{
836+
if (NULL != ptszAPIBuffer)
837+
{
838+
_tcsxcpy(ptszAPIBuffer, st_JsonRoot["tszAPIBuffer"].asCString());
839+
}
840+
}
829841
if (!st_JsonRoot["nBSType"].isNull())
830842
{
831843
if (NULL != pInt_BSType)

XEngine_Source/XEngine_ModuleProtocol/ModuleProtocol_Parse/ModuleProtocol_Parse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CModuleProtocol_Parse
2828
bool ModuleProtocol_Parse_SocketTest(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_SOCKETTEST* pSt_SocketTest);
2929
bool ModuleProtocol_Parse_ShortLink(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_SHORTLINK* pSt_ShortLink);
3030
bool ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_WORDFILTER* pSt_WordFilter);
31-
bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer = NULL, XCHAR* ptszDstBuffer = NULL, int* pInt_BSType = NULL);
31+
bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszSrcBuffer = NULL, XCHAR* ptszDstBuffer = NULL, XCHAR* ptszAPIBuffer = NULL, int* pInt_BSType = NULL);
3232
bool ModuleProtocol_Parse_Verifcation(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszUserName, XCHAR* ptszUserPass);
3333
bool ModuleProtocol_Parse_Deamon(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR* ptszAPPName, XCHAR* ptszAPPPath, int* pInt_Retime, int* pInt_ReNumber, bool* pbEnable);
3434
bool ModuleProtocol_Parse_Weather(LPCXSTR lpszMsgBuffer, int nMsgLen, XENGINE_WEATHERINFO* pSt_WeatherInfo);

XEngine_Source/XEngine_ModuleProtocol/pch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ extern "C" bool ModuleProtocol_Parse_WordFilter(LPCXSTR lpszMsgBuffer, int nMsgL
186186
{
187187
return m_ProtocolParse.ModuleProtocol_Parse_WordFilter(lpszMsgBuffer, nMsgLen, pSt_WordFilter);
188188
}
189-
extern "C" bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR * ptszSrcBuffer, XCHAR * ptszDstBuffer, int* pInt_BSType)
189+
extern "C" bool ModuleProtocol_Parse_BackService(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR * ptszSrcBuffer, XCHAR * ptszDstBuffer, XCHAR* ptszAPIBuffer, int* pInt_BSType)
190190
{
191-
return m_ProtocolParse.ModuleProtocol_Parse_BackService(lpszMsgBuffer, nMsgLen, ptszSrcBuffer, ptszDstBuffer, pInt_BSType);
191+
return m_ProtocolParse.ModuleProtocol_Parse_BackService(lpszMsgBuffer, nMsgLen, ptszSrcBuffer, ptszDstBuffer, ptszAPIBuffer, pInt_BSType);
192192
}
193193
extern "C" bool ModuleProtocol_Parse_Verifcation(LPCXSTR lpszMsgBuffer, int nMsgLen, XCHAR * ptszUserName, XCHAR * ptszUserPass)
194194
{

XEngine_Source/XEngine_ServiceApp/XEngine_HttpApp/XEngine_TaskPost/TaskPost_BackService.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,10 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer
3030
CXEngine_MemoryPoolEx m_MemorySend(XENGINE_MEMORY_SIZE_MAX);
3131
CXEngine_MemoryPoolEx m_MemoryRecv(XENGINE_MEMORY_SIZE_MAX);
3232

33-
XCHAR tszSrcBuffer[XPATH_MAX];
34-
XCHAR tszDstBuffer[XPATH_MAX];
35-
RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam; //发送给客户端的参数
36-
37-
memset(tszSrcBuffer, '\0', sizeof(tszSrcBuffer));
38-
memset(tszDstBuffer, '\0', sizeof(tszDstBuffer));
39-
memset(&st_HDRParam, '\0', sizeof(RFCCOMPONENTS_HTTP_HDRPARAM));
33+
XCHAR tszSrcBuffer[XPATH_MAX] = {};
34+
XCHAR tszDstBuffer[XPATH_MAX] = {};
35+
XCHAR tszAPIBuffer[XPATH_MAX] = {};
36+
RFCCOMPONENTS_HTTP_HDRPARAM st_HDRParam = {}; //发送给客户端的参数
4037

4138
st_HDRParam.nHttpCode = 200; //HTTP CODE码
4239
st_HDRParam.bIsClose = true; //收到回复后就关闭
@@ -68,7 +65,7 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer
6865
return false;
6966
}
7067
}
71-
if (!ModuleProtocol_Parse_BackService(lpszMsgBuffer, nMsgLen, tszSrcBuffer, tszDstBuffer, &nBSType))
68+
if (!ModuleProtocol_Parse_BackService(lpszMsgBuffer, nMsgLen, tszSrcBuffer, tszDstBuffer, tszAPIBuffer, &nBSType))
7269
{
7370
st_HDRParam.nHttpCode = 400;
7471
HttpProtocol_Server_SendMsgEx(xhHTTPPacket, m_MemorySend.get(), &nSDLen, &st_HDRParam);
@@ -342,11 +339,11 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer
342339
st_AVScreen.nPosX = 0;
343340
st_AVScreen.nPosY = 0;
344341
#ifdef _MSC_BUILD
345-
xhScreen = AVCollect_Video_Init("gdigrab", "desktop", &st_AVScreen, HTTPTask_TaskPost_CBVideo);
342+
xhScreen = AVCollect_Video_Init("gdigrab", tszDstBuffer, &st_AVScreen, HTTPTask_TaskPost_CBVideo);
346343
#elif __linux__
347-
xhScreen = AVCollect_Video_Init("x11grab", ":0", &st_AVScreen, HTTPTask_TaskPost_CBVideo);
344+
xhScreen = AVCollect_Video_Init("x11grab", tszDstBuffer, &st_AVScreen, HTTPTask_TaskPost_CBVideo);
348345
#else
349-
xhScreen = AVCollect_Video_Init("avfoundation", "1", &st_AVScreen, HTTPTask_TaskPost_CBVideo);
346+
xhScreen = AVCollect_Video_Init("avfoundation", tszDstBuffer, &st_AVScreen, HTTPTask_TaskPost_CBVideo);
350347
#endif
351348
if (NULL == xhScreen)
352349
{
@@ -377,13 +374,13 @@ bool HTTPTask_TaskPost_BackService(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer
377374
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("HTTP客户端:%s,推流:%s 请求失败,错误码:%lX"), lpszClientAddr, tszDstBuffer, StreamClient_GetLastError());
378375
return false;
379376
}
380-
XClient_StreamPush_LiveOutput(xhStream, tszDstBuffer, _X("flv"));
377+
XClient_StreamPush_LiveOutput(xhStream, tszAPIBuffer, _X("flv"));
381378
XClient_StreamPush_LiveCreate(xhStream, &st_AVInfo);
382379
bRecord = true;
383380
AVCollect_Video_Start(xhScreen);
384381
HttpProtocol_Server_SendMsgEx(xhHTTPPacket, m_MemorySend.get(), &nSDLen, &st_HDRParam);
385382
XEngine_Network_Send(lpszClientAddr, m_MemorySend.get(), nSDLen);
386-
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,开始屏幕录制推流:%s 请求成功"), lpszClientAddr, tszDstBuffer);
383+
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_INFO, _X("HTTP客户端:%s,开始屏幕录制,音频:%s,视频:%s 推流:%s 请求成功"), lpszClientAddr, tszSrcBuffer, tszDstBuffer, tszAPIBuffer);
387384
}
388385
break;
389386
case XENGINE_COMMUNICATION_PROTOCOL_OPERATOR_CODE_BS_RECORDSTOP:

0 commit comments

Comments
 (0)