提交 ab4a8fa7 编写于 作者: xengine-qyt's avatar xengine-qyt

delete:unused code for session module

上级 4e1b1251
......@@ -67,10 +67,6 @@ typedef struct tag_XEngine_ServiceConfig
{
bool bEnable;
}st_PullRtsp;
struct
{
bool bEnable;
}st_PullSrt;
}st_XPull;
struct
{
......
......@@ -269,74 +269,6 @@ extern "C" bool ModuleSession_PushStream_GetHDRBuffer(LPCXSTR lpszClientAddr, XC
*********************************************************************/
extern "C" bool ModuleSession_PushStream_FindStream(LPCXSTR lpszSMSAddr, XCHAR* ptszClientAddr);
/********************************************************************
函数名称:ModuleSession_PushStream_Send
函数功能:投递一段数据给会话管理器
参数.一:lpszClientAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输入要操作的流
参数.二:lpszMsgBuffer
In/Out:In
类型:常量字符指针
可空:N
意思:输入要投递的数据缓冲区
参数.三:nMsgLen
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区大小
参数.四:nAVType
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区类型.0视频1音频
参数.五:nFrameType
In/Out:In
类型:整数型
可空:N
意思:输入帧类型,视频的关键帧还是PB
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool ModuleSession_PushStream_Send(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nAVType, int nFrameType);
/********************************************************************
函数名称:ModuleSession_PushStream_Recv
函数功能:获取缓冲区队列数据
参数.一:lpszClientAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输入要操作的流
参数.二:lpszMsgBuffer
In/Out:In
类型:常量字符指针
可空:N
意思:输入要投递的数据缓冲区
参数.三:nMsgLen
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区大小
参数.四:nAVType
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区类型.0视频1音频
参数.五:nFrameType
In/Out:In
类型:整数型
可空:N
意思:输入帧类型,视频的关键帧还是PB
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
extern "C" bool ModuleSession_PushStream_Recv(LPCXSTR lpszClientAddr, XCHAR** pptszMsgBuffer, int* pInt_MsgLen, int* pInt_AVType, int* pInt_FrameType);
/********************************************************************
函数名称:ModuleSession_PushStream_ClientInsert
函数功能:客户端插入
参数.一:lpszClientAddr
......
......@@ -61,10 +61,9 @@ bool CModuleSession_PushStream::ModuleSession_PushStream_Create(LPCXSTR lpszClie
pSt_Packet->st_ClientLocker = make_unique<mutex>();
pSt_Packet->st_MSGLocker = make_unique<mutex>();
pSt_Packet->pStl_ListClient = make_unique<list<STREAMMEDIA_SESSIONCLIENT>>();
pSt_Packet->pStl_ListPacket = make_unique<list<AVPACKET_MSGBUFFER>>();
pSt_Packet->pStl_MapPushStream = make_unique<unordered_map<int, AVPACKET_HDRBUFFER>>();
if ((NULL == pSt_Packet->pStl_ListPacket) || (NULL == pSt_Packet->pStl_ListClient))
if ((NULL == pSt_Packet->pStl_MapPushStream) || (NULL == pSt_Packet->pStl_ListClient))
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_MALLOC;
......@@ -457,164 +456,6 @@ bool CModuleSession_PushStream::ModuleSession_PushStream_FindStream(LPCXSTR lpsz
return true;
}
/********************************************************************
函数名称:ModuleSession_PushStream_Send
函数功能:投递一段数据给会话管理器
参数.一:lpszClientAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输入客户端地址
参数.二:lpszMsgBuffer
In/Out:In
类型:常量字符指针
可空:N
意思:输入要投递的数据缓冲区
参数.三:nMsgLen
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区大小
参数.四:nAVType
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区类型.0视频1音频
参数.五:nFrameType
In/Out:In
类型:整数型
可空:N
意思:输入帧类型,视频的关键帧还是PB
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
bool CModuleSession_PushStream::ModuleSession_PushStream_Send(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nAVType, int nFrameType)
{
Session_IsErrorOccur = false;
if (NULL == lpszClientAddr)
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_PARAMENT;
return false;
}
//是否存在
st_Locker.lock_shared();
unordered_map<xstring, PUSHSTREAM_PACKET*>::iterator stl_MapIterator = stl_MapPushStream.find(lpszClientAddr);
if (stl_MapIterator == stl_MapPushStream.end())
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_NOTFOUND;
st_Locker.unlock_shared();
return false;
}
AVPACKET_MSGBUFFER st_MSGBuffer;
memset(&st_MSGBuffer, '\0', sizeof(AVPACKET_MSGBUFFER));
st_MSGBuffer.nAVType = nAVType;
st_MSGBuffer.nFrameType = nFrameType;
st_MSGBuffer.nMsgLen = nMsgLen;
st_MSGBuffer.ptszMsgBuffer = (XCHAR*)malloc(nMsgLen);
if (NULL == st_MSGBuffer.ptszMsgBuffer)
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_MALLOC;
st_Locker.unlock_shared();
return false;
}
memcpy(st_MSGBuffer.ptszMsgBuffer, lpszMsgBuffer, nMsgLen);
stl_MapIterator->second->st_MSGLocker->lock();
//视频?
if (0 == nAVType)
{
//遇到关键帧
if (1 == nFrameType)
{
//释放所有包
for (auto stl_ListIterator = stl_MapIterator->second->pStl_ListPacket->begin(); stl_ListIterator != stl_MapIterator->second->pStl_ListPacket->end(); stl_ListIterator++)
{
free(stl_ListIterator->ptszMsgBuffer);
}
stl_MapIterator->second->pStl_ListPacket->clear();
}
}
stl_MapIterator->second->pStl_ListPacket->push_back(st_MSGBuffer);
stl_MapIterator->second->st_MSGLocker->unlock();
st_Locker.unlock_shared();
return true;
}
/********************************************************************
函数名称:ModuleSession_PushStream_Recv
函数功能:获取缓冲区队列数据
参数.一:lpszClientAddr
In/Out:In
类型:常量字符指针
可空:N
意思:输入客户端地址
参数.二:lpszMsgBuffer
In/Out:In
类型:常量字符指针
可空:N
意思:输入要投递的数据缓冲区
参数.三:nMsgLen
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区大小
参数.四:nAVType
In/Out:In
类型:整数型
可空:N
意思:输入缓冲区类型.0视频1音频
参数.五:nFrameType
In/Out:In
类型:整数型
可空:N
意思:输入帧类型,视频的关键帧还是PB
返回值
类型:逻辑型
意思:是否成功
备注:
*********************************************************************/
bool CModuleSession_PushStream::ModuleSession_PushStream_Recv(LPCXSTR lpszClientAddr, XCHAR** pptszMsgBuffer, int* pInt_MsgLen, int* pInt_AVType, int* pInt_FrameType)
{
Session_IsErrorOccur = false;
if (NULL == lpszClientAddr)
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_PARAMENT;
return false;
}
//是否存在
st_Locker.lock_shared();
unordered_map<xstring, PUSHSTREAM_PACKET*>::iterator stl_MapIterator = stl_MapPushStream.find(lpszClientAddr);
if (stl_MapIterator == stl_MapPushStream.end())
{
Session_IsErrorOccur = true;
Session_dwErrorCode = ERROR_STREAMMEDIA_MODULE_SESSION_NOTFOUND;
st_Locker.unlock_shared();
return false;
}
//输出内容
stl_MapIterator->second->st_MSGLocker->lock();
AVPACKET_MSGBUFFER st_MSGBuffer = stl_MapIterator->second->pStl_ListPacket->front();
stl_MapIterator->second->pStl_ListPacket->pop_front();
*pInt_AVType = st_MSGBuffer.nAVType;
*pInt_FrameType = st_MSGBuffer.nFrameType;
*pInt_MsgLen = st_MSGBuffer.nMsgLen;
*pptszMsgBuffer = st_MSGBuffer.ptszMsgBuffer;
stl_MapIterator->second->st_MSGLocker->unlock();
st_Locker.unlock_shared();
return true;
}
/********************************************************************
函数名称:ModuleSession_PushStream_ClientInsert
函数功能:客户端插入
参数.一:lpszClientAddr
......
......@@ -10,13 +10,6 @@
// Purpose: 推流全局会话
// History:
*********************************************************************/
typedef struct
{
int nAVType; //包类型
int nFrameType; //帧类型
int nMsgLen; //大小
XCHAR* ptszMsgBuffer;
}AVPACKET_MSGBUFFER;
typedef struct
{
XCHAR tszMsgBuffer[2048]; //缓存的头
......@@ -32,7 +25,6 @@ typedef struct
unique_ptr<mutex> st_ClientLocker;
unique_ptr<list<STREAMMEDIA_SESSIONCLIENT>> pStl_ListClient;
unique_ptr<list<AVPACKET_MSGBUFFER>> pStl_ListPacket;
unique_ptr<unordered_map<int, AVPACKET_HDRBUFFER>> pStl_MapPushStream;
}PUSHSTREAM_PACKET;
......@@ -50,8 +42,6 @@ public:
bool ModuleSession_PushStream_SetAVInfo(LPCXSTR lpszClientAddr, XENGINE_PROTOCOL_AVINFO *pSt_AVInfo);
bool ModuleSession_PushStream_GetAVInfo(LPCXSTR lpszClientAddr, XENGINE_PROTOCOL_AVINFO* pSt_AVInfo);
bool ModuleSession_PushStream_FindStream(LPCXSTR lpszSMSAddr, XCHAR* ptszClientAddr);
bool ModuleSession_PushStream_Send(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nAVType, int nFrameType);
bool ModuleSession_PushStream_Recv(LPCXSTR lpszClientAddr, XCHAR** pptszMsgBuffer, int* pInt_MsgLen, int* pInt_AVType, int* pInt_FrameType);
public:
bool ModuleSession_PushStream_ClientInsert(LPCXSTR lpszClientAddr, LPCXSTR lpszPullAddr, ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE enStreamType);
bool ModuleSession_PushStream_ClientDelete(LPCXSTR lpszClientAddr, LPCXSTR lpszPullAddr);
......
......@@ -16,8 +16,6 @@ EXPORTS
ModuleSession_PushStream_SetHDRBuffer
ModuleSession_PushStream_GetHDRBuffer
ModuleSession_PushStream_FindStream
ModuleSession_PushStream_Send
ModuleSession_PushStream_Recv
ModuleSession_PushStream_ClientInsert
ModuleSession_PushStream_ClientDelete
ModuleSession_PushStream_ClientList
......
......@@ -82,14 +82,6 @@ extern "C" bool ModuleSession_PushStream_FindStream(LPCXSTR lpszSMSAddr, XCHAR *
{
return m_PushStream.ModuleSession_PushStream_FindStream(lpszSMSAddr, ptszClientAddr);
}
extern "C" bool ModuleSession_PushStream_Send(LPCXSTR lpszClientAddr, LPCXSTR lpszMsgBuffer, int nMsgLen, int nAVType, int nFrameType)
{
return m_PushStream.ModuleSession_PushStream_Send(lpszClientAddr, lpszMsgBuffer, nMsgLen, nAVType, nFrameType);
}
extern "C" bool ModuleSession_PushStream_Recv(LPCXSTR lpszClientAddr, XCHAR * *pptszMsgBuffer, int* pInt_MsgLen, int* pInt_AVType, int* pInt_FrameType)
{
return m_PushStream.ModuleSession_PushStream_Recv(lpszClientAddr, pptszMsgBuffer, pInt_MsgLen, pInt_AVType, pInt_FrameType);
}
extern "C" bool ModuleSession_PushStream_ClientInsert(LPCXSTR lpszClientAddr, LPCXSTR lpszPullAddr, ENUM_XENGINE_STREAMMEDIA_CLIENT_TYPE enStreamType)
{
return m_PushStream.ModuleSession_PushStream_ClientInsert(lpszClientAddr, lpszPullAddr, enStreamType);
......
......@@ -60,6 +60,7 @@ using namespace std;
#include "XEngine_Network.h"
#include "XEngine_HttpTask.h"
#include "XEngine_AVPacket.h"
#include "./StreamMedia_HTTPApi/StreamMedia_HTTPApi.h"
#include "./StreamMedia_PushStream/PushStream_XStreamTask.h"
#include "./StreamMedia_PushStream/PushStream_JT1078Task.h"
#include "./StreamMedia_PushStream/PushStream_RTMPTask.h"
......
......@@ -112,8 +112,7 @@ bool XEngine_HTTPTask_Handle(RFCCOMPONENTS_HTTP_REQPARAM* pSt_HTTPParam, LPCXSTR
}
else if (0 == _tcsxnicmp(lpszMethodGet, pSt_HTTPParam->tszHttpMethod, _tcsxlen(lpszMethodGet)))
{
HTTPApi_Management_Task(lpszClientAddr, &pptszList, nListCount);
}
}
else if (0 == _tcsxnicmp(lpszStreamStr, tszKey, _tcsxlen(lpszStreamStr)))
......
......@@ -143,6 +143,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="StreamMedia_HTTPApi\StreamMedia_HTTPApi.cpp" />
<ClCompile Include="StreamMedia_PullStream\PullStream_ClientTask.cpp" />
<ClCompile Include="StreamMedia_PushStream\PushStream_SrtTask.cpp" />
<ClCompile Include="StreamMedia_PushStream\PushStream_XStreamTask.cpp" />
......@@ -155,6 +156,7 @@
<ClCompile Include="XEngine_StreamMediaApp.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="StreamMedia_HTTPApi\StreamMedia_HTTPApi.h" />
<ClInclude Include="StreamMedia_PullStream\PullStream_ClientTask.h" />
<ClInclude Include="StreamMedia_PushStream\PushStream_SrtTask.h" />
<ClInclude Include="StreamMedia_PushStream\PushStream_XStreamTask.h" />
......
......@@ -25,6 +25,12 @@
<Filter Include="源文件\StreamMedia_PushStream">
<UniqueIdentifier>{483f3dbf-574e-40d3-926c-7800af8128d4}</UniqueIdentifier>
</Filter>
<Filter Include="头文件\StreamMedia_HTTPApi">
<UniqueIdentifier>{ce9678cb-e92a-466c-8b48-a5799850482a}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\StreamMedia_HTTPApi">
<UniqueIdentifier>{0f6d4989-e2ae-4f8f-9dc9-359762306774}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="XEngine_StreamMediaApp.cpp">
......@@ -57,6 +63,9 @@
<ClCompile Include="StreamMedia_PushStream\PushStream_SrtTask.cpp">
<Filter>源文件\StreamMedia_PushStream</Filter>
</ClCompile>
<ClCompile Include="StreamMedia_HTTPApi\StreamMedia_HTTPApi.cpp">
<Filter>源文件\StreamMedia_HTTPApi</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="XEngine_Configure.h">
......@@ -89,5 +98,8 @@
<ClInclude Include="StreamMedia_PushStream\PushStream_SrtTask.h">
<Filter>头文件\StreamMedia_PushStream</Filter>
</ClInclude>
<ClInclude Include="StreamMedia_HTTPApi\StreamMedia_HTTPApi.h">
<Filter>头文件\StreamMedia_HTTPApi</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册