mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
新增支持on_publish hook返回stream_replace替换流id (#2641)
This commit is contained in:
parent
575a4263c0
commit
077566d1e1
@ -187,6 +187,9 @@ public:
|
|||||||
//hls录制保存路径
|
//hls录制保存路径
|
||||||
std::string hls_save_path;
|
std::string hls_save_path;
|
||||||
|
|
||||||
|
// 支持通过on_publish返回值替换stream_id
|
||||||
|
std::string stream_replace;
|
||||||
|
|
||||||
template <typename MAP>
|
template <typename MAP>
|
||||||
ProtocolOption(const MAP &allArgs) : ProtocolOption() {
|
ProtocolOption(const MAP &allArgs) : ProtocolOption() {
|
||||||
#define GET_OPT_VALUE(key) getArgsValue(allArgs, #key, key)
|
#define GET_OPT_VALUE(key) getArgsValue(allArgs, #key, key)
|
||||||
@ -214,6 +217,7 @@ public:
|
|||||||
GET_OPT_VALUE(mp4_save_path);
|
GET_OPT_VALUE(mp4_save_path);
|
||||||
|
|
||||||
GET_OPT_VALUE(hls_save_path);
|
GET_OPT_VALUE(hls_save_path);
|
||||||
|
GET_OPT_VALUE(stream_replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -80,6 +80,10 @@ std::string MultiMediaSourceMuxer::shortUrl() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MultiMediaSourceMuxer::MultiMediaSourceMuxer(const MediaTuple& tuple, float dur_sec, const ProtocolOption &option): _tuple(tuple) {
|
MultiMediaSourceMuxer::MultiMediaSourceMuxer(const MediaTuple& tuple, float dur_sec, const ProtocolOption &option): _tuple(tuple) {
|
||||||
|
if (!option.stream_replace.empty()) {
|
||||||
|
// 支持在on_publish hook中替换stream_id
|
||||||
|
_tuple.stream = option.stream_replace;
|
||||||
|
}
|
||||||
_poller = EventPollerPool::Instance().getPoller();
|
_poller = EventPollerPool::Instance().getPoller();
|
||||||
_create_in_poller = _poller->isCurrentThread();
|
_create_in_poller = _poller->isCurrentThread();
|
||||||
_option = option;
|
_option = option;
|
||||||
|
Loading…
Reference in New Issue
Block a user