Skip to content

Commit c015605

Browse files
authored
Merge pull request #12 from libxengine/develop
V2.5.0.1001 Merge
2 parents f727e0f + dadeccc commit c015605

40 files changed

+1989
-243
lines changed

CHANGELOG

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
XEngine_StreamMedia V2.5.0.1001
2+
3+
增加:RTCP协议解析支持
4+
增加:RTP和RTCP的UDP套接字支持
5+
增加:RTSP拉流支持
6+
修改:客户端方法文件名称修改
7+
修改:http任务增加头列表参数传递
8+
修正:版本兼容问题
9+
修正:RTMP拉流无法修改live名称的问题
10+
11+
added:rtcp parse supported
12+
added:rtp and rtcp udp socket supported
13+
added:rtsp play supported
14+
modify:client method name to client rtsp
15+
modify:httptask added http hdr list parament
16+
fixed:xengine v8.20 complie error
17+
fixed:the problem that the live of rtmp pull stream cannot be modified
18+
=======================================================
119
XEngine_StreamMedia V2.4.0.1001
220

321
增加:http ts播放流支持

README.en.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Publish Stream:
2828
| -------- | --------- | -------- | -------- |
2929
| RTMP | H264,H265 | AAC | Completed |
3030
| SRT | H264,H265 | AAC | Completed |
31-
| WEBRTC | H264,H265 | AAC | Not Start |
31+
| WEBRTC | H264,H265 | AAC | Process |
3232
| GB28181 | H264,H265 | AAC | Not Start |
3333
| JT1078 | H264,H265 | AAC | Completed |
3434
| XStream | H264,H265 | AAC | Completed |
@@ -38,7 +38,7 @@ Play Stream:
3838
| ProtocolName | VideoCodec | AudioCodec | Status |
3939
| -------- | --------- | -------- | -------- |
4040
| RTMP | H264 | AAC | Completed |
41-
| RTSP | H264,H265 | AAC | Process |
41+
| RTSP | H264 | AAC | Completed |
4242
| TS | H264,H265 | AAC | Process |
4343
| SRT | H264,H265 | AAC | Completed |
4444
| WEBRTC | H264,H265 | AAC | Not Start |
@@ -102,6 +102,7 @@ xstream://127.0.0.1:5601
102102

103103
#### Pull Stream
104104
http://127.0.0.1:5600/api?stream=play&sms=live/qyt&type=flv(http-flv)
105+
rtsp://127.0.0.1:5600/api?stream=play&sms=live/qyt&type=rtsp
105106
rtmp://127.0.0.1/live/qyt
106107
srt://127.0.0.1:5603?streamid=#!::r=live/qyt,m=request
107108
http://127.0.0.1:5601?api?stream=play&sms=live/qyt&type=xstream(http-xstream)

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ c c++ streammedia server
3131
| -------- | --------- | -------- | -------- |
3232
| RTMP | H264,H265 | AAC | 已完成 |
3333
| SRT | H264,H265 | AAC | 已完成 |
34-
| WEBRTC | H264,H265 | AAC | 未开始 |
34+
| WEBRTC | H264,H265 | AAC | 进行中 |
3535
| GB28181 | H264,H265 | AAC | 未开始 |
3636
| JT1078 | H264,H265 | AAC | 已完成 |
3737
| XStream | H264,H265 | AAC | 已完成 |
@@ -41,7 +41,7 @@ c c++ streammedia server
4141
| 协议名称 | 视频格式 | 音频格式 | 当前状态 |
4242
| -------- | --------- | -------- | -------- |
4343
| RTMP | H264 | AAC | 已完成 |
44-
| RTSP | H264,H265 | AAC | 进行中 |
44+
| RTSP | H264 | AAC | 已完成 |
4545
| TS | H264,H265 | AAC | 进行中 |
4646
| SRT | H264,H265 | AAC | 已完成 |
4747
| WEBRTC | H264,H265 | AAC | 未开始 |
@@ -111,6 +111,7 @@ xstream://127.0.0.1:5601
111111

112112
#### 拉流示例
113113
http://127.0.0.1:5600/api?stream=play&sms=live/qyt&type=flv(http-flv)
114+
rtsp://127.0.0.1:5600/api?stream=play&sms=live/qyt&type=rtsp
114115
rtmp://127.0.0.1/live/qyt
115116
srt://127.0.0.1:5603?streamid=#!::r=live/qyt,m=request
116117
http://127.0.0.1:5601?api?stream=play&sms=live/qyt&type=xstream(http-xstream)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#ifdef _MSC_BUILD
2+
#pragma comment(lib,"Ws2_32")
3+
#pragma comment(lib,"srt")
4+
#endif
5+
#include <stdio.h>
6+
#include <stdlib.h>
7+
#include <string.h>
8+
#include <srt/srt.h>
9+
#include <XEngine_Include/XEngine_CommHdr.h>
10+
#include <XEngine_Include/XEngine_Types.h>
11+
//需要优先配置XEngine
12+
//WINDOWS使用VS2022 x86 或者 x64 debug 编译
13+
//linux::g++ -std=c++17 -Wall -g APPClient_SRTPull.cpp -o APPClient_SRTPull.exe -lsrt
14+
//macos::g++ -std=c++17 -Wall -g APPClient_SRTPull.cpp -o APPClient_SRTPull.exe -lsrt
15+
FILE* pSt_File;
16+
17+
int nPort = 10080;
18+
LPCXSTR lpszServiceAddr = _X("10.0.3.155");
19+
20+
int main()
21+
{
22+
srt_startup();
23+
srt_setloglevel(srt_logging::LogLevel::error);
24+
25+
struct sockaddr_in st_SockAddr;
26+
27+
st_SockAddr.sin_family = AF_INET;
28+
st_SockAddr.sin_port = htons(nPort);
29+
if (inet_pton(AF_INET, lpszServiceAddr, &st_SockAddr.sin_addr) != 1)
30+
{
31+
return 1;
32+
}
33+
pSt_File = fopen("D:\\XEngine_StreamMedia\\XEngine_APPClient\\Debug\\1.ts", "wb");
34+
35+
SRTSOCKET hSocket = srt_create_socket();
36+
if (SRT_INVALID_SOCK == hSocket)
37+
{
38+
printf("srt_socket:%s\n", srt_getlasterror_str());
39+
return 0;
40+
}
41+
SRT_TRANSTYPE nType = SRTT_LIVE;
42+
srt_setsockopt(hSocket, 0, SRTO_TRANSTYPE, &nType, sizeof(nType));
43+
44+
const char* lpszMsgBuffer = "#!::r=live/livestream,m=request";
45+
if (SRT_ERROR == srt_setsockflag(hSocket, SRTO_STREAMID, lpszMsgBuffer, strlen(lpszMsgBuffer)))
46+
{
47+
printf("srt_setsockflag:%s\n", srt_getlasterror_str());
48+
return 0;
49+
}
50+
51+
int nLatency = 0;
52+
if (SRT_ERROR == srt_setsockflag(hSocket, SRTO_LATENCY, &nLatency, sizeof(int)))
53+
{
54+
printf("srt_setsockflag:%s\n", srt_getlasterror_str());
55+
return 0;
56+
}
57+
if (SRT_ERROR == srt_connect(hSocket, (struct sockaddr*)&st_SockAddr, sizeof st_SockAddr))
58+
{
59+
printf("srt_connect:%s\n", srt_getlasterror_str());
60+
return 0;
61+
}
62+
63+
int nTimeStart = time(NULL);
64+
while (true)
65+
{
66+
int nTimeEnd = time(NULL);
67+
char tszMsgBuffer[2048];
68+
69+
int ret = srt_recvmsg(hSocket, tszMsgBuffer, sizeof(tszMsgBuffer));
70+
if (SRT_ERROR != ret)
71+
{
72+
fwrite(tszMsgBuffer, 1, ret, pSt_File);
73+
}
74+
75+
if (nTimeEnd - nTimeStart > 20)
76+
{
77+
break;
78+
}
79+
}
80+
srt_close(hSocket);
81+
srt_cleanup();
82+
return 0;
83+
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|Win32">
9+
<Configuration>Release</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|x64">
13+
<Configuration>Debug</Configuration>
14+
<Platform>x64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<VCProjectVersion>16.0</VCProjectVersion>
23+
<Keyword>Win32Proj</Keyword>
24+
<ProjectGuid>{cb0fa700-6bc1-45cc-8090-74b498e37a4b}</ProjectGuid>
25+
<RootNamespace>APPClientSRTPull</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
</PropertyGroup>
28+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
29+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
30+
<ConfigurationType>Application</ConfigurationType>
31+
<UseDebugLibraries>true</UseDebugLibraries>
32+
<PlatformToolset>v143</PlatformToolset>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<ConfigurationType>Application</ConfigurationType>
37+
<UseDebugLibraries>false</UseDebugLibraries>
38+
<PlatformToolset>v143</PlatformToolset>
39+
<WholeProgramOptimization>true</WholeProgramOptimization>
40+
<CharacterSet>Unicode</CharacterSet>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
43+
<ConfigurationType>Application</ConfigurationType>
44+
<UseDebugLibraries>true</UseDebugLibraries>
45+
<PlatformToolset>v143</PlatformToolset>
46+
<CharacterSet>Unicode</CharacterSet>
47+
</PropertyGroup>
48+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<ConfigurationType>Application</ConfigurationType>
50+
<UseDebugLibraries>false</UseDebugLibraries>
51+
<PlatformToolset>v143</PlatformToolset>
52+
<WholeProgramOptimization>true</WholeProgramOptimization>
53+
<CharacterSet>Unicode</CharacterSet>
54+
</PropertyGroup>
55+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
56+
<ImportGroup Label="ExtensionSettings">
57+
</ImportGroup>
58+
<ImportGroup Label="Shared">
59+
</ImportGroup>
60+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
61+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+
</ImportGroup>
63+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
67+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+
</ImportGroup>
69+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
71+
</ImportGroup>
72+
<PropertyGroup Label="UserMacros" />
73+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+
<IncludePath>$(XEngine_Include);$(IncludePath)</IncludePath>
75+
<LibraryPath>$(XEngine_Lib32);$(LibraryPath)</LibraryPath>
76+
</PropertyGroup>
77+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
78+
<ClCompile>
79+
<WarningLevel>Level3</WarningLevel>
80+
<SDLCheck>true</SDLCheck>
81+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
82+
<ConformanceMode>true</ConformanceMode>
83+
</ClCompile>
84+
<Link>
85+
<SubSystem>Console</SubSystem>
86+
<GenerateDebugInformation>true</GenerateDebugInformation>
87+
</Link>
88+
</ItemDefinitionGroup>
89+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
90+
<ClCompile>
91+
<WarningLevel>Level3</WarningLevel>
92+
<FunctionLevelLinking>true</FunctionLevelLinking>
93+
<IntrinsicFunctions>true</IntrinsicFunctions>
94+
<SDLCheck>true</SDLCheck>
95+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
<ConformanceMode>true</ConformanceMode>
97+
</ClCompile>
98+
<Link>
99+
<SubSystem>Console</SubSystem>
100+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
101+
<OptimizeReferences>true</OptimizeReferences>
102+
<GenerateDebugInformation>true</GenerateDebugInformation>
103+
</Link>
104+
</ItemDefinitionGroup>
105+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
106+
<ClCompile>
107+
<WarningLevel>Level3</WarningLevel>
108+
<SDLCheck>true</SDLCheck>
109+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
110+
<ConformanceMode>true</ConformanceMode>
111+
</ClCompile>
112+
<Link>
113+
<SubSystem>Console</SubSystem>
114+
<GenerateDebugInformation>true</GenerateDebugInformation>
115+
</Link>
116+
</ItemDefinitionGroup>
117+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
118+
<ClCompile>
119+
<WarningLevel>Level3</WarningLevel>
120+
<FunctionLevelLinking>true</FunctionLevelLinking>
121+
<IntrinsicFunctions>true</IntrinsicFunctions>
122+
<SDLCheck>true</SDLCheck>
123+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
124+
<ConformanceMode>true</ConformanceMode>
125+
</ClCompile>
126+
<Link>
127+
<SubSystem>Console</SubSystem>
128+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
129+
<OptimizeReferences>true</OptimizeReferences>
130+
<GenerateDebugInformation>true</GenerateDebugInformation>
131+
</Link>
132+
</ItemDefinitionGroup>
133+
<ItemGroup>
134+
<ClCompile Include="APPClient_SRTPull.cpp" />
135+
</ItemGroup>
136+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
137+
<ImportGroup Label="ExtensionTargets">
138+
</ImportGroup>
139+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="源文件">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="头文件">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
<Filter Include="资源文件">
13+
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+
</Filter>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<ClCompile Include="APPClient_SRTPull.cpp">
19+
<Filter>源文件</Filter>
20+
</ClCompile>
21+
</ItemGroup>
22+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup />
4+
</Project>

XEngine_Docment/Docment_en.docx

-208 Bytes
Binary file not shown.

XEngine_Docment/Docment_zh.docx

-36 Bytes
Binary file not shown.

XEngine_Release/XEngine_Config/XEngine_Config.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"XPull":{
2828
"XStream":{
29-
"bEnable":false
29+
"bEnable":true
3030
},
3131
"RTMP":{
3232
"bEnable":true
@@ -35,7 +35,11 @@
3535
"bEnable":true
3636
},
3737
"RTSP":{
38-
"bEnable":false
38+
"bEnable":true,
39+
"nVRTPPort":56001,
40+
"nVRTCPPort":56002,
41+
"nARTPPort":56003,
42+
"nARTCPPort":56004
3943
},
4044
"HLS":{
4145
"bEnable":false
@@ -47,6 +51,7 @@
4751
"LogLeave":32
4852
},
4953
"XVer":[
54+
"V2.5.0.1001 Build20231222",
5055
"V2.4.0.1001 Build20231026",
5156
"V2.3.0.1001 Build20231007",
5257
"V2.2.0.1001 Build20230804",

0 commit comments

Comments
 (0)