Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XEngine
XEngine StreamMedia
提交
ab4a8fa7
X
XEngine StreamMedia
项目概览
XEngine
/
XEngine StreamMedia
大约 1 年 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
XEngine StreamMedia
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ab4a8fa7
编写于
7月 31, 2023
作者:
xengine-qyt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete:unused code for session module
上级
4e1b1251
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
17 addition
and
254 deletion
+17
-254
XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
+0
-4
XEngine_Source/XEngine_ModuleSession/ModuleSession_Define.h
XEngine_Source/XEngine_ModuleSession/ModuleSession_Define.h
+0
-68
XEngine_Source/XEngine_ModuleSession/ModuleSession_PushStream/ModuleSession_PushStream.cpp
...ion/ModuleSession_PushStream/ModuleSession_PushStream.cpp
+1
-160
XEngine_Source/XEngine_ModuleSession/ModuleSession_PushStream/ModuleSession_PushStream.h
...ssion/ModuleSession_PushStream/ModuleSession_PushStream.h
+0
-10
XEngine_Source/XEngine_ModuleSession/XEngine_ModuleSession.def
...ne_Source/XEngine_ModuleSession/XEngine_ModuleSession.def
+0
-2
XEngine_Source/XEngine_ModuleSession/pch.cpp
XEngine_Source/XEngine_ModuleSession/pch.cpp
+0
-8
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_Hdr.h
...e/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_Hdr.h
+1
-0
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_HttpTask.cpp
...ne_ServiceApp/XEngine_StreamMediaApp/XEngine_HttpTask.cpp
+1
-2
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj
...App/XEngine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj
+2
-0
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj.filters
...ine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj.filters
+12
-0
未找到文件。
XEngine_Source/XEngine_ModuleConfigure/ModuleConfig_Define.h
浏览文件 @
ab4a8fa7
...
...
@@ -67,10 +67,6 @@ typedef struct tag_XEngine_ServiceConfig
{
bool
bEnable
;
}
st_PullRtsp
;
struct
{
bool
bEnable
;
}
st_PullSrt
;
}
st_XPull
;
struct
{
...
...
XEngine_Source/XEngine_ModuleSession/ModuleSession_Define.h
浏览文件 @
ab4a8fa7
...
...
@@ -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
...
...
XEngine_Source/XEngine_ModuleSession/ModuleSession_PushStream/ModuleSession_PushStream.cpp
浏览文件 @
ab4a8fa7
...
...
@@ -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
...
...
XEngine_Source/XEngine_ModuleSession/ModuleSession_PushStream/ModuleSession_PushStream.h
浏览文件 @
ab4a8fa7
...
...
@@ -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
);
...
...
XEngine_Source/XEngine_ModuleSession/XEngine_ModuleSession.def
浏览文件 @
ab4a8fa7
...
...
@@ -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
...
...
XEngine_Source/XEngine_ModuleSession/pch.cpp
浏览文件 @
ab4a8fa7
...
...
@@ -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
);
...
...
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_Hdr.h
浏览文件 @
ab4a8fa7
...
...
@@ -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"
...
...
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_HttpTask.cpp
浏览文件 @
ab4a8fa7
...
...
@@ -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
)))
...
...
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj
浏览文件 @
ab4a8fa7
...
...
@@ -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"
/>
...
...
XEngine_Source/XEngine_ServiceApp/XEngine_StreamMediaApp/XEngine_StreamMediaApp.vcxproj.filters
浏览文件 @
ab4a8fa7
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录