Przeglądaj źródła

Z991239-5647 #comment 删除不再使用集中配置逻辑

80274480 1 rok temu
rodzic
commit
31eb7ab90d

+ 4 - 42
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -53,30 +53,8 @@ static const char* record_failed_case_table[] = {
 
 static BOOL CheckDiskStatus(const char *szRoot, int nPercent, int *pFreeRatio)
 {
-#ifdef RVC_OS_WIN
-	_ULARGE_INTEGER lpFreeBytesAvailableToCaller = {}, lpTotalNumberOfBytes = {}, lpTotalNumberOfFreeBytes = {};
-	BOOL ret = GetDiskFreeSpaceEx(szRoot, &lpFreeBytesAvailableToCaller, &lpTotalNumberOfBytes, &lpTotalNumberOfFreeBytes);
-	if (ret == 0)
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CheckDiskStatus.GetDiskFreeSpaceEx failed(%d).",GetLastError());
-		return FALSE;
-	}
-	DWORD dwTotal = lpTotalNumberOfBytes.QuadPart/1048576;
-	DWORD dwTotalFree = lpTotalNumberOfFreeBytes.QuadPart/1048576;
-	int ratio = dwTotalFree*100/dwTotal;
-	*pFreeRatio = ratio;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("free disk %d MB, %d percent free.", dwTotalFree, ratio);
-	//if (ratio < (100-MAX_DISK_PERCENT))
-	if (ratio < (100-nPercent))
-	{
-		return FALSE;
-	}
-	return TRUE;
-#else
 	//todo 调用resourcewatcher
 	return TRUE;
-#endif
-
 }
 
 
@@ -795,7 +773,7 @@ bool CSalesRecorderEntity::GetHighQualityOnSiteSalesRecorder()
 }
 
 
-void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* videofilename, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam, bool bWholeSection, bool bSessionManage, eRvcRecordType eRecordType)
+void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* videofilename, int videoquality, SubtitleParam* subtitleParam, bool bWholeSection, bool bSessionManage, eRvcRecordType eRecordType)
 {
 #ifdef RVC_OS_WIN
 	bool bRet = false;
@@ -810,7 +788,6 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* vid
 	tAudioParams.eOutPutType = m_eAudioOutQuality;
 	tAudioParams.bIsNsOn = m_bIsAudioNsOn;
 	tAudioParams.iNsPolicy = m_iAudioNsPolicy;
-	tAudioParams.iAudioOutBitRate = audioOutBitRate;
 	tAudioParams.iAudioChannels = m_iAudioChannels;
 	tAudioParams.bMuteAudioMode = false;
 
@@ -835,9 +812,9 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* vid
 	}
 }
 
-void CSalesRecorderEntity::StartRecord(const char * pszVideoName, int videoquality, int audioOutBitRate, SubtitleParam *subtitleParam /* = NULL */, bool bWholeSection /* = false */, bool bSessionManage /* = false */, eRvcRecordType eRecordType /* = eSingleSide */)
+void CSalesRecorderEntity::StartRecord(const char * pszVideoName, int videoquality, SubtitleParam *subtitleParam /* = NULL */, bool bWholeSection /* = false */, bool bSessionManage /* = false */, eRvcRecordType eRecordType /* = eSingleSide */)
 {
-	StartOnSiteSalesRecord(10, pszVideoName, videoquality, audioOutBitRate, subtitleParam, bWholeSection, bSessionManage, eRecordType);
+	StartOnSiteSalesRecord(10, pszVideoName, videoquality, subtitleParam, bWholeSection, bSessionManage, eRecordType);
 }
 
 ErrorCodeEnum CSalesRecorderEntity::StopRecord()
@@ -1217,20 +1194,13 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 	}
 #endif
 
-
-	int i_audio_out_bitrate = m_audio_out_bitrate;
-
 	if (bRemoteRecord){
 		if (eStand2sType == m_eDeviceType || eStand1SPlusType == m_eDeviceType)  {	//如果是大机
 			eRecordType = eStand2Agent;   //可视柜台大机的双向录像
 		} 
-
-		if(256 == m_audio_out_bitrate){
-			i_audio_out_bitrate = 128;
-		}
 	} 
 
-	StartRecord(m_SalesVideoName, 90, i_audio_out_bitrate, &subtitleParam, m_bWholeSection, false, eRecordType);
+	StartRecord(m_SalesVideoName, 90, &subtitleParam, m_bWholeSection, false, eRecordType);
 
 	LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_REMOTERECORD, CSimpleStringA::Format("start remote record %s.", m_SalesVideoName).GetData());
 
@@ -1878,16 +1848,12 @@ ErrorCodeEnum CSalesRecorderEntity::GetEntityConfig()
 	CSimpleStringA strHttpServerAddr("");
 	int iPostOn = 0;
 	m_max_disk_percent = MAX_DISK_PERCENT;
-	m_audio_samplerate = 8;
 	int iStopEncflag = 0;
 	int iRemoteRecordType = 0;
 
 	CSmartPointer<IConfigInfo> spConfig;
 	CSmartPointer<IEntityFunction> spFunction = GetFunction();
 	if (spFunction->OpenConfig(Config_CenterSetting, spConfig) == Error_Succeed) {
-		spConfig->ReadConfigValueInt("SalesRecorder", "MaxDiskPercent", m_max_disk_percent);
-		spConfig->ReadConfigValueInt("SalesRecorder", "AudioSampleRate", m_audio_samplerate);
-		spConfig->ReadConfigValueInt("SalesRecorder", "AudioBitRate", m_audio_out_bitrate);
 		spConfig->ReadConfigValueInt("SalesRecorder", "AudioNsPolicy", iAudioNsPolicy);
 		spConfig->ReadConfigValueInt("SalesRecorder", "IsAudioNsOn", iIsAudioNsOn);
 		spConfig->ReadConfigValueInt("SalesRecorder", "AudioQuality", iAudioQuality);
@@ -1901,10 +1867,6 @@ ErrorCodeEnum CSalesRecorderEntity::GetEntityConfig()
 		spConfig->ReadConfigValueInt("InteractiveControl", "RemoteRecordType", iRemoteRecordType);
 	}
 
-	if (m_max_disk_percent <= 0 || m_max_disk_percent >= 100) {
-		m_max_disk_percent = MAX_DISK_PERCENT;
-	}
-
 	if (iLogLevel <= RECORD_LOG_ERROR && iLogLevel > 0) {
 		m_loglevel = (record_loglevel)iLogLevel;
 	}

+ 3 - 5
Module/mod_SalesRecorder/mod_SalesRecorder.h

@@ -106,9 +106,9 @@ namespace SalesRecorder {
 
 		ErrorCodeEnum HandleVideoAppendWatermark(const char* pszVideoName, const wchar_t* pszWaterMark);
 #endif //RVC_OS_WIN
-		void StartRecord(const char* pszVideoName, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam = NULL, bool bWholeSection = false, bool bSessionManage = false, eRvcRecordType eRecordType = eSingleSide);
+		void StartRecord(const char* pszVideoName, int videoquality, SubtitleParam* subtitleParam = NULL, bool bWholeSection = false, bool bSessionManage = false, eRvcRecordType eRecordType = eSingleSide);
 
-		void StartOnSiteSalesRecord(const int fps, const char* pszVideoName, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam, bool bWholeSection, bool bSessionManage, eRvcRecordType eRecordType);
+		void StartOnSiteSalesRecord(const int fps, const char* pszVideoName, int videoquality, SubtitleParam* subtitleParam, bool bWholeSection, bool bSessionManage, eRvcRecordType eRecordType);
 
 		void DeleteAllVideo(const char* pszVideoName);
 
@@ -183,9 +183,7 @@ namespace SalesRecorder {
 		CSimpleStringA m_RecordSaveDir;		
 
 		bool m_last_disk_overtop;
-		int m_max_disk_percent;			    
-		int m_audio_samplerate;            
-		int m_audio_out_bitrate;            
+		int m_max_disk_percent;		      
        
 		record_loglevel m_loglevel;
 		record_loglevel m_lowestlevel;

+ 0 - 1
Module/mod_recorder/mod_recorder.cpp

@@ -669,7 +669,6 @@ void CRecorderEntity::StartRecord(const char *videofilename)
 	tAudioParams.eOutPutType = eLowDefinition;
 	tAudioParams.bIsNsOn = true;
 	tAudioParams.iNsPolicy = 2;
-	tAudioParams.iAudioOutBitRate = 8;
 	tAudioParams.bIsTransOn = false;
 	tAudioParams.iAudioChannels = 1;
 	

+ 1 - 37
Other/libaudioqueue/libaudioqueue.cpp

@@ -10,12 +10,6 @@
 #include <string.h>
 
 
-void Debug(const char* fmt, ...)
-{
-
-}
-
-
 typedef struct  Qnode
 {
 	unsigned int videoframeindex;
@@ -59,9 +53,7 @@ public:
 			aAudioFrameAddr[i] = 0;
 			aAudioDataAddr[i] = 0;
 		}
-		Debug("%s:%d before InitQueue name is %s, and framesize is %d.", __FUNCTION__, __LINE__, audioqueuename, framesize);
 		InitQueue(audioqueuename,framesize);
-		Debug("%s:%d after InitQueue name is %s, and framesize is %d.", __FUNCTION__, __LINE__, audioqueuename, framesize);
 	}
 
 	~libaudioqueue_impl()
@@ -72,21 +64,17 @@ public:
 	bool InitQueue(const char* szName,int framesize=MAX_AUDIOQNODE_SIZE)
 	{
 		bool bret = false;
-		Debug("%s:%d InitQueue name is %s, and framesize is %d.", __FUNCTION__, __LINE__, szName, framesize);
 		m_nQueueAddrLens = sizeof(linkqueue);
 		m_nQnodeAddrLens = MAX_AUDIOQUEUE_LENS*sizeof(Qnode);
 		m_nFrameAddrLens = MAX_AUDIOQUEUE_LENS*sizeof(audio_frame);
 		m_nDataAddrlens	= MAX_AUDIOQUEUE_LENS*framesize;
 		int nMemTotalNum = m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
 
-		Debug("%s:%d before share memory Create name is %s, and nMemTotalNum is %d.", __FUNCTION__, __LINE__, szName, nMemTotalNum);
 		if (m_ShareMem.Create(szName,nMemTotalNum)&&(m_nDataAddrlens!=0))
 		{
-			Debug("%s:%d share memory Create success and name is %s, nMemTotalNum is %d.", __FUNCTION__, __LINE__, szName, nMemTotalNum);
 			m_lpMem = m_ShareMem.Lock(1000);
 			if(m_lpMem != NULL)
 			{
-				Debug("%s:%d share memory lock m_lpMem addr is not NULL", __FUNCTION__, __LINE__);
 				memset(m_lpMem,0,nMemTotalNum);
 				m_pQueue = (linkqueue *)m_lpMem;
 				for(int i =0;i<MAX_AUDIOQUEUE_LENS;i++)
@@ -100,14 +88,10 @@ public:
 				m_ShareMem.Unlock();
 				bret = true;
 			}
-			else
-			{
-				Debug("%s:%d share memory lock m_lpMem addr is NULL", __FUNCTION__, __LINE__);
-			}
+
 		} 
 		else if(m_ShareMem.Open(szName))
 		{
-			Debug("%s:%d share memory Create failed and try open share memory %s.", __FUNCTION__, __LINE__, szName);
 			m_lpMem = m_ShareMem.Lock(1000);
 			if(m_lpMem != NULL)
 			{
@@ -121,13 +105,8 @@ public:
 				m_ShareMem.Unlock();
 				bret = true;
 			}
-			else {
-				Debug("%s:%d share memory lock failed and return.", __FUNCTION__, __LINE__);
-			}
 		}
 
-		Debug("InitQueue return value is %s, and share memory valid flag is %s.",bret ? "true" : "false", m_ShareMem.IsValid() ? "true" : "false");
-
 		return bret;
 	}
 	//返回队列的元素个数,音频队列长度
@@ -157,7 +136,6 @@ public:
 	{
 		if(m_ShareMem.IsValid())
 		{
-			Debug("m_ShareMem is valid.");
 			m_lpMem = m_ShareMem.Lock(1000);
 			if(m_lpMem != NULL)
 			{
@@ -198,7 +176,6 @@ public:
 					audiotmp->iseriesnumber			= Audio->iseriesnumber;
 					memcpy(audiotmp->data,Audio->data,Audio->framesize);
 					rearptrfront->nextqnodeindex = m_pQueue->rearindex;
-					Debug("audio series number is %d, m_pQueue->queuelens = %d.", audiotmp->iseriesnumber, m_pQueue->queuelens);
 					//delete Audio->data;
 					//delete Audio;
 				}
@@ -207,14 +184,12 @@ public:
 			}
 			else
 			{
-				Debug("m_lpMem is null");
 				return false;
 			}
 
 		}
 		else
 		{
-			Debug("m_ShareMem is not valid.");
 			return false;
 		}
 	}
@@ -226,10 +201,8 @@ public:
 			m_lpMem = m_ShareMem.Lock(1000);
 			if(m_lpMem != NULL)
 			{
-				Debug("%s:%d share memory Lock success!", __FUNCTION__, __LINE__);
 				if (m_pQueue->queuelens == 0)
 				{
-					Debug("%s:%d m_pQueue queuelens is 0!", __FUNCTION__, __LINE__);
 					m_ShareMem.Unlock();
 					return false;
 				}
@@ -249,13 +222,11 @@ public:
 			}
 			else
 			{
-				Debug("%s:%d share memory Lock failed!", __FUNCTION__, __LINE__);
 				return false;
 			}
 		}
 		else
 		{
-			Debug("%s:%d m_ShareMem.Is not Valid()", __FUNCTION__, __LINE__);
 			return false;
 		}		
 	}
@@ -268,10 +239,8 @@ public:
 			m_lpMem = m_ShareMem.Lock(1000);
 			if(m_lpMem != NULL)
 			{
-				Debug("%s:%d share memory Lock success, m_pQueue->queuelens = %d.", __FUNCTION__, __LINE__, m_pQueue->queuelens);
 				if (m_pQueue->queuelens == 0)
 				{
-					Debug("%s:%d m_pQueue queuelens is 0!", __FUNCTION__, __LINE__);
 					m_ShareMem.Unlock();
 					return false;
 				}
@@ -294,19 +263,16 @@ public:
 					qnodetmp->nextqnodeindex	= 0;
 					m_pQueue->queuelens--;
 					m_ShareMem.Unlock();
-					Debug("%s:%d m_pQueue->queuelens = %d.", __FUNCTION__, __LINE__, m_pQueue->queuelens);
 					return true;
 				}
 			}
 			else
 			{
-				Debug("%s:%d share memory Lock failed!", __FUNCTION__, __LINE__);
 				return false;
 			}
 		}
 		else
 		{
-			Debug("%s:%d m_ShareMem.Is not Valid()", __FUNCTION__, __LINE__);
 			return false;
 		}		
 	}
@@ -413,9 +379,7 @@ public:
 // 有关类定义的信息,请参阅 libaudioqueue.h
 Clibaudioqueue::Clibaudioqueue(const char* audioqueuename,int framesize)
 {
-	Debug("%s:%d before new Clibaudioqueue name is %s, and framesize is %d.", __FUNCTION__, __LINE__, audioqueuename, framesize);
 	m_pImpl = new libaudioqueue_impl(audioqueuename,framesize);
-	Debug("%s:%d after new Clibaudioqueue name is %s, and framesize is %d.", __FUNCTION__, __LINE__, audioqueuename, framesize);
 	return;
 }
 

+ 0 - 1
Other/libvideorecord/libvideorecord.h

@@ -84,7 +84,6 @@ typedef struct Rvc_RecordAudioParam_s{
 	eAudioOutPutType eOutPutType;
 	bool bIsNsOn;
 	int iNsPolicy;
-	int iAudioOutBitRate;
 	bool bIsTransOn;
 	int iAudioChannels;
 	bool bMuteAudioMode;