添加配置文件热加载功能

This commit is contained in:
xiongziliang
2018-02-09 11:42:55 +08:00
parent 551b9a437b
commit 70bb1a652a
16 changed files with 217 additions and 139 deletions

View File

@@ -54,7 +54,8 @@ void RtmpSession::onError(const SockException& err) {
DebugL << err.what();
//流量统计事件广播
static uint64_t iFlowThreshold = mINI::Instance()[Broadcast::kFlowThreshold];
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
if(m_ui64TotalBytes > iFlowThreshold * 1024){
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,m_mediaInfo,m_ui64TotalBytes);
}

View File

@@ -98,8 +98,9 @@ void RtmpToRtspMediaSource::makeSDP() {
auto lam = [this](const RtpPacket::Ptr &pkt, bool bKeyPos) {
m_pRtspSrc->onGetRTP(pkt,bKeyPos);
};
static uint32_t videoMtu = mINI::Instance()[Config::Rtp::kVideoMtuSize].as<uint32_t>();
m_pRtpMaker_h264.reset(new RtpMaker_H264(lam, ssrc0,videoMtu));
GET_CONFIG_AND_REGISTER(uint32_t,videoMtu,Config::Rtp::kVideoMtuSize);
m_pRtpMaker_h264.reset(new RtpMaker_H264(lam, ssrc0,videoMtu));
char strTemp[100];
int profile_level_id = 0;
@@ -140,8 +141,8 @@ void RtmpToRtspMediaSource::makeSDP() {
auto lam = [this](const RtpPacket::Ptr &pkt, bool bKeyPos) {
m_pRtspSrc->onGetRTP(pkt,bKeyPos);
};
static uint32_t audioMtu = mINI::Instance()[Config::Rtp::kAudioMtuSize].as<uint32_t>();
m_pRtpMaker_aac.reset(new RtpMaker_AAC(lam, ssrc1, audioMtu,m_pParser->getAudioSampleRate()));
GET_CONFIG_AND_REGISTER(uint32_t,audioMtu,Config::Rtp::kAudioMtuSize);
m_pRtpMaker_aac.reset(new RtpMaker_AAC(lam, ssrc1, audioMtu,m_pParser->getAudioSampleRate()));
char configStr[32];
const string & strAacCfg = m_pParser->getAudioCfg();