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
0948a3df
Unverified
Commit
0948a3df
authored
Sep 03, 2022
by
PioLing
Committed by
GitHub
Sep 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持在addStreamProxy和on_publish中控制单个流是否开启时间戳覆盖 (#1930)
parent
aa6581c2
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
17 行增加
和
4 行删除
+17
-4
postman/ZLMediaKit.postman_collection.json
+6
-0
server/WebApi.cpp
+1
-0
server/WebHook.cpp
+3
-0
src/Common/MultiMediaSourceMuxer.cpp
+4
-4
src/Common/MultiMediaSourceMuxer.h
+3
-0
没有找到文件。
postman/ZLMediaKit.postman_collection.json
查看文件 @
0948a3df
...
@@ -578,6 +578,12 @@
...
@@ -578,6 +578,12 @@
"value"
:
null
,
"value"
:
null
,
"description"
:
"hls保存根目录,置空使用默认目录"
,
"description"
:
"hls保存根目录,置空使用默认目录"
,
"disabled"
:
true
"disabled"
:
true
},
{
"key"
:
"modify_stamp"
,
"value"
:
null
,
"description"
:
"是否重新计算时间戳"
,
"disabled"
:
true
}
}
]
]
}
}
...
...
server/WebApi.cpp
查看文件 @
0948a3df
...
@@ -1007,6 +1007,7 @@ void installWebApi() {
...
@@ -1007,6 +1007,7 @@ void installWebApi() {
getArgsValue
(
allArgs
,
"mp4_save_path"
,
option
.
mp4_save_path
);
getArgsValue
(
allArgs
,
"mp4_save_path"
,
option
.
mp4_save_path
);
getArgsValue
(
allArgs
,
"mp4_max_second"
,
option
.
mp4_max_second
);
getArgsValue
(
allArgs
,
"mp4_max_second"
,
option
.
mp4_max_second
);
getArgsValue
(
allArgs
,
"hls_save_path"
,
option
.
hls_save_path
);
getArgsValue
(
allArgs
,
"hls_save_path"
,
option
.
hls_save_path
);
getArgsValue
(
allArgs
,
"modify_stamp"
,
option
.
modify_stamp
);
addStreamProxy
(
allArgs
[
"vhost"
],
addStreamProxy
(
allArgs
[
"vhost"
],
allArgs
[
"app"
],
allArgs
[
"app"
],
...
...
server/WebHook.cpp
查看文件 @
0948a3df
...
@@ -353,6 +353,9 @@ void installWebHook(){
...
@@ -353,6 +353,9 @@ void installWebHook(){
if
(
obj
.
isMember
(
"mp4_as_player"
))
{
if
(
obj
.
isMember
(
"mp4_as_player"
))
{
option
.
mp4_as_player
=
obj
[
"mp4_as_player"
].
asBool
();
option
.
mp4_as_player
=
obj
[
"mp4_as_player"
].
asBool
();
}
}
if
(
obj
.
isMember
(
"modify_stamp"
))
{
option
.
modify_stamp
=
obj
[
"modify_stamp"
].
asBool
();
}
invoker
(
err
,
option
);
invoker
(
err
,
option
);
}
else
{
}
else
{
//推流鉴权失败
//推流鉴权失败
...
...
src/Common/MultiMediaSourceMuxer.cpp
查看文件 @
0948a3df
...
@@ -28,6 +28,7 @@ ProtocolOption::ProtocolOption() {
...
@@ -28,6 +28,7 @@ ProtocolOption::ProtocolOption() {
GET_CONFIG
(
bool
,
s_add_mute_audio
,
General
::
kAddMuteAudio
);
GET_CONFIG
(
bool
,
s_add_mute_audio
,
General
::
kAddMuteAudio
);
GET_CONFIG
(
bool
,
s_mp4_as_player
,
Record
::
kMP4AsPlayer
);
GET_CONFIG
(
bool
,
s_mp4_as_player
,
Record
::
kMP4AsPlayer
);
GET_CONFIG
(
uint32_t
,
s_continue_push_ms
,
General
::
kContinuePushMS
);
GET_CONFIG
(
uint32_t
,
s_continue_push_ms
,
General
::
kContinuePushMS
);
GET_CONFIG
(
bool
,
s_modify_stamp
,
General
::
kModifyStamp
);
enable_hls
=
s_to_hls
;
enable_hls
=
s_to_hls
;
enable_mp4
=
s_to_mp4
;
enable_mp4
=
s_to_mp4
;
...
@@ -35,6 +36,7 @@ ProtocolOption::ProtocolOption() {
...
@@ -35,6 +36,7 @@ ProtocolOption::ProtocolOption() {
add_mute_audio
=
s_add_mute_audio
;
add_mute_audio
=
s_add_mute_audio
;
continue_push_ms
=
s_continue_push_ms
;
continue_push_ms
=
s_continue_push_ms
;
mp4_as_player
=
s_mp4_as_player
;
mp4_as_player
=
s_mp4_as_player
;
modify_stamp
=
s_modify_stamp
;
}
}
static
std
::
shared_ptr
<
MediaSinkInterface
>
makeRecorder
(
MediaSource
&
sender
,
const
vector
<
Track
::
Ptr
>
&
tracks
,
Recorder
::
type
type
,
const
string
&
custom_path
,
size_t
max_second
){
static
std
::
shared_ptr
<
MediaSinkInterface
>
makeRecorder
(
MediaSource
&
sender
,
const
vector
<
Track
::
Ptr
>
&
tracks
,
Recorder
::
type
type
,
const
string
&
custom_path
,
size_t
max_second
){
...
@@ -401,9 +403,8 @@ void MultiMediaSourceMuxer::resetTracks() {
...
@@ -401,9 +403,8 @@ void MultiMediaSourceMuxer::resetTracks() {
}
}
bool
MultiMediaSourceMuxer
::
onTrackFrame
(
const
Frame
::
Ptr
&
frame_in
)
{
bool
MultiMediaSourceMuxer
::
onTrackFrame
(
const
Frame
::
Ptr
&
frame_in
)
{
GET_CONFIG
(
bool
,
modify_stamp
,
General
::
kModifyStamp
);
auto
frame
=
frame_in
;
auto
frame
=
frame_in
;
if
(
modify_stamp
)
{
if
(
_option
.
modify_stamp
)
{
//开启了时间戳覆盖
//开启了时间戳覆盖
frame
=
std
::
make_shared
<
FrameStamp
>
(
frame
,
_stamp
[
frame
->
getTrackType
()],
true
);
frame
=
std
::
make_shared
<
FrameStamp
>
(
frame
,
_stamp
[
frame
->
getTrackType
()],
true
);
}
}
...
@@ -471,4 +472,4 @@ bool MultiMediaSourceMuxer::isEnabled(){
...
@@ -471,4 +472,4 @@ bool MultiMediaSourceMuxer::isEnabled(){
return
_is_enable
;
return
_is_enable
;
}
}
}
//
namespace
mediakit
}
//namespace mediakit
\ No newline at end of file
src/Common/MultiMediaSourceMuxer.h
查看文件 @
0948a3df
...
@@ -57,6 +57,9 @@ public:
...
@@ -57,6 +57,9 @@ public:
//断连续推延时,单位毫秒,默认采用配置文件
//断连续推延时,单位毫秒,默认采用配置文件
uint32_t
continue_push_ms
;
uint32_t
continue_push_ms
;
//时间戳修复这一路流标志位
bool
modify_stamp
;
};
};
class
MultiMediaSourceMuxer
:
public
MediaSourceEventInterceptor
,
public
MediaSink
,
public
std
::
enable_shared_from_this
<
MultiMediaSourceMuxer
>
{
class
MultiMediaSourceMuxer
:
public
MediaSourceEventInterceptor
,
public
MediaSink
,
public
std
::
enable_shared_from_this
<
MultiMediaSourceMuxer
>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论