mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-12 19:24:22 +08:00
Replace the tuple (vhost/app/stream) with MediaTuple. (#2560)
This commit is contained in:
@@ -88,8 +88,9 @@ int domain(const string &playUrl, const string &pushUrl) {
|
||||
NoticeCenter::Instance().addListener(nullptr, Broadcast::kBroadcastMediaChanged,
|
||||
[pushUrl,poller](BroadcastMediaChangedArgs) {
|
||||
//媒体源"app/stream"已经注册,这时方可新建一个RtmpPusher对象并绑定该媒体源
|
||||
if(bRegist && pushUrl.find(sender.getSchema()) == 0){
|
||||
createPusher(poller,sender.getSchema(),sender.getVhost(),sender.getApp(), sender.getId(), pushUrl);
|
||||
if (bRegist && pushUrl.find(sender.getSchema()) == 0) {
|
||||
auto tuple = sender.getMediaTuple();
|
||||
createPusher(poller, sender.getSchema(), tuple.vhost, tuple.app, tuple.stream, pushUrl);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -155,9 +155,10 @@ void initEventListener() {
|
||||
|
||||
//监听rtsp、rtmp源注册或注销事件;此处用于测试rtmp保存为flv录像,保存在http根目录下
|
||||
NoticeCenter::Instance().addListener(nullptr, Broadcast::kBroadcastMediaChanged, [](BroadcastMediaChangedArgs) {
|
||||
if (sender.getSchema() == RTMP_SCHEMA && sender.getApp() == "live") {
|
||||
auto tuple = sender.getMediaTuple();
|
||||
if (sender.getSchema() == RTMP_SCHEMA && tuple.app == "live") {
|
||||
lock_guard<mutex> lck(s_mtxFlvRecorder);
|
||||
auto key = sender.shortUrl();
|
||||
auto key = tuple.shortUrl();
|
||||
if (bRegist) {
|
||||
DebugL << "开始录制RTMP:" << sender.getUrl();
|
||||
GET_CONFIG(string, http_root, Http::kRootPath);
|
||||
|
||||
Reference in New Issue
Block a user