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
99dda48b
Commit
99dda48b
authored
Jun 24, 2019
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FFmpeg超时时间与hook超时时间关联
parent
276aa1a4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
17 行删除
+21
-17
server/WebApi.cpp
+6
-3
server/WebHook.cpp
+15
-14
没有找到文件。
server/WebApi.cpp
查看文件 @
99dda48b
...
...
@@ -44,6 +44,7 @@
#include "Player/PlayerProxy.h"
#include "Util/MD5.h"
#include "WebApi.h"
#include "WebHook.h"
#if !defined(_WIN32)
#include "FFmpegSource.h"
...
...
@@ -88,8 +89,8 @@ typedef enum {
}
ApiErr
;
#define API_FIELD "api."
const
char
kApiDebug
[]
=
API_FIELD
"apiDebug"
;
const
char
kSecret
[]
=
API_FIELD
"secret"
;
const
string
kApiDebug
=
API_FIELD
"apiDebug"
;
const
string
kSecret
=
API_FIELD
"secret"
;
static
onceToken
token
([]()
{
mINI
::
Instance
()[
kApiDebug
]
=
"1"
;
...
...
@@ -617,6 +618,8 @@ void installWebApi() {
CHECK_ARGS
(
"vhost"
,
"app"
,
"stream"
);
//通过FFmpeg按需拉流
GET_CONFIG
(
int
,
rtmp_port
,
Rtmp
::
kPort
);
GET_CONFIG
(
int
,
timeout_sec
,
Hook
::
kTimeoutSec
);
string
dst_url
=
StrPrinter
<<
"rtmp://127.0.0.1:"
<<
rtmp_port
<<
"/"
...
...
@@ -626,7 +629,7 @@ void installWebApi() {
addFFmepgSource
(
"http://live.hkstv.hk.lxdns.com/live/hks2/playlist.m3u8"
,
/** ffmpeg拉流支持任意编码格式任意协议 **/
dst_url
,
100
00
,
(
1000
*
timeout_sec
)
-
5
00
,
[
invoker
,
val
,
headerOut
](
const
SockException
&
ex
,
const
string
&
key
){
if
(
ex
){
const_cast
<
Value
&>
(
val
)[
"code"
]
=
API
::
OtherFailed
;
...
...
server/WebHook.cpp
查看文件 @
99dda48b
...
...
@@ -38,6 +38,7 @@
#include "Network/TcpSession.h"
#include "Rtsp/RtspSession.h"
#include "Http/HttpSession.h"
#include "WebHook.h"
using
namespace
Json
;
using
namespace
toolkit
;
...
...
@@ -57,20 +58,20 @@ typedef HttpArgs ArgsType;
namespace
Hook
{
#define HOOK_FIELD "hook."
const
char
kEnable
[]
=
HOOK_FIELD
"enable"
;
const
char
kTimeoutSec
[]
=
HOOK_FIELD
"timeoutSec"
;
const
char
kOnPublish
[]
=
HOOK_FIELD
"on_publish"
;
const
char
kOnPlay
[]
=
HOOK_FIELD
"on_play"
;
const
char
kOnFlowReport
[]
=
HOOK_FIELD
"on_flow_report"
;
const
char
kOnRtspRealm
[]
=
HOOK_FIELD
"on_rtsp_realm"
;
const
char
kOnRtspAuth
[]
=
HOOK_FIELD
"on_rtsp_auth"
;
const
char
kOnStreamChanged
[]
=
HOOK_FIELD
"on_stream_changed"
;
const
char
kOnStreamNotFound
[]
=
HOOK_FIELD
"on_stream_not_found"
;
const
char
kOnRecordMp4
[]
=
HOOK_FIELD
"on_record_mp4"
;
const
char
kOnShellLogin
[]
=
HOOK_FIELD
"on_shell_login"
;
const
char
kOnStreamNoneReader
[]
=
HOOK_FIELD
"on_stream_none_reader"
;
const
char
kOnHttpAccess
[]
=
HOOK_FIELD
"on_http_access"
;
const
char
kAdminParams
[]
=
HOOK_FIELD
"admin_params"
;
const
string
kEnable
=
HOOK_FIELD
"enable"
;
const
string
kTimeoutSec
=
HOOK_FIELD
"timeoutSec"
;
const
string
kOnPublish
=
HOOK_FIELD
"on_publish"
;
const
string
kOnPlay
=
HOOK_FIELD
"on_play"
;
const
string
kOnFlowReport
=
HOOK_FIELD
"on_flow_report"
;
const
string
kOnRtspRealm
=
HOOK_FIELD
"on_rtsp_realm"
;
const
string
kOnRtspAuth
=
HOOK_FIELD
"on_rtsp_auth"
;
const
string
kOnStreamChanged
=
HOOK_FIELD
"on_stream_changed"
;
const
string
kOnStreamNotFound
=
HOOK_FIELD
"on_stream_not_found"
;
const
string
kOnRecordMp4
=
HOOK_FIELD
"on_record_mp4"
;
const
string
kOnShellLogin
=
HOOK_FIELD
"on_shell_login"
;
const
string
kOnStreamNoneReader
=
HOOK_FIELD
"on_stream_none_reader"
;
const
string
kOnHttpAccess
=
HOOK_FIELD
"on_http_access"
;
const
string
kAdminParams
=
HOOK_FIELD
"admin_params"
;
onceToken
token
([](){
mINI
::
Instance
()[
kEnable
]
=
true
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论