rtc udp/tcp port 默认8000

This commit is contained in:
weishao 2023-07-19 16:41:43 +08:00
parent 84ab30ec76
commit 9734b7bf00
5 changed files with 31 additions and 53 deletions

View File

@ -102,16 +102,6 @@ onceToken token1([](){
},nullptr);
} //namespace RtpProxy
// RTC配置项目
namespace Rtc {
#define RTC_FIELD "rtc."
const string kPort = RTC_FIELD "port";
const string kTcpPort = RTC_FIELD "tcpPort";
onceToken token1([]() {
mINI::Instance()[kPort] = 8000;
mINI::Instance()[kTcpPort] = 8000;
},nullptr);
} // namespace RTC
} // namespace mediakit

View File

@ -260,23 +260,6 @@ static onceToken token([]() {
});
} // namespace Rtp
////////////RTC服务器配置///////////
namespace Rtc {
#define RTC_FIELD "rtc."
// rtp和rtcp接受超时时间
const string kTimeOutSec = RTC_FIELD "timeoutSec";
// 服务器外网ip
const string kExternIP = RTC_FIELD "externIP";
// 设置remb比特率非0时关闭twcc并开启remb。该设置在rtc推流时有效可以控制推流画质
const string kRembBitRate = RTC_FIELD "rembBitRate";
static onceToken token([]() {
mINI::Instance()[kTimeOutSec] = 15;
mINI::Instance()[kExternIP] = "";
mINI::Instance()[kRembBitRate] = 0;
});
} // namespace RTC
////////////组播配置///////////
namespace MultiCast {

View File

@ -308,15 +308,6 @@ extern const std::string kLowLatency;
extern const std::string kH264StapA;
} // namespace Rtp
////////////RTC服务器配置///////////
namespace Rtc {
//rtc播放推流、播放超时时间
extern const std::string kTimeOutSec;
// 服务器外网ip
extern const std::string kExternIP;
// 设置remb比特率非0时关闭twcc并开启remb。该设置在rtc推流时有效可以控制推流画质
extern const std::string kRembBitRate;
} // namespace Rtc
////////////组播配置///////////
namespace MultiCast {

View File

@ -32,27 +32,34 @@
#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 {
// RTC配置项目
namespace Rtc {
#define RTC_FIELD "rtc."
// rtp和rtcp接受超时时间
const string kTimeOutSec = RTC_FIELD "timeoutSec";
// 服务器外网ip
const string kExternIP = RTC_FIELD "externIP";
// 设置remb比特率非0时关闭twcc并开启remb。该设置在rtc推流时有效可以控制推流画质
const string kRembBitRate = RTC_FIELD "rembBitRate";
// webrtc单端口udp服务器
const string kPort = RTC_FIELD "port";
const string kTcpPort = RTC_FIELD "tcpPort";
static onceToken token([]() {
mINI::Instance()[kTimeOutSec] = 15;
mINI::Instance()[kExternIP] = "";
mINI::Instance()[kRembBitRate] = 0;
mINI::Instance()[kPort] = 8000;
mINI::Instance()[kTcpPort] = 8000;
});
} // namespace RTC
static atomic<uint64_t> s_key { 0 };
static void translateIPFromEnv(std::vector<std::string> &v) {

View File

@ -28,6 +28,13 @@
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;