Skip to content

Commit 75db98c

Browse files
committed
modify:webrtc push recv
1 parent 6c07b18 commit 75db98c

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/StreamMedia_PushStream/PushStream_ClientWebRtc.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,19 @@ bool PushStream_ClientProtocol_Handle(LPCXSTR lpszClientAddr, XSOCKET hSocket, L
146146
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("RTC客户端:%s,RTP协议解密失败,大小:%d,错误码:%lX"), lpszClientAddr, nMsgLen, ModuleHelp_GetLastError());
147147
return false;
148148
}
149+
/*
149150
fwrite(tszRVBuffer, 1, nRVLen, pSt_VFile);
150151
151152
XCHAR tszFileSize[64] = {};
152153
int nRet = _xstprintf(tszFileSize, _X("%d\r\n"), nRVLen);
153154
fwrite(tszFileSize, 1, nRet, pSt_AFile);
154-
/*
155+
*/
155156
//RTP
156157
if (!RTPProtocol_Parse_Send(lpszClientAddr, tszRVBuffer, nRVLen))
157158
{
158159
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_ERROR, _X("RTC客户端:%s,RTP协议解析失败,大小:%d,错误码:%lX"), lpszClientAddr, nMsgLen, RTPProtocol_GetLastError());
159160
return false;
160161
}
161-
*/
162162
XLOG_PRINT(xhLog, XENGINE_HELPCOMPONENTS_XLOG_IN_LOGLEVEL_DEBUG, _X("RTC客户端:%s,%d,请求的RTP协议处理成功"), lpszClientAddr, nMsgLen);
163163
}
164164
}
@@ -171,7 +171,7 @@ bool PushStream_ClientProtocol_Handle(LPCXSTR lpszClientAddr, XSOCKET hSocket, L
171171
}
172172
bool PushStream_ClientProtocol_Thread()
173173
{
174-
while (true)
174+
while (bIsRun)
175175
{
176176
RTPProtocol_Parse_WaitEvent(1);
177177

@@ -190,7 +190,7 @@ bool PushStream_ClientProtocol_Thread()
190190
{
191191
break;
192192
}
193-
fwrite(ptszMSGBuffer, 1, nMSGLen, pSt_VFile);
193+
//fwrite(ptszMSGBuffer, 1, nMSGLen, pSt_VFile);
194194
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMSGBuffer);
195195
}
196196
while (true)
@@ -209,6 +209,7 @@ bool PushStream_ClientProtocol_Thread()
209209
}
210210
BaseLib_Memory_Free((XPPPMEM)&ppSt_ListAddr, nListCount);
211211
}
212+
return true;
212213
}
213214
bool PushStream_ClientWebRtc_SDKPacket(XNETHANDLE xhPacket, LPCXSTR lpszClientID, bool bVideo, int nAVIndex, STREAMMEDIA_SDPPROTOCOL_MEDIAINFO* pSt_SDPMediaInfo)
214215
{

XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ void ServiceApp_Stop(int signo)
107107

108108
ManagePool_Memory_Destory(xhMemoryPool);
109109
HelpComponents_XLog_Destroy(xhLog);
110+
111+
if (NULL != pSTD_RTCThread)
112+
{
113+
if (pSTD_RTCThread->joinable())
114+
{
115+
pSTD_RTCThread->join();
116+
}
117+
}
110118
if (NULL != pSt_AFile)
111119
{
112120
fclose(pSt_AFile);

0 commit comments

Comments
 (0)