浏览代码

#IQRV #comment [Sipphone] 添加从配置中读取帧率大小的实现

gifur 3 年之前
父节点
当前提交
3d7e761f91
共有 3 个文件被更改,包括 19 次插入2 次删除
  1. 1 0
      Module/mod_sipphone/Event.h
  2. 17 2
      Module/mod_sipphone/mod_sipphone.cpp
  3. 1 0
      Module/mod_sipphone/mod_sipphone.h

+ 1 - 0
Module/mod_sipphone/Event.h

@@ -86,6 +86,7 @@
 #define EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_CREATE					0x30190032
 #define EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_DESTROY					0x30190033
 #define EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_DESTROY					0x30190034
+#define EVENT_MOD_SIP_OVERWRITE_FRESHVALUE	                 				0x30190036
 
 //audio engine error
 #define ERROR_MOD_SIP_APR_POOL_CREATE_FAILED						0x30190601  //内存分配失败,级别2

+ 17 - 2
Module/mod_sipphone/mod_sipphone.cpp

@@ -1745,6 +1745,20 @@ void CSIPEntity::Handle_AdjustVideoEchoEvent(const char* pszMessage)
 }
 
 
+void CSIPEntity::InitFreshTimeConfig()
+{
+    CSmartPointer<IConfigInfo> spCacheConfig;
+    GetFunction()->OpenConfig(Config_Cache, spCacheConfig);
+
+	int value(0);
+	spCacheConfig->ReadConfigValueInt("SIPPhone", "lfreshtime", value);
+	if (value > 0) {
+		LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_OVERWRITE_FRESHVALUE,
+				CSimpleStringA::Format("overwrite lfreshtime from global cache: %d", value));
+        m_ilocalvideo_freshtime = value;
+	}
+}
+
 ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 {
 	CSmartPointer<IEntityFunction> spFunction = GetFunction();
@@ -1776,7 +1790,6 @@ ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 		table.AddEntryInt("audio", "pickup_out_volume", m_kept_volume_out[DEV_PICKUP], 0);
 		table.AddEntryInt("video", "quant", conf->quant, 0);
 		table.AddEntryInt("video", "mtu", conf->mtu, 0);
-		table.AddEntryInt("video", "lfreshtime", m_ilocalvideo_freshtime, 200);
 		Error = table.Load(spRootConfig);
 		if (Error == Error_Succeed) {
 			int id;
@@ -1868,10 +1881,12 @@ ErrorCodeEnum CSIPEntity::LoadConfig(endpoint_conf_t *conf)
 			}
 		}
 	}
+
+	InitFreshTimeConfig();
+
 	return Error;
 }
 
-
 //载入运行时配置
 ErrorCodeEnum CSIPEntity::LoadAudioRunConfig(int&nHandfreeout,int&nPickupout,int&nHandfreein,int&nPickupin)
 {

+ 1 - 0
Module/mod_sipphone/mod_sipphone.h

@@ -235,6 +235,7 @@ public:
 private:
 
 	ErrorCodeEnum LoadConfig(endpoint_conf_t *conf);
+	void InitFreshTimeConfig();
 	//载入运行时配置
 	ErrorCodeEnum LoadAudioRunConfig(int&nHandfreeout,int&nPickupout,int&nHandfreein,int&nPickupin);
 	//保存运行时