From 84ab30ec7654cbb4dced5d8cbf92ec8c5f8d5181 Mon Sep 17 00:00:00 2001 From: Dw9 Date: Fri, 14 Jul 2023 21:30:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dc=20api=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/config.ini | 2 +- webrtc/WebRtcTransport.cpp | 17 +++++++++++++++++ webrtc/WebRtcTransport.h | 7 ------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/conf/config.ini b/conf/config.ini index c6a7e545..80c4fb60 100644 --- a/conf/config.ini +++ b/conf/config.ini @@ -38,7 +38,7 @@ restart_sec=0 modify_stamp=2 #转协议是否开启音频 enable_audio=1 -#添加acc静音音频,在关闭音频时,此开关无效 +#添加aac静音音频,在关闭音频时,此开关无效 add_mute_audio=1 #无人观看时,是否直接关闭(而不是通过on_none_reader hook返回close) #此配置置1时,此流如果无人观看,将不触发on_none_reader hook回调, diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 56895ae0..5bb93dc1 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -32,6 +32,23 @@ #define RTP_MSLABEL "zlmediakit-mslabel" #define RTP_MSID RTP_MSLABEL " " RTP_LABEL +namespace mediakit { +//c api RTC配置项目 +namespace Rtc { +#ifndef RTC_FIELD +#define RTC_FIELD "rtc." +// webrtc单端口udp服务器 +const std::string kPort = RTC_FIELD "port"; +const std::string kTcpPort = RTC_FIELD "tcpPort"; + +static onceToken token([]() { + mINI::Instance()[kPort] = 8000; + mINI::Instance()[kTcpPort] = 8000; +}); +#endif +} +} + using namespace std; namespace mediakit { diff --git a/webrtc/WebRtcTransport.h b/webrtc/WebRtcTransport.h index 2534ca3b..9ef681e6 100644 --- a/webrtc/WebRtcTransport.h +++ b/webrtc/WebRtcTransport.h @@ -28,13 +28,6 @@ namespace mediakit { -//RTC配置项目 -namespace Rtc { -extern const std::string kPort; -extern const std::string kTcpPort; -extern const std::string kTimeOutSec; -}//namespace RTC - class WebRtcInterface { public: WebRtcInterface() = default;