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
be5d98b9
Commit
be5d98b9
authored
Dec 18, 2019
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加mk_rtp_server_start接口
parent
d342cc3a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
36 行增加
和
2 行删除
+36
-2
api/include/common.h
+7
-0
api/include/httpdownloader.h
+0
-1
api/include/proxyplayer.h
+0
-1
api/source/common.cpp
+29
-0
没有找到文件。
api/include/common.h
查看文件 @
be5d98b9
...
...
@@ -103,6 +103,13 @@ API_EXPORT uint16_t API_CALL mk_rtsp_server_start(uint16_t port, int ssl);
API_EXPORT
uint16_t
API_CALL
mk_rtmp_server_start
(
uint16_t
port
,
int
ssl
);
/**
* 创建rtp服务器
* @param port rtp监听端口(包括udp/tcp)
* @return 0:失败,非0:端口号
*/
API_EXPORT
uint16_t
API_CALL
mk_rtp_server_start
(
uint16_t
port
);
/**
* 打印日志
* @param level 日志级别,支持0~4
* @param file __FILE__
...
...
api/include/httpdownloader.h
查看文件 @
be5d98b9
...
...
@@ -65,7 +65,6 @@ API_EXPORT void API_CALL mk_http_downloader_release(mk_http_downloader ctx);
*/
API_EXPORT
void
API_CALL
mk_http_downloader_start
(
mk_http_downloader
ctx
,
const
char
*
url
,
const
char
*
file
,
on_mk_download_complete
cb
,
void
*
user_data
);
#ifdef __cplusplus
}
#endif
...
...
api/include/proxyplayer.h
查看文件 @
be5d98b9
...
...
@@ -53,7 +53,6 @@ API_EXPORT mk_proxy_player API_CALL mk_proxy_player_create(const char *vhost, co
*/
API_EXPORT
void
API_CALL
mk_proxy_player_release
(
mk_proxy_player
ctx
);
/**
* 设置代理播放器配置选项
* @param ctx 代理播放器指针
...
...
api/source/common.cpp
查看文件 @
be5d98b9
...
...
@@ -43,6 +43,13 @@ static TcpServer::Ptr rtsp_server[2];
static
TcpServer
::
Ptr
rtmp_server
[
2
];
static
TcpServer
::
Ptr
http_server
[
2
];
#ifdef ENABLE_RTPPROXY
#include "Rtp/UdpRecver.h"
#include "Rtp/RtpSession.h"
static
std
::
shared_ptr
<
UdpRecver
>
udpRtpServer
;
static
TcpServer
::
Ptr
tcpRtpServer
(
new
TcpServer
());
#endif
//////////////////////////environment init///////////////////////////
API_EXPORT
void
API_CALL
mk_env_init
(
const
config
*
cfg
)
{
assert
(
cfg
);
...
...
@@ -129,6 +136,28 @@ 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
){
#ifdef ENABLE_RTPPROXY
try
{
//创建rtp tcp服务器
tcpRtpServer
->
start
<
RtpSession
>
(
port
);
auto
ret
=
tcpRtpServer
->
getPort
();
udpRtpServer
=
std
::
make_shared
<
UdpRecver
>
();
//创建rtp udp服务器
udpRtpServer
->
initSock
(
port
);
return
ret
;
}
catch
(
std
::
exception
&
ex
)
{
tcpRtpServer
.
reset
();
udpRtpServer
.
reset
();
WarnL
<<
ex
.
what
();
return
0
;
}
#else
WarnL
<<
"未启用该功能!"
;
return
0
;
#endif
}
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
);
LogContextCapturer
info
(
Logger
::
Instance
(),
(
LogLevel
)
level
,
file
,
function
,
line
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论