Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
3fa3f1e4
Commit
3fa3f1e4
authored
7 years ago
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d27f7107
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
19 行增加
和
6 行删除
+19
-6
CMakeLists.txt
+1
-3
tests/test_server.cpp
+18
-3
没有找到文件。
CMakeLists.txt
查看文件 @
3fa3f1e4
...
@@ -78,9 +78,7 @@ add_definitions(-DENABLE_RTMP2RTSP -DENABLE_RTSP2RTMP -DENABLE_HLS)
...
@@ -78,9 +78,7 @@ add_definitions(-DENABLE_RTMP2RTSP -DENABLE_RTSP2RTMP -DENABLE_HLS)
include_directories
(
${
PROJECT_SOURCE_DIR
}
/src
)
include_directories
(
${
PROJECT_SOURCE_DIR
}
/src
)
#使能c++11
#使能c++11
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
CMAKE_CXX_FLAGS
"-std=c++11
${
CMAKE_CXX_FLAGS
}
"
)
add_compile_options
(
-std=c++11
)
endif
(
CMAKE_COMPILER_IS_GNUCXX
)
#关闭过期接口警告
#关闭过期接口警告
add_compile_options
(
-Wno-deprecated-declarations
)
add_compile_options
(
-Wno-deprecated-declarations
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_server.cpp
查看文件 @
3fa3f1e4
...
@@ -12,9 +12,12 @@
...
@@ -12,9 +12,12 @@
#include "Rtsp/RtspSession.h"
#include "Rtsp/RtspSession.h"
#include "Rtmp/RtmpSession.h"
#include "Rtmp/RtmpSession.h"
#include "Http/HttpSession.h"
#include "Http/HttpSession.h"
#include "Http/HttpsSession.h"
#ifdef ENABLE_OPENSSL
#include "Util/SSLBox.h"
#include "Util/SSLBox.h"
#include "Util/SqlPool.h"
#include "Http/HttpsSession.h"
#endif//ENABLE_OPENSSL
#include "Util/logger.h"
#include "Util/logger.h"
#include "Util/onceToken.h"
#include "Util/onceToken.h"
#include "Util/File.h"
#include "Util/File.h"
...
@@ -50,6 +53,8 @@ int main(int argc,char *argv[]){
...
@@ -50,6 +53,8 @@ int main(int argc,char *argv[]){
player
->
play
(
url
);
player
->
play
(
url
);
proxyMap
.
emplace
(
string
(
url
),
player
);
proxyMap
.
emplace
(
string
(
url
),
player
);
}
}
#ifdef ENABLE_OPENSSL
//请把证书"test_server.pem"放置在本程序可执行程序同目录下
//请把证书"test_server.pem"放置在本程序可执行程序同目录下
try
{
try
{
SSL_Initor
::
Instance
().
loadServerPem
((
exePath
()
+
".pem"
).
data
());
SSL_Initor
::
Instance
().
loadServerPem
((
exePath
()
+
".pem"
).
data
());
...
@@ -57,22 +62,32 @@ int main(int argc,char *argv[]){
...
@@ -57,22 +62,32 @@ int main(int argc,char *argv[]){
FatalL
<<
"请把证书:"
<<
(
exeName
()
+
".pem"
)
<<
"放置在本程序可执行程序同目录下:"
<<
exeDir
()
<<
endl
;
FatalL
<<
"请把证书:"
<<
(
exeName
()
+
".pem"
)
<<
"放置在本程序可执行程序同目录下:"
<<
exeDir
()
<<
endl
;
return
0
;
return
0
;
}
}
#endif //ENABLE_OPENSSL
TcpServer
<
RtspSession
>::
Ptr
rtspSrv
(
new
TcpServer
<
RtspSession
>
());
TcpServer
<
RtspSession
>::
Ptr
rtspSrv
(
new
TcpServer
<
RtspSession
>
());
TcpServer
<
RtmpSession
>::
Ptr
rtmpSrv
(
new
TcpServer
<
RtmpSession
>
());
TcpServer
<
RtmpSession
>::
Ptr
rtmpSrv
(
new
TcpServer
<
RtmpSession
>
());
TcpServer
<
HttpSession
>::
Ptr
httpSrv
(
new
TcpServer
<
HttpSession
>
());
TcpServer
<
HttpSession
>::
Ptr
httpSrv
(
new
TcpServer
<
HttpSession
>
());
TcpServer
<
HttpsSession
>::
Ptr
httpsSrv
(
new
TcpServer
<
HttpsSession
>
());
rtspSrv
->
start
(
mINI
::
Instance
()[
Config
::
Rtsp
::
kPort
]);
rtspSrv
->
start
(
mINI
::
Instance
()[
Config
::
Rtsp
::
kPort
]);
rtmpSrv
->
start
(
mINI
::
Instance
()[
Config
::
Rtmp
::
kPort
]);
rtmpSrv
->
start
(
mINI
::
Instance
()[
Config
::
Rtmp
::
kPort
]);
httpSrv
->
start
(
mINI
::
Instance
()[
Config
::
Http
::
kPort
]);
httpSrv
->
start
(
mINI
::
Instance
()[
Config
::
Http
::
kPort
]);
#ifdef ENABLE_OPENSSL
TcpServer
<
HttpsSession
>::
Ptr
httpsSrv
(
new
TcpServer
<
HttpsSession
>
());
httpsSrv
->
start
(
mINI
::
Instance
()[
Config
::
Http
::
kSSLPort
]);
httpsSrv
->
start
(
mINI
::
Instance
()[
Config
::
Http
::
kSSLPort
]);
#endif //ENABLE_OPENSSL
EventPoller
::
Instance
().
runLoop
();
EventPoller
::
Instance
().
runLoop
();
rtspSrv
.
reset
();
rtspSrv
.
reset
();
rtmpSrv
.
reset
();
rtmpSrv
.
reset
();
httpSrv
.
reset
();
httpSrv
.
reset
();
#ifdef ENABLE_OPENSSL
httpsSrv
.
reset
();
httpsSrv
.
reset
();
#endif //ENABLE_OPENSSL
UDPServer
::
Destory
();
UDPServer
::
Destory
();
WorkThreadPool
::
Destory
();
WorkThreadPool
::
Destory
();
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论