mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-23 09:22:21 +08:00
添加踢出推流器功能
This commit is contained in:
@@ -145,7 +145,7 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) {
|
||||
sendReply("onStatus", nullptr, status);
|
||||
if (!ok) {
|
||||
WarnL << "onPublish:"
|
||||
<< (authSuccess ? "Already publishing:" : err.data())
|
||||
<< (authSuccess ? "Already publishing:" : err.data()) << " "
|
||||
<< m_mediaInfo.m_vhost << " "
|
||||
<< m_mediaInfo.m_app << " "
|
||||
<< m_mediaInfo.m_streamid << endl;
|
||||
@@ -154,6 +154,7 @@ void RtmpSession::onCmd_publish(AMFDecoder &dec) {
|
||||
}
|
||||
m_bPublisherSrcRegisted = false;
|
||||
m_pPublisherSrc.reset(new RtmpToRtspMediaSource(m_mediaInfo.m_vhost,m_mediaInfo.m_app,m_mediaInfo.m_streamid));
|
||||
m_pPublisherSrc->setListener(dynamic_pointer_cast<MediaSourceEvent>(shared_from_this()));
|
||||
};
|
||||
|
||||
weak_ptr<RtmpSession> weakSelf = dynamic_pointer_cast<RtmpSession>(shared_from_this());
|
||||
@@ -213,7 +214,7 @@ void RtmpSession::doPlay(AMFDecoder &dec){
|
||||
sendReply("onStatus", nullptr, status);
|
||||
if (!ok) {
|
||||
WarnL << "onPlayed:"
|
||||
<< (authSuccess ? "No such stream:" : err.data())
|
||||
<< (authSuccess ? "No such stream:" : err.data()) << " "
|
||||
<< m_mediaInfo.m_vhost << " "
|
||||
<< m_mediaInfo.m_app << " "
|
||||
<< m_mediaInfo.m_streamid
|
||||
|
||||
@@ -44,7 +44,7 @@ using namespace ZL::Network;
|
||||
namespace ZL {
|
||||
namespace Rtmp {
|
||||
|
||||
class RtmpSession: public TcpLimitedSession<MAX_TCP_SESSION> ,public RtmpProtocol{
|
||||
class RtmpSession: public TcpLimitedSession<MAX_TCP_SESSION> ,public RtmpProtocol , public MediaSourceEvent{
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpSession> Ptr;
|
||||
RtmpSession(const std::shared_ptr<ThreadPool> &_th, const Socket::Ptr &_sock);
|
||||
@@ -95,6 +95,12 @@ private:
|
||||
invoke << str << m_dNowReqID << reply << status;
|
||||
sendResponse(MSG_CMD, invoke.data());
|
||||
}
|
||||
|
||||
bool shutDown() override {
|
||||
InfoL << "kick out:" << m_mediaInfo.m_vhost << " " << m_mediaInfo.m_app << " " << m_mediaInfo.m_streamid;
|
||||
safeShutdown();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace Rtmp */
|
||||
|
||||
Reference in New Issue
Block a user