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
a3c482c1
Commit
a3c482c1
authored
5 years ago
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加shell相关代码
parent
4e0919d1
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
22 行增加
和
0 行删除
+22
-0
api/include/common.h
+7
-0
api/source/common.cpp
+14
-0
api/tests/server.cpp
+1
-0
没有找到文件。
api/include/common.h
查看文件 @
a3c482c1
...
@@ -133,6 +133,13 @@ API_EXPORT uint16_t API_CALL mk_rtmp_server_start(uint16_t port, int ssl);
...
@@ -133,6 +133,13 @@ API_EXPORT uint16_t API_CALL mk_rtmp_server_start(uint16_t port, int ssl);
API_EXPORT
uint16_t
API_CALL
mk_rtp_server_start
(
uint16_t
port
);
API_EXPORT
uint16_t
API_CALL
mk_rtp_server_start
(
uint16_t
port
);
/**
/**
* 创建shell服务器
* @param port shell监听端口
* @return 0:失败,非0:端口号
*/
API_EXPORT
uint16_t
API_CALL
mk_shell_server_start
(
uint16_t
port
);
/**
* 打印日志
* 打印日志
* @param level 日志级别,支持0~4
* @param level 日志级别,支持0~4
* @param file __FILE__
* @param file __FILE__
...
...
This diff is collapsed.
Click to expand it.
api/source/common.cpp
查看文件 @
a3c482c1
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#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 "Shell/ShellSession.h"
using
namespace
std
;
using
namespace
std
;
using
namespace
toolkit
;
using
namespace
toolkit
;
using
namespace
mediakit
;
using
namespace
mediakit
;
...
@@ -42,6 +43,7 @@ using namespace mediakit;
...
@@ -42,6 +43,7 @@ using namespace mediakit;
static
TcpServer
::
Ptr
rtsp_server
[
2
];
static
TcpServer
::
Ptr
rtsp_server
[
2
];
static
TcpServer
::
Ptr
rtmp_server
[
2
];
static
TcpServer
::
Ptr
rtmp_server
[
2
];
static
TcpServer
::
Ptr
http_server
[
2
];
static
TcpServer
::
Ptr
http_server
[
2
];
static
TcpServer
::
Ptr
shell_server
;
#ifdef ENABLE_RTPPROXY
#ifdef ENABLE_RTPPROXY
#include "Rtp/UdpRecver.h"
#include "Rtp/UdpRecver.h"
...
@@ -190,6 +192,18 @@ API_EXPORT uint16_t API_CALL mk_rtp_server_start(uint16_t port){
...
@@ -190,6 +192,18 @@ API_EXPORT uint16_t API_CALL mk_rtp_server_start(uint16_t port){
#endif
#endif
}
}
API_EXPORT
uint16_t
API_CALL
mk_shell_server_start
(
uint16_t
port
){
try
{
shell_server
=
std
::
make_shared
<
TcpServer
>
();
shell_server
->
start
<
ShellSession
>
(
port
);
return
shell_server
->
getPort
();
}
catch
(
std
::
exception
&
ex
)
{
shell_server
.
reset
();
WarnL
<<
ex
.
what
();
return
0
;
}
}
API_EXPORT
void
API_CALL
mk_log_printf
(
int
level
,
const
char
*
file
,
const
char
*
function
,
int
line
,
const
char
*
fmt
,
...)
{
API_EXPORT
void
API_CALL
mk_log_printf
(
int
level
,
const
char
*
file
,
const
char
*
function
,
int
line
,
const
char
*
fmt
,
...)
{
assert
(
file
&&
function
&&
fmt
);
assert
(
file
&&
function
&&
fmt
);
LogContextCapturer
info
(
Logger
::
Instance
(),
(
LogLevel
)
level
,
file
,
function
,
line
);
LogContextCapturer
info
(
Logger
::
Instance
(),
(
LogLevel
)
level
,
file
,
function
,
line
);
...
...
This diff is collapsed.
Click to expand it.
api/tests/server.cpp
查看文件 @
a3c482c1
...
@@ -396,6 +396,7 @@ int main(int argc, char *argv[]) {
...
@@ -396,6 +396,7 @@ int main(int argc, char *argv[]) {
mk_http_server_start
(
80
,
false
);
mk_http_server_start
(
80
,
false
);
mk_rtsp_server_start
(
554
,
false
);
mk_rtsp_server_start
(
554
,
false
);
mk_rtmp_server_start
(
1935
,
false
);
mk_rtmp_server_start
(
1935
,
false
);
mk_shell_server_start
(
9000
);
mk_rtp_server_start
(
10000
);
mk_rtp_server_start
(
10000
);
mk_events
events
=
{
mk_events
events
=
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论