shell登录鉴权改成广播方式

删除rtsp/rtmp shell命令,添加media命令
加载配置文件后发送广播
This commit is contained in:
xiongziliang
2018-02-08 17:24:42 +08:00
parent 3c40f171c1
commit 551b9a437b
8 changed files with 190 additions and 91 deletions

View File

@@ -131,6 +131,7 @@ void PlayerProxy::initMedia() {
return;
}
m_pChn.reset(new DevChannel(m_strVhost.data(),m_strApp.data(),m_strSrc.data(),getDuration(),m_bEnableHls,m_bEnableMp4));
m_pChn->setListener(shared_from_this());
if (containVideo()) {
VideoInfo info;
info.iFrameRate = getVideoFps();
@@ -146,6 +147,18 @@ void PlayerProxy::initMedia() {
m_pChn->initAudio(info);
}
}
bool PlayerProxy::shutDown() {
//通知其停止推流
weak_ptr<PlayerProxy> weakSlef = dynamic_pointer_cast<PlayerProxy>(shared_from_this());
ASYNC_TRACE([weakSlef](){
auto stronSelf = weakSlef.lock();
if(stronSelf){
stronSelf->m_pChn.reset();
stronSelf->teardown();
}
});
return true;
}
} /* namespace Player */