mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
添加 ts 切片是否通知选项, 默认为不通知
This commit is contained in:
parent
188e087fc2
commit
b22a6e3dbd
@ -66,6 +66,8 @@ segDur=2
|
|||||||
segNum=3
|
segNum=3
|
||||||
#HLS切片从m3u8文件中移除后,继续保留在磁盘上的个数
|
#HLS切片从m3u8文件中移除后,继续保留在磁盘上的个数
|
||||||
segRetain=5
|
segRetain=5
|
||||||
|
# 是否广播 ts 切片完成通知
|
||||||
|
broadcastRecordTs=0
|
||||||
|
|
||||||
[hook]
|
[hook]
|
||||||
#在推流时,如果url参数匹对admin_params,那么可以不经过hook鉴权直接推流成功,播放时亦然
|
#在推流时,如果url参数匹对admin_params,那么可以不经过hook鉴权直接推流成功,播放时亦然
|
||||||
@ -83,6 +85,8 @@ on_play=https://127.0.0.1/index/hook/on_play
|
|||||||
on_publish=https://127.0.0.1/index/hook/on_publish
|
on_publish=https://127.0.0.1/index/hook/on_publish
|
||||||
#录制mp4切片完成事件
|
#录制mp4切片完成事件
|
||||||
on_record_mp4=https://127.0.0.1/index/hook/on_record_mp4
|
on_record_mp4=https://127.0.0.1/index/hook/on_record_mp4
|
||||||
|
# 录制 hls ts 切片完成事件
|
||||||
|
on_record_ts=https://127.0.0.1/index/hook/on_record_ts
|
||||||
#rtsp播放鉴权事件,此事件中比对rtsp的用户名密码
|
#rtsp播放鉴权事件,此事件中比对rtsp的用户名密码
|
||||||
on_rtsp_auth=https://127.0.0.1/index/hook/on_rtsp_auth
|
on_rtsp_auth=https://127.0.0.1/index/hook/on_rtsp_auth
|
||||||
#rtsp播放是否开启专属鉴权事件,置空则关闭rtsp鉴权。rtsp播放鉴权还支持url方式鉴权
|
#rtsp播放是否开启专属鉴权事件,置空则关闭rtsp鉴权。rtsp播放鉴权还支持url方式鉴权
|
||||||
|
@ -252,6 +252,8 @@ const string kSegmentRetain = HLS_FIELD"segRetain";
|
|||||||
const string kFileBufSize = HLS_FIELD"fileBufSize";
|
const string kFileBufSize = HLS_FIELD"fileBufSize";
|
||||||
//录制文件路径
|
//录制文件路径
|
||||||
const string kFilePath = HLS_FIELD"filePath";
|
const string kFilePath = HLS_FIELD"filePath";
|
||||||
|
// 是否广播 ts 切片完成通知
|
||||||
|
const string kBroadcastRecordTs = HLS_FIELD"broadcastRecordTs";
|
||||||
|
|
||||||
onceToken token([](){
|
onceToken token([](){
|
||||||
mINI::Instance()[kSegmentDuration] = 2;
|
mINI::Instance()[kSegmentDuration] = 2;
|
||||||
@ -259,6 +261,7 @@ onceToken token([](){
|
|||||||
mINI::Instance()[kSegmentRetain] = 5;
|
mINI::Instance()[kSegmentRetain] = 5;
|
||||||
mINI::Instance()[kFileBufSize] = 64 * 1024;
|
mINI::Instance()[kFileBufSize] = 64 * 1024;
|
||||||
mINI::Instance()[kFilePath] = "./www";
|
mINI::Instance()[kFilePath] = "./www";
|
||||||
|
mINI::Instance()[kBroadcastRecordTs] = false;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
} //namespace Hls
|
} //namespace Hls
|
||||||
|
|
||||||
|
@ -285,6 +285,8 @@ extern const string kSegmentRetain;
|
|||||||
extern const string kFileBufSize;
|
extern const string kFileBufSize;
|
||||||
//录制文件路径
|
//录制文件路径
|
||||||
extern const string kFilePath;
|
extern const string kFilePath;
|
||||||
|
// 是否广播 ts 切片完成通知
|
||||||
|
extern const string kBroadcastRecordTs;
|
||||||
} //namespace Hls
|
} //namespace Hls
|
||||||
|
|
||||||
////////////Rtp代理相关配置///////////
|
////////////Rtp代理相关配置///////////
|
||||||
|
@ -109,14 +109,18 @@ void HlsMakerImp::onWriteHls(const char *data, int len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HlsMakerImp::onFlushLastSegment(uint32_t duration) {
|
void HlsMakerImp::onFlushLastSegment(uint32_t duration) {
|
||||||
auto info = _info;
|
GET_CONFIG(bool, broadcastRecordTs, Hls::kBroadcastRecordTs);
|
||||||
info.ui64TimeLen = duration;
|
|
||||||
WorkThreadPool::Instance().getExecutor()->async([info]() {
|
if (broadcastRecordTs) {
|
||||||
struct stat fileData;
|
auto info = _info;
|
||||||
stat(info.strFilePath.data(), &fileData);
|
info.ui64TimeLen = duration;
|
||||||
const_cast<TsInfo&>(info).ui64FileSize = fileData.st_size;
|
WorkThreadPool::Instance().getExecutor()->async([info]() {
|
||||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastRecordTs, info);
|
struct stat fileData;
|
||||||
});
|
stat(info.strFilePath.data(), &fileData);
|
||||||
|
const_cast<TsInfo&>(info).ui64FileSize = fileData.st_size;
|
||||||
|
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastRecordTs, info);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user