完善代码

This commit is contained in:
xiongziliang 2018-09-07 16:35:17 +08:00
parent 98f8024409
commit 6c97338712
3 changed files with 3 additions and 4 deletions

View File

@ -83,7 +83,7 @@ extern const char kBroadcastHttpRequest[];
//该流是否需要认证是的话调用invoker并传入realm,否则传入空的realm.如果该事件不监听则不认证
extern const char kBroadcastOnGetRtspRealm[];
#define BroadcastOnGetRtspRealmArgs const string &app,const string &stream,const RtspSession::onGetRealm &invoker,TcpSession &sender
#define BroadcastOnGetRtspRealmArgs const MediaInfo &args,const RtspSession::onGetRealm &invoker,TcpSession &sender
//请求认证用户密码事件user_name为用户名must_no_encrypt如果为true则必须提供明文密码(因为此时是base64认证方式),否则会导致认证失败
//获取到密码后请调用invoker并输入对应类型的密码和密码类型invoker执行时会匹配密码

View File

@ -226,8 +226,7 @@ bool RtspSession::handleReq_Describe() {
//广播是否需要认证事件
if(!NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastOnGetRtspRealm,
m_mediaInfo.m_app,
m_mediaInfo.m_streamid,
m_mediaInfo,
invoker,
*this)){
//无人监听此事件,说明无需认证

View File

@ -64,7 +64,7 @@ using namespace ZL::Network;
static onceToken s_token([](){
NoticeCenter::Instance().addListener(nullptr,Config::Broadcast::kBroadcastOnGetRtspRealm,[](BroadcastOnGetRtspRealmArgs){
if(string("1") == stream ){
if(string("1") == args.m_streamid ){
// live/1需要认证
EventPoller::Instance().async([invoker](){
//该流需要认证并且设置realm