Преглед на файлове

Z991239-4679 #comment 优化录像库

80274480 преди 2 години
родител
ревизия
4722b7973d

+ 10 - 0
Module/mod_SalesRecorder/SalesRecorder_def_g.h

@@ -32,6 +32,16 @@ namespace SalesRecorder {
 #define SalesRecorderSerVice_MethodSignature_PlaySalesRecord -816102314
 #define SalesRecorderSerVice_MethodSignature_StartRemoteRecord -220748987
 
+#define SalesRecorderSerVice_LogCode_GetOFLVideoRecords "QLR040231500"
+#define SalesRecorderSerVice_LogCode_CheckVideoDiskStatus "QLR040231501"
+#define SalesRecorderSerVice_LogCode_PlayVideo "QLR040231502"
+#define SalesRecorderSerVice_LogCode_SaveVideo "QLR040231503"
+#define SalesRecorderSerVice_LogCode_StopRecord "QLR040231504"
+#define SalesRecorderSerVice_LogCode_SetAudioTransFlag "QLR040231505"
+#define SalesRecorderSerVice_LogCode_StopShowVideo "QLR040231506"
+#define SalesRecorderSerVice_LogCode_PlaySalesRecord "QLR040231507"
+#define SalesRecorderSerVice_LogCode_StartRemoteRecord "QLR040231508"
+
 struct SalesRecorderSerVice_GetOFLVideoRecords_Req
 {
 	CSimpleStringW Name;

+ 36 - 96
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -34,14 +34,16 @@
 
 #define MAX_DISK_PERCENT	95      // 磁盘最大占用百分比
 
+
 static const char* record_failed_case_table[] = {
-	"启动录像失败,初始化失败",
-	"启动录像失败,字体为空,添加水印失败",
-	"开始录像失败,请稍后(约30秒)再试",
-	"录像失败,摄像头故障,获取不到视频,请联系厂商进行维修",
-	"录像失败,获取不到远端音频,请检查风险提示音是否正常播放且音量大小是否正常",
-	"录像失败,麦克风故障,获取不到本地音频,请联系厂商进行维修",
-	"录像失败,系统不支持当前音频采样率"
+	"[RTA3L01] 启动录像失败,初始化失败",
+	"[RTA3L02] 启动录像失败,字体为空,添加水印失败",
+	"[RTA3L03] 开始录像失败,请稍后(约30秒)再试",
+	"[RTA3L04] 录像失败,摄像头故障,获取不到视频,请联系厂商进行维修",
+	"[RTA3L05] 录像失败,获取不到远端音频,请检查风险提示音是否正常播放且音量大小是否正常",
+	"[RTA3L06] 录像失败,麦克风故障,获取不到本地音频,请联系厂商进行维修",
+	"[RTA3L07] 录像失败,系统不支持当前音频采样率",
+	"[RTA3L08] 录像失败,获取不到远端视频,请稍后(约30秒)再试"
 };
 
 static ErrorCodeEnum ParseIPAddress(const char *str, CSimpleStringA &ip, int &port)
@@ -210,7 +212,7 @@ static BOOL FindMatchedFile(LPCSTR sFindPath, LPCSTR sFindFileName, ULONGLONG& u
 
 	//linux不支持*查找,去掉后缀
 	char strsuffix[MAX_PATH] = { 0 };
-	snprintf(strsuffix, MAX_PATH, "*.%s", RVC_RECORD_SUFFIX);
+	snprintf(strsuffix, MAX_PATH, "*.%s", RECORD_MP4_SUFFIX);
 	if (tmpFindFileName.IsEndWith(strsuffix)) {
 		tmpFindFileName = tmpFindFileName.SubString(0, tmpFindFileName.GetLength() - 5);
 	}
@@ -341,7 +343,6 @@ void CSalesRecorderEntity::OnPreStart( CAutoArray<CSimpleStringA> strArgs,CSmart
 
 ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 {
-	LOG_FUNCTION();
 	//MessageBoxA(0,0,0,0);
 	m_eDeviceType = eStand2sType;
 	m_nSysCallType = 0;
@@ -356,15 +357,13 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	int iAudioQuality = 3;
 	int iAudioNsPolicy = 2;
 	int iIsAudioNsOn = 0;
-	m_max_disk_percent = MAX_DISK_PERCENT; // add by ly 2018/02/24
+	m_max_disk_percent = MAX_DISK_PERCENT; 
 	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","WholeSection",m_bWholeSection);
-		spConfig->ReadConfigValueInt("SalesRecorder","ApplyHighQuality",m_bApplyHighQuality);
 		spConfig->ReadConfigValueInt("SalesRecorder","AudioNsPolicy",iAudioNsPolicy);
 		spConfig->ReadConfigValueInt("SalesRecorder","IsAudioNsOn",iIsAudioNsOn);
 		spConfig->ReadConfigValueInt("SalesRecorder","AudioQuality",iAudioQuality);
@@ -387,7 +386,7 @@ ErrorCodeEnum CSalesRecorderEntity::__OnStart( ErrorCodeEnum preOperationError )
 	if (m_bApplyHighQuality != 0 && m_bApplyHighQuality != 1){
 		m_bApplyHighQuality = FALSE;
 	}
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[dbg] m_bApplyHighQuality:%d",m_bApplyHighQuality);
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("[dbg] m_bApplyHighQuality:%d",m_bApplyHighQuality);
 
 	m_bEwsRecord = FALSE;
 
@@ -759,22 +758,22 @@ ErrorCodeEnum CSalesRecorderEntity::DecideCameraCount( int &nCount )
 }
 
 
-BOOL CSalesRecorderEntity::GetStandardQualityOnSiteSalesRecorder()
+bool CSalesRecorderEntity::GetStandardQualityOnSiteSalesRecorder()
 {
-	BOOL bRet = FALSE;
+	bool bRet = FALSE;
 
-	m_pRecorder = new Clibwmvrecord(&bRet, this, REC_COMMON_AUDIO_SHM_QUEUE, REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE,
+	m_pRecorder = new Clibvideorecord(&bRet, this, REC_COMMON_AUDIO_SHM_QUEUE, REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE,
 				REC_COMMON_VIDEO_OPT_SHM_SNAPSHOT_QUEUE, REC_COMMON_AUDIO_SALES_SHM_QUEUE, REC_COMMON_VIDEO_REMOTE_SHM_RTP_QUEUE, REC_COMMON_REMOTEAUDIO_SHM_QUEUE);
 		
 	return bRet;
 }
 
 
-BOOL CSalesRecorderEntity::GetHighQualityOnSiteSalesRecorder()
+bool CSalesRecorderEntity::GetHighQualityOnSiteSalesRecorder()
 {
-	BOOL bRet = FALSE;
+	bool bRet = false;
 
-	m_pRecorder = new Clibwmvrecord(&bRet, this, REC_COMMON_AUDIO_SHM_QUEUE, REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE,
+	m_pRecorder = new Clibvideorecord(&bRet, this, REC_COMMON_AUDIO_SHM_QUEUE, REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE,
 				REC_COMMON_VIDEO_OPT_SHM_SNAPSHOT_QUEUE, REC_COMMON_AUDIO_SALES_SHM_QUEUE, REC_COMMON_VIDEO_REMOTE_SHM_RTP_QUEUE, REC_COMMON_REMOTEAUDIO_SHM_QUEUE);
 
 	return bRet;
@@ -796,10 +795,10 @@ void CSalesRecorderEntity::StartOnSiteSalesRecord(const int fps, const char* wmv
 	}
 
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("init lib wmv record success! and record type is %s and output audio quality is %s, audio noise suppression flag is %s. noise suppression policy is %d.", record_type_table[eRecordType], audio_quality_type_table[m_eAudioOutQuality], tAudioParams.bIsNsOn ? "true" : "false", tAudioParams.iNsPolicy);
-	if (m_pRecorder->StartWmvRecord(fps, videoquality, &tAudioParams, subtitleParam, bWholeSection, FALSE, (LPCSTR)m_TempDir,
+	if (m_pRecorder->StartVideoRecord(fps, videoquality, eMP4, &tAudioParams, subtitleParam, bWholeSection, FALSE, (LPCSTR)m_TempDir,
 		m_TempDir.GetLength(), wmvfilename, strlen(wmvfilename)))
 	{
-		m_bStarted = TRUE;
+		m_bStarted = true;
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Start WmvRecord success!");
 	}
 	else {
@@ -819,7 +818,7 @@ ErrorCodeEnum CSalesRecorderEntity::StopRecord()
 	ErrorCodeEnum eCode = Error_Succeed;
 	if (m_bStarted) 
 	{
-		m_pRecorder->StopWmvRecord();
+		m_pRecorder->StopVideoRecord();
 
 		m_bStarted = FALSE;
 	}
@@ -833,33 +832,7 @@ ErrorCodeEnum CSalesRecorderEntity::StopRecord()
 ErrorCodeEnum CSalesRecorderEntity::ShowVideo( const char *wmvfilename )
 {
 	ErrorCodeEnum ErrorCode = Error_Succeed;
-	if(!m_bStarted)
-	{
-		CSimpleStringA strPath;
-		ErrorCodeEnum Error = GetFunction()->GetPath("Temp", strPath);
-		if (Error == Error_Succeed) {
-			if (strPath.GetLength() > 0 && strPath[strPath.GetLength()-1] != SPLIT_SLASH) {
-				strPath += SPLIT_SLASH_STR;
-			}
-			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
-			ULONGLONG uVideoCount = 0;
-			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bRet = %d while find %s", bRet, wmvfilename);
-			if(bRet){
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while play video!");
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = %p while play!", m_pPlayer);
-				//m_pPlayer->PlayVideo((LPCSTR)strPath, wmvfilename, uVideoCount);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to play video!");
-			}
-			else{
-				ErrorCode = Error_NotExist;
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play video failed for %s no exist!", wmvfilename);
-			}
-		}
-	}
-	else{
-		ErrorCode = Error_NotImpl;
-	}
+
 	return ErrorCode;
 }
 
@@ -867,33 +840,7 @@ ErrorCodeEnum CSalesRecorderEntity::ShowVideo( const char *wmvfilename )
 ErrorCodeEnum CSalesRecorderEntity::PlaySalesRecordVideo( const char *wmvfilename, int iWndX, int iWndY, int iWndWidth, int iWndHeight)
 {
 	ErrorCodeEnum ErrorCode = Error_Succeed;
-	if(!m_bStarted)
-	{
-		CSimpleStringA strPath;
-		ErrorCodeEnum Error = GetFunction()->GetPath("Temp", strPath);
-		if (Error == Error_Succeed) {
-			if (strPath.GetLength() > 0 && strPath[strPath.GetLength()-1] != SPLIT_SLASH) {
-				strPath += SPLIT_SLASH_STR;
-			}
-			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
-			ULONGLONG uVideoCount = 0;
-			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("bRet = %d while find %s", bRet, wmvfilename);
-			if(bRet){
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to get record count while play sales record video!");
-				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_pPlayer = %p while play!", m_pPlayer);
-				//m_pPlayer->PlaySalesRecordVideo(iWndX, iWndY, iWndWidth, iWndHeight,(LPCSTR)strPath, wmvfilename, uVideoCount);
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("succeed to play sales record video!");
-			}
-			else{
-				ErrorCode = Error_NotExist;
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("play play sales record video failed for %s no exist!", wmvfilename);
-			}
-		}
-	}
-	else{
-		ErrorCode = Error_NotImpl;
-	}
+
 	return ErrorCode;
 }
 
@@ -908,7 +855,7 @@ void CSalesRecorderEntity::DeleteVideo( const char *wmvfilename )
 			if (strPath.GetLength() > 0 && strPath[strPath.GetLength()-1] != SPLIT_SLASH) {
 				strPath += SPLIT_SLASH_STR;
 			}
-			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
+			CSimpleStringA strFindFileName = CSimpleStringA::Format("%s*.%s", wmvfilename, RECORD_MP4_SUFFIX);
 			ULONGLONG uVideoCount = 0;
 			BOOL bRet = FindMatchedFile((LPCSTR)strPath, (LPCTSTR)strFindFileName, uVideoCount);
 			if(bRet)
@@ -918,7 +865,7 @@ void CSalesRecorderEntity::DeleteVideo( const char *wmvfilename )
 				BOOL bDeleteSucc = TRUE;
 				for(int i = 0; i != uVideoCount; ++i)
 				{
-					fileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)strPath, wmvfilename, i, RVC_RECORD_SUFFIX);
+					fileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)strPath, wmvfilename, i, RECORD_MP4_SUFFIX);
 
 					if(remove(fileName.GetData())) {
 						bDeleteSucc = FALSE;
@@ -968,7 +915,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char *wmvfilename )
 			}
 			ULONGLONG uVideoCount = 0;
 			// 移动销售录像 edit by ly 2018/03/05
-			CSimpleStringA strFindFileName = CSimpleStringA::Format("S_%s*.%s", wmvfilename, RVC_RECORD_SUFFIX);
+			CSimpleStringA strFindFileName = CSimpleStringA::Format("S_%s*.%s", wmvfilename, RECORD_MP4_SUFFIX);
 			BOOL bRet = FindMatchedFile((LPCSTR)sourPath, (LPCSTR)strFindFileName, uVideoCount);
 			if(bRet)
 			{
@@ -986,8 +933,8 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char *wmvfilename )
 					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("strFindFileName=%s", (LPCSTR)strFindFileName);
 					for(int i = 0; i != uVideoCount; ++i)
 					{
-						sourFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)sourPath, (LPCSTR)strFindFileName, i, RVC_RECORD_SUFFIX);
-						destFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)destPath, (LPCSTR)strFindFileName, i, RVC_RECORD_SUFFIX);
+						sourFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)sourPath, (LPCSTR)strFindFileName, i, RECORD_MP4_SUFFIX);
+						destFileName = CSimpleStringA::Format("%s%s_%d.%s", (LPCSTR)destPath, (LPCSTR)strFindFileName, i, RECORD_MP4_SUFFIX);
 						unsigned long ufilesize = GetFileSize(sourFileName.GetData());
 						char strtext[MAX_PATH] = {0};
 						snprintf(strtext, MAX_PATH, "%s file size is %u byte.", (LPCSTR)sourFileName, ufilesize);
@@ -1096,15 +1043,8 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 	char *tmp = new char[ulen+1];
 	m_bEwsRecord = FALSE;
 
-	if ((false == bRemoteRecord) && (ulen >= EWS_CAMERA_FLAG_LEN) && (0 == strnicmp(pszMessage,EWS_CAMERA_FLAG,EWS_CAMERA_FLAG_LEN)))
-	{
-		m_bEwsRecord = TRUE;
-		strncpy(tmp, pszMessage+EWS_CAMERA_FLAG_LEN, ulen-EWS_CAMERA_FLAG_LEN);
-	}
-	else{
-		strncpy(tmp, pszMessage, ulen);
-	}
-
+	strncpy(tmp, pszMessage, ulen);
+	
 	char *result[32] = {0};
 	CStringSplit(tmp, result, "@");
 
@@ -1193,7 +1133,7 @@ ErrorCodeEnum CSalesRecorderEntity::HandleStartRecord(const char *pszMessage, co
 	subtitleParam.bSubtitle = TRUE;
 	subtitleParam.bSubtitleSection = TRUE;
 	subtitleParam.topSubtitleData[0] = '\0';
-	if (strlen(subTitle.SapID)>0&&strlen(subTitle.CustManagerName)>0) // 有无客户经理的双录字幕 edit by ly @2018/01/10
+	if (strlen(subTitle.SapID)>0&&strlen(subTitle.CustManagerName)>0)
 	{
 		swprintf(subtitleParam.bottomSubtitleData1, MAX_PATH, L"%s  %s  %s", subTitle.CustCardNo, subTitle.CustName, subTitle.ProductCode);
 		swprintf(subtitleParam.bottomSubtitleData2, MAX_PATH, L"%s  %s  %s", subTitle.ProductName, subTitle.SapID, subTitle.CustManagerName);
@@ -1351,9 +1291,9 @@ ErrorCodeEnum CSalesRecorderEntity::HandleSalesRecordEntityException(const char*
 	return Error_Succeed;
 }
 
-BOOL CSalesRecorderEntity::InitSalesRecorder()
+bool CSalesRecorderEntity::InitSalesRecorder()
 {
-	BOOL bRet = FALSE;
+	bool bRet = FALSE;
 	if (m_bApplyHighQuality)
 	{
 		bRet = GetHighQualityOnSiteSalesRecorder();
@@ -1367,13 +1307,13 @@ BOOL CSalesRecorderEntity::InitSalesRecorder()
 }
 
 
-BOOL CSalesRecorderEntity::ReleaseSalesRecorder()
+bool CSalesRecorderEntity::ReleaseSalesRecorder()
 {
 	if (m_pRecorder) {
 		delete m_pRecorder;
 		m_pRecorder = NULL;
 	}
-	return TRUE;
+	return true;
 }
 
 
@@ -1563,7 +1503,7 @@ void CSalesRecorderEntity::UploadTempPathVideos() {
 		char srcFilePath[MAX_PATH] = { 0 };
 		DIR* pDir = NULL;
 		struct dirent* pFile = NULL;
-		snprintf(srcFilePath, MAX_PATH, "%s*.%s", sourPath, RVC_RECORD_SUFFIX);
+		snprintf(srcFilePath, MAX_PATH, "%s*.%s", sourPath, RECORD_MP4_SUFFIX);
 
 		pDir = opendir(sourPath);
 		if (pDir == NULL) return ;

+ 51 - 49
Module/mod_SalesRecorder/mod_SalesRecorder.h

@@ -20,51 +20,51 @@
 
 using namespace SalesRecorder;
 
+namespace SalesRecorder {
+	typedef struct
+	{
+		char CustCardNo[24];
+		char CustName[32];
+		char ProductCode[32];
+		char ProductName[128];
+		char SapID[12];
+		char CustManagerName[32];
+		char Reserved1[128];
+		char Reserved2[128];
+	} RecordSubTitle;
+
+	
+	class CSalesRecorderEntity;
+	
+	class SalesRecordServiceSession : public SalesRecorderSerVice_ServerSessionBase
+	{
+	public:
+		explicit SalesRecordServiceSession(CSalesRecorderEntity *pEntity) : m_pEntity(pEntity){}
+		virtual void Handle_GetOFLVideoRecords(SpReqAnsContext<SalesRecorderSerVice_GetOFLVideoRecords_Req, SalesRecorderSerVice_GetOFLVideoRecords_Ans>::Pointer ctx);
+		virtual void Handle_CheckVideoDiskStatus(SpReqAnsContext<SalesRecorderSerVice_CheckVideoDiskStatus_Req, SalesRecorderSerVice_CheckVideoDiskStatus_Ans>::Pointer ctx);
+		virtual void Handle_PlayVideo(SpReqAnsContext<SalesRecorderSerVice_PlayVideo_Req, SalesRecorderSerVice_PlayVideo_Ans>::Pointer ctx);
+		virtual void Handle_SaveVideo(SpReqAnsContext<SalesRecorderSerVice_SaveVideo_Req, SalesRecorderSerVice_SaveVideo_Ans>::Pointer ctx);
+		virtual void Handle_StopRecord(SpReqAnsContext<SalesRecorderSerVice_StopRecord_Req, SalesRecorderSerVice_StopRecord_Ans>::Pointer ctx);
+		virtual void Handle_SetAudioTransFlag(SpReqAnsContext<SalesRecorderSerVice_SetAudioTransFlag_Req, SalesRecorderSerVice_SetAudioTransFlag_Ans>::Pointer ctx);
+		virtual void Handle_StopShowVideo(SpReqAnsContext<SalesRecorderSerVice_StopShowVideo_Req, SalesRecorderSerVice_StopShowVideo_Ans>::Pointer ctx);
+		virtual void Handle_PlaySalesRecord(SpReqAnsContext<SalesRecorderSerVice_PlaySalesRecord_Req, SalesRecorderSerVice_PlaySalesRecord_Ans>::Pointer ctx);
+		virtual void Handle_StartRemoteRecord(SpReqAnsContext<SalesRecorderSerVice_StartRemoteRecord_Req, SalesRecorderSerVice_StartRemoteRecord_Ans>::Pointer ctx);
 
-typedef struct
-{
-	char CustCardNo[24];
-	char CustName[32];
-	char ProductCode[32];
-	char ProductName[128];
-	char SapID[12];
-	char CustManagerName[32];
-	char Reserved1[128];
-	char Reserved2[128];
-} RecordSubTitle;
+	private:
+		CSalesRecorderEntity *m_pEntity;
+	};
 
 
-class CSalesRecorderEntity;
-	
-class SalesRecordServiceSession : public SalesRecorderSerVice_ServerSessionBase
-{
-public:
-	explicit SalesRecordServiceSession(CSalesRecorderEntity *pEntity) : m_pEntity(pEntity){}
-	virtual void Handle_GetOFLVideoRecords(SpReqAnsContext<SalesRecorderSerVice_GetOFLVideoRecords_Req, SalesRecorderSerVice_GetOFLVideoRecords_Ans>::Pointer ctx);
-	virtual void Handle_CheckVideoDiskStatus(SpReqAnsContext<SalesRecorderSerVice_CheckVideoDiskStatus_Req, SalesRecorderSerVice_CheckVideoDiskStatus_Ans>::Pointer ctx);
-	virtual void Handle_PlayVideo(SpReqAnsContext<SalesRecorderSerVice_PlayVideo_Req, SalesRecorderSerVice_PlayVideo_Ans>::Pointer ctx);
-	virtual void Handle_SaveVideo(SpReqAnsContext<SalesRecorderSerVice_SaveVideo_Req, SalesRecorderSerVice_SaveVideo_Ans>::Pointer ctx);
-	virtual void Handle_StopRecord(SpReqAnsContext<SalesRecorderSerVice_StopRecord_Req, SalesRecorderSerVice_StopRecord_Ans>::Pointer ctx);
-	virtual void Handle_SetAudioTransFlag(SpReqAnsContext<SalesRecorderSerVice_SetAudioTransFlag_Req, SalesRecorderSerVice_SetAudioTransFlag_Ans>::Pointer ctx);
-	virtual void Handle_StopShowVideo(SpReqAnsContext<SalesRecorderSerVice_StopShowVideo_Req, SalesRecorderSerVice_StopShowVideo_Ans>::Pointer ctx);
-	virtual void Handle_PlaySalesRecord(SpReqAnsContext<SalesRecorderSerVice_PlaySalesRecord_Req, SalesRecorderSerVice_PlaySalesRecord_Ans>::Pointer ctx);
-	virtual void Handle_StartRemoteRecord(SpReqAnsContext<SalesRecorderSerVice_StartRemoteRecord_Req, SalesRecorderSerVice_StartRemoteRecord_Ans>::Pointer ctx);
-
-private:
-	CSalesRecorderEntity *m_pEntity;
-};
-
-
-class SelfChekerClient:public SelfChecker::SelfCheckerService_ClientBase
-{
-public:
-	explicit SelfChekerClient(CSalesRecorderEntity*pEntity);
-};
+	class SelfChekerClient:public SelfChecker::SelfCheckerService_ClientBase
+	{
+	public:
+		explicit SelfChekerClient(CSalesRecorderEntity*pEntity);
+	};
 
 #ifdef RVC_OS_WIN
 	class CSalesRecorderEntity : public CEntityBase, public CWmvHostApi, public CWmpHostApi, public ILogListener, public ISysVarListener, public ITimerListener
 #else
-	class CSalesRecorderEntity : public CEntityBase, public CWmvHostApi, public CMediaHostApi, public ILogListener, public ISysVarListener, public ITimerListener
+	class CSalesRecorderEntity : public CEntityBase, public CHostApi, public CMediaHostApi, public ILogListener, public ISysVarListener, public ITimerListener
 #endif // RVC_OS_WIN
 	{
 	public:
@@ -135,9 +135,9 @@ public:
 
 		void StartOnSiteSalesRecord(const int fps, const char* wmvfilename, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam, BOOL bWholeSection, BOOL bSessionManage, eRvcRecordType eRecordType);
 		
-		BOOL GetStandardQualityOnSiteSalesRecorder();
+		bool GetStandardQualityOnSiteSalesRecorder();
 		
-		BOOL GetHighQualityOnSiteSalesRecorder();
+		bool GetHighQualityOnSiteSalesRecorder();
 		
 		ErrorCodeEnum StopRecord();
 		
@@ -176,8 +176,8 @@ public:
 		ErrorCodeEnum HandleStopShowVideo();
 		ErrorCodeEnum HandlePlaySalesRecordVideo(int iWndX, int iWndY, int iWndWidth, int iWndHeight);
 
-		BOOL InitSalesRecorder();
-		BOOL ReleaseSalesRecorder();
+		bool InitSalesRecorder();
+		bool ReleaseSalesRecorder();
 
 	private:
 		DeviceTypeEnum m_eDeviceType;
@@ -191,28 +191,30 @@ public:
 #else
 		//Clibmediaplayer* m_pPlayer;
 #endif // RVC_OS_WIN
-		BOOL m_bIsShowVideo;
+		bool m_bIsShowVideo;
 		CAutoArray<CUUID> m_arrListener;
 		char m_SalesVideoName[MAX_PATH];
 		int  m_nSysCallType;                
-		BOOL m_bStarted;
-		Clibwmvrecord *m_pRecorder;
+		bool m_bStarted;
+		Clibvideorecord *m_pRecorder;
 
 		CSimpleStringA m_terminalNo;        
 		CSimpleStringA m_TempDir;			
 		CSimpleStringA m_RecordSaveDir;		
 
-		BOOL m_last_disk_overtop;		    // 最近一次磁盘检查是否占用过高 add by ly at 2018/02/24
+		bool m_last_disk_overtop;		    // 最近一次磁盘检查是否占用过高 add by ly at 2018/02/24
 		int m_max_disk_percent;			    // 磁盘最大占用百分比 add by ly at 2018/02/24
 		int m_audio_samplerate;             // 音频采样率 add by ly at 2018/06/13
 		int m_audio_out_bitrate;            // 音频输出比特率 add by ly at 2018/06/07
-		BOOL m_bWholeSection;               // 是否录一整段像 add by ly at 2018/06/07
+		bool m_bWholeSection;               // 是否录一整段像 add by ly at 2018/06/07
 
-		BOOL m_bApplyHighQuality;           // 是否应用高质量 add by ly@2019/04/18
-		BOOL m_bEwsRecord;                  // 是否使用广角摄像头双录 add by ly@2019/04/18
+		bool m_bApplyHighQuality;           // 是否应用高质量 add by ly@2019/04/18
+		bool m_bEwsRecord;                  // 是否使用广角摄像头双录 add by ly@2019/04/18
 
 		eAudioOutPutType m_eAudioOutQuality;
 		bool m_bIsAudioNsOn;
 		int m_iAudioNsPolicy;
 		friend class SalesRecordServiceSession;
+		eVideoFormat m_eRecordType;
 	};
+}

+ 4 - 5
Other/libvideorecord/libvideorecord.cpp

@@ -1,7 +1,6 @@
-// libwmvrecord.cpp : 定义 DLL 应用程序的导出函数。
+// libvideorecord.cpp : 定义 DLL 应用程序的导出函数。
 //
 
-//#include "stdafx.h"
 #include "libvideorecord.h"
 #include "libvideorecord_impl.h"
 
@@ -64,15 +63,15 @@ bool Clibvideorecord::ReNameVideoFile(const char*newfilename)
 	return true;
 }
 
-bool Clibvideorecord::SetRightVideoWaterMark(char* strWaterMark)
+bool Clibvideorecord::SetRightVideoWaterMark(wchar_t* strWaterMark)
 {
 	bool bRet = false;
 	if (NULL == strWaterMark){
 		return bRet;
 	}
 
-	size_t ulen = strlen(strWaterMark);
-	m_pImpl->setRightWaterMark(strWaterMark, ulen);
+	size_t ulen = wcslen(strWaterMark);
+	bRet = m_pImpl->setRightWaterMark(strWaterMark, ulen * sizeof(wchar_t));
 
 	return bRet;
 }

+ 4 - 4
Other/libvideorecord/libvideorecord.h

@@ -103,9 +103,9 @@ typedef struct
 	bool bSubtitle;
 	bool bSubtitleSection;
 	char topSubtitleData[MAX_PATH];
-	char bottomSubtitleData1[MAX_PATH];
-	char bottomSubtitleData2[MAX_PATH];
-	char strRightAgentInfo[MAX_PATH];
+	wchar_t bottomSubtitleData1[MAX_PATH];
+	wchar_t bottomSubtitleData2[MAX_PATH];
+	wchar_t strRightAgentInfo[MAX_PATH];
 } SubtitleParam;
 
 enum eRvcRecordFailedCase{
@@ -161,7 +161,7 @@ public:
 	bool StopVideoRecord();			//退出
 	void CloseVideoFile();			//结束当前录像
 	bool ReNameVideoFile(const char*newfilename);         //session变化,修改当前录像文件名
-	bool SetRightVideoWaterMark(char* strWaterMark);	  //设置拼接后右侧视频的水印
+	bool SetRightVideoWaterMark(wchar_t* strWaterMark);	  //设置拼接后右侧视频的水印
 
 	bool PauseRecord();				//暂停录像
 	bool ContinueRecord();			//继续录像

+ 16 - 15
Other/libvideorecord/libvideorecord_impl.cpp

@@ -1320,50 +1320,50 @@ bool libvideorecord_impl::AddCvxText(unsigned char** pData, int iDataSize, int i
 {
 	bool bRet = false;
 
-	char timeSubtitle[MAX_PATH] = { 0 };
+	wchar_t timeSubtitle[MAX_PATH] = { 0 };
 	const char* weekDict[] = { "日","一","二","三","四","五","六" };
 	SYSTEMTIME st;
 
 	IplImage* pImg = cvCreateImage(cvSize(iWidth, iHeight), IPL_DEPTH_8U, 3);
 	memcpy(pImg->imageData, *pData, iDataSize);
-	cvFlip(pImg); // 先把图像翻转
+	//cvFlip(pImg); // 先把图像翻转
 	if (strlen(m_SubtitleParam.topSubtitleData) <= 0) {
 		if (m_SubtitleParam.bSubtitleSection) {
 			GetLocalTimeRVC(st);
-			snprintf(timeSubtitle, MAX_PATH, "%4d年%02d月%02d日 星期%s %02d:%02d:%02d", st.wYear,
+			swprintf(timeSubtitle, MAX_PATH, L"%4d年%02d月%02d日 星期%s %02d:%02d:%02d", st.wYear,
 				st.wMonth, st.wDay, weekDict[st.wDayOfWeek], st.wHour, st.wMinute, st.wSecond);
 		}
 		else {
 			GetLocalTimeRVC(st);
-			sprintf_s(timeSubtitle, MAX_PATH, "%4d/%02d/%02d %02d:%02d:%02d", st.wYear,
+			swprintf(timeSubtitle, MAX_PATH, L"%4d/%02d/%02d %02d:%02d:%02d", st.wYear,
 				st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);
 		}
-		m_pText->putText(pImg, timeSubtitle, cvPoint(10, 12));
+		m_pText->putText(pImg, timeSubtitle, cvPoint(10, 42));
 		//m_pHostApi->Debug(RECORD_LOG_INFO, "水印信息为:%s.", timeSubtitle);
 	}
 	else {
-		m_pText->putText(pImg, m_SubtitleParam.topSubtitleData, cvPoint(10, 12));
+		m_pText->putText(pImg, m_SubtitleParam.topSubtitleData, cvPoint(10, 42));
 	}
 
-	if (strlen(m_SubtitleParam.bottomSubtitleData1) > 0) {
-		m_pText->putText(pImg, m_SubtitleParam.bottomSubtitleData1, cvPoint(10, pImg->height - 17));
+	if (wcslen(m_SubtitleParam.bottomSubtitleData1) > 0) {
+		m_pText->putText(pImg, m_SubtitleParam.bottomSubtitleData1, cvPoint(10, pImg->height - 47));
 	}
 
-	if (strlen(m_SubtitleParam.bottomSubtitleData2) > 0) {
-		m_pText->putText(pImg, m_SubtitleParam.bottomSubtitleData2, cvPoint(10, pImg->height - 3));
+	if (wcslen(m_SubtitleParam.bottomSubtitleData2) > 0) {
+		m_pText->putText(pImg, m_SubtitleParam.bottomSubtitleData2, cvPoint(10, pImg->height - 23));
 	}
 
 	//拼接后的右侧视频添加坐席信息
-	if (strlen(m_SubtitleParam.strRightAgentInfo) > 0) {
+	if (wcslen(m_SubtitleParam.strRightAgentInfo) > 0) {
 		if (eStand2Agent == m_eRecordType) {
-			m_pText->putText(pImg, m_SubtitleParam.strRightAgentInfo, cvPoint(10 + 640, pImg->height - 17));
+			m_pText->putText(pImg, m_SubtitleParam.strRightAgentInfo, cvPoint(10 + 640, pImg->height - 47));
 		}
 		else {
-			m_pText->putText(pImg, m_SubtitleParam.strRightAgentInfo, cvPoint(10 + 320, pImg->height - 17));
+			m_pText->putText(pImg, m_SubtitleParam.strRightAgentInfo, cvPoint(10 + 320, pImg->height - 47));
 		}
 	}
 
-	cvFlip(pImg); // 添完字幕再翻转
+	//cvFlip(pImg); // 添完字幕再翻转
 	memcpy(*pData, pImg->imageData, iDataSize);
 	cvReleaseImage(&pImg);
 
@@ -1576,7 +1576,7 @@ bool libvideorecord_impl::ReceiveRecordAudioData(unsigned char* pData, unsigned
 }
 
 
-bool libvideorecord_impl::setRightWaterMark(char* strWaterMark, size_t ulen)
+bool libvideorecord_impl::setRightWaterMark(wchar_t* strWaterMark, size_t ulen)
 {
 	bool bRet = false;
 	memset(m_SubtitleParam.strRightAgentInfo, 0, MAX_PATH);
@@ -1584,6 +1584,7 @@ bool libvideorecord_impl::setRightWaterMark(char* strWaterMark, size_t ulen)
 		memcpy(m_SubtitleParam.strRightAgentInfo, strWaterMark, ulen);
 		bRet = true;
 	}
+
 	return bRet;
 }
 

+ 1 - 1
Other/libvideorecord/libvideorecord_impl.h

@@ -39,7 +39,7 @@ public:
 	bool PauseRecord();				//暂停录像
 	bool ContinueRecord();			//继续录像
 	void ChangeFilename(const char* newfilename);
-	bool setRightWaterMark(char* strWaterMark, size_t ulen);
+	bool setRightWaterMark(wchar_t* strWaterMark, size_t ulen);
 	bool EndRecord();
 	void Debug(const char* fmt, ...);
 	void vDebug(const char* str, va_list list);