From 5489b2dd17189bec5726d4a84f397652cc06379b Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 1 Mar 2022 11:56:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93:=20#1435?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3rdpart/media-server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdpart/media-server b/3rdpart/media-server index 49c146a4..f1ee15ec 160000 --- a/3rdpart/media-server +++ b/3rdpart/media-server @@ -1 +1 @@ -Subproject commit 49c146a4e35231ca94e7d0892d421e90a1a14bad +Subproject commit f1ee15ec36a3bb311d3f1e5ec0816e0caf32639e From 4af83cbe7c7940ab483cb95a1c481a79feb02319 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 1 Mar 2022 19:00:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8DENABLE=5FMEM=5FDEBUG?= =?UTF-8?q?=E6=97=B6=E7=BC=96=E8=AF=91=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/config.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Common/config.cpp b/src/Common/config.cpp index c8b675c0..6b9eb233 100644 --- a/src/Common/config.cpp +++ b/src/Common/config.cpp @@ -9,6 +9,7 @@ */ #include +#include #include "Common/config.h" #include "Util/util.h" #include "Util/logger.h" From d88fe077edd123eb220a8d75517962fa4bf58c7b Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 2 Mar 2022 18:03:44 +0800 Subject: [PATCH 3/3] =?UTF-8?q?on=5Fpublish=20hook=E6=96=B0=E5=A2=9Eorigin?= =?UTF-8?q?Type=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebHook.cpp | 2 ++ src/Common/config.h | 2 +- src/Rtmp/RtmpSession.cpp | 2 +- src/Rtp/RtpProcess.cpp | 2 +- src/Rtsp/RtspSession.cpp | 2 +- webrtc/WebRtcTransport.cpp | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/WebHook.cpp b/server/WebHook.cpp index 727fd211..fe88b461 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -277,6 +277,8 @@ void installWebHook(){ body["ip"] = sender.get_peer_ip(); body["port"] = sender.get_peer_port(); body["id"] = sender.getIdentifier(); + body["originType"] = (int) type; + body["originTypeStr"] = getOriginTypeString(type); //执行hook do_http_hook(hook_publish,body,[invoker](const Value &obj,const string &err){ if(err.empty()){ diff --git a/src/Common/config.h b/src/Common/config.h index d86c6979..fb84be28 100644 --- a/src/Common/config.h +++ b/src/Common/config.h @@ -72,7 +72,7 @@ typedef std::function(*this)); + auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, MediaOriginType::rtmp_push, _media_info, invoker, static_cast(*this)); if(!flag){ //该事件无人监听,默认鉴权成功 GET_CONFIG(bool,to_hls,General::kPublishToHls); diff --git a/src/Rtp/RtpProcess.cpp b/src/Rtp/RtpProcess.cpp index 982a4f16..0549c5bf 100644 --- a/src/Rtp/RtpProcess.cpp +++ b/src/Rtp/RtpProcess.cpp @@ -252,7 +252,7 @@ void RtpProcess::emitOnPublish() { }; //触发推流鉴权事件 - auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, _media_info, invoker, static_cast(*this)); + auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, MediaOriginType::rtp_push, _media_info, invoker, static_cast(*this)); if (!flag) { //该事件无人监听,默认不鉴权 GET_CONFIG(bool, toHls, General::kPublishToHls); diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index 0db04659..c46cf2b2 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -299,7 +299,7 @@ void RtspSession::handleReq_ANNOUNCE(const Parser &parser) { }; //rtsp推流需要鉴权 - auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, _media_info, invoker, static_cast(*this)); + auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, MediaOriginType::rtsp_push, _media_info, invoker, static_cast(*this)); if (!flag) { //该事件无人监听,默认不鉴权 GET_CONFIG(bool, toHls, General::kPublishToHls); diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 78ea4f0f..19be2570 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -1016,7 +1016,7 @@ void push_plugin(Session &sender, const string &offer_sdp, const WebRtcArgs &arg }; //rtsp推流需要鉴权 - auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, info, invoker, static_cast(sender)); + auto flag = NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastMediaPublish, MediaOriginType::rtc_push, info, invoker, static_cast(sender)); if (!flag) { //该事件无人监听,默认不鉴权 GET_CONFIG(bool, to_hls, General::kPublishToHls);