mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-02 16:37:34 +08:00
shell登录鉴权改成广播方式
删除rtsp/rtmp shell命令,添加media命令 加载配置文件后发送广播
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -38,7 +38,7 @@ using namespace ZL::Player;
|
||||
namespace ZL {
|
||||
namespace DEV {
|
||||
|
||||
class PlayerProxy :public MediaPlayer, public std::enable_shared_from_this<PlayerProxy>{
|
||||
class PlayerProxy :public MediaPlayer, public std::enable_shared_from_this<PlayerProxy> , public MediaSourceEvent {
|
||||
public:
|
||||
typedef std::shared_ptr<PlayerProxy> Ptr;
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual ~PlayerProxy();
|
||||
|
||||
void play(const char* strUrl) override;
|
||||
|
||||
bool shutDown() override;
|
||||
private:
|
||||
bool m_bEnableHls;
|
||||
bool m_bEnableMp4;
|
||||
|
||||
Reference in New Issue
Block a user