瀏覽代碼

Z991239-3624 #comment 优化图像渲染流程

80274480 3 年之前
父節點
當前提交
6eb5a1ccda
共有 34 個文件被更改,包括 239 次插入2167 次删除
  1. 0 115
      Module/mod_SalesRecorder/UploadOFLRecord.cpp
  2. 0 67
      Module/mod_SalesRecorder/UploadOFLRecord.h
  3. 77 695
      Module/mod_SalesRecorder/mod_SalesRecorder.cpp
  4. 15 61
      Module/mod_SalesRecorder/mod_SalesRecorder.h
  5. 0 59
      Module/mod_SalesRecorder/mod_SalesRecorder.vcxproj.filters
  6. 0 24
      Module/mod_SalesRecorder/offline_video_record_t.cpp
  7. 0 26
      Module/mod_SalesRecorder/offline_video_record_t.h
  8. 3 3
      Module/mod_assistantchannel/VideoDesc.h
  9. 4 4
      Module/mod_counterconnector/ConnectorFSM.cpp
  10. 10 10
      Module/mod_counterconnector/callrouter.cpp
  11. 1 1
      Module/mod_counterconnector/mod_counterconnector.cpp
  12. 1 1
      Module/mod_counterconnector/strutil.cpp
  13. 1 1
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  14. 2 2
      Module/mod_livenessdetection/RvcFaceCapturer.cpp
  15. 1 1
      Module/mod_localmediaplay/AdvertManage/BaseFun.cpp
  16. 5 5
      Module/mod_localmediaplay/mod_localmediaplay.cpp
  17. 1 1
      Module/mod_recorder/mod_recorder.cpp
  18. 1 1
      Module/mod_sipphone/audio_session.cpp
  19. 11 13
      Module/mod_sipphone/endpoint.cpp
  20. 21 12
      Module/mod_sipphone/mod_sipphone.cpp
  21. 13 28
      Module/mod_sipphone/video_render.cpp
  22. 2 1
      Module/mod_sipphone/video_render.h
  23. 8 286
      Module/mod_sipphone/video_session.cpp
  24. 0 1
      Other/CMakeLists.txt
  25. 0 55
      Other/libaudiotransqueue/CMakeLists.txt
  26. 0 48
      Other/libaudiotransqueue/ReadMe.txt
  27. 0 19
      Other/libaudiotransqueue/dllmain.cpp
  28. 0 321
      Other/libaudiotransqueue/libaudiotransqueue.cpp
  29. 0 54
      Other/libaudiotransqueue/libaudiotransqueue.h
  30. 0 111
      Other/libaudiotransqueue/libaudiotransqueue.vcxproj
  31. 0 1
      Other/libvideoframework/video_common/videoutil.c
  32. 0 4
      Other/libwmvrecord/CMakeLists.txt
  33. 2 1
      Other/libwmvrecord/FFmpegWriter.h
  34. 60 135
      Other/libwmvrecord/libwmvrecord.cpp

+ 0 - 115
Module/mod_SalesRecorder/UploadOFLRecord.cpp

@@ -1,115 +0,0 @@
-#include "stdafx.h"
-#include "UploadOFLRecord.h"
-#include "mod_SalesRecorder.h"
-using namespace SalesRecorder;
-
-void CUploadOFLRecordConnection::SendOFLVideoRecord(offline_video_record_t *offlinevideorecord)
-{
-	SaveOfflineVideoReq req = {0};
-	strcpy(req.TerminalNo,offlinevideorecord->TerminalNo);
-	strcpy(req.VideoSerialID,offlinevideorecord->VideoSerialID);
-	//strcpy(req.EndTime,offlinevideorecord->EndTime);
-	strcpy(req.CardNo,offlinevideorecord->CardNo);
-	strcpy(req.Name,offlinevideorecord->Name);
-	strcpy(req.ProductCode,offlinevideorecord->ProductCode);
-	strcpy(req.ProductName,offlinevideorecord->ProductName);
-	strcpy(req.ManagerSAP,offlinevideorecord->ManagerSAP);
-	strcpy(req.ManagerName,offlinevideorecord->ManagerName);
-	strcpy(req.ProductType,offlinevideorecord->ProductType);
-	strcpy(req.BusinessType,offlinevideorecord->BusinessType);
-	strcpy(req.CompanyCode,offlinevideorecord->CompanyCode);
-	strcpy(req.WitnessSAP,offlinevideorecord->WitnessSAP);
-	strcpy(req.WitnessName,offlinevideorecord->WitnessName);
-	req.Duration = offlinevideorecord->Duration;
-	CSmartPointer<IPackage> pkt = CreateNewPackage("SOVREQ");
-	pkt->AddStruct("SOVREQ",false,false,(LPBYTE)&req,sizeof(SaveOfflineVideoReq));
-	SendPackage(pkt);
-}
-
-void CUploadOFLRecordConnection::SendOFLVideoRecords(std::vector<offline_video_record_t *> &offlinevideorecordlist)
-{
-	SaveOfflineVideoReq reqs[MAX_LISTSIZE];
-	int nArrayNum = offlinevideorecordlist.size();
-	for (std::vector<offline_video_record_t *>::size_type i = 0; i < nArrayNum; ++i)
-	{
-		offline_video_record_t *pRecord = offlinevideorecordlist[i];
-		ZeroMemory(&reqs[i], sizeof(SaveOfflineVideoReq));
-		strcpy(reqs[i].TerminalNo,pRecord->TerminalNo);
-		strcpy(reqs[i].VideoSerialID,pRecord->VideoSerialID);
-		//strcpy(reqs[i].EndTime,pRecord->EndTime);
-		strcpy(reqs[i].CardNo,pRecord->CardNo);
-		strcpy(reqs[i].Name,pRecord->Name);
-		strcpy(reqs[i].ProductCode,pRecord->ProductCode);
-		strcpy(reqs[i].ProductName,pRecord->ProductName);
-		strcpy(reqs[i].ManagerSAP,pRecord->ManagerSAP);
-		strcpy(reqs[i].ManagerName,pRecord->ManagerName);
-		strcpy(reqs[i].ProductType,pRecord->ProductType);
-		strcpy(reqs[i].BusinessType,pRecord->BusinessType);
-		strcpy(reqs[i].CompanyCode,pRecord->CompanyCode);
-		strcpy(reqs[i].WitnessSAP,pRecord->WitnessSAP);
-		strcpy(reqs[i].WitnessName,pRecord->WitnessName);
-		reqs[i].Duration = pRecord->Duration;
-	}
-	CSmartPointer<IPackage> pkt = CreateNewPackage("SOVREQ");
-	pkt->AddStruct("SOVREQ",false,false,(LPBYTE)&reqs,sizeof(SaveOfflineVideoReq)*nArrayNum,nArrayNum);
-	SendPackage(pkt);
-}
-
-void CUploadOFLRecordConnection::OnDisconnect()
-{
-	Dbg("connection disconnected");
-}
-
-void CUploadOFLRecordConnection::OnPkgAnswer(const CSmartPointer<IPackage> &pRecvPkg)
-{
-	string serviceCode = pRecvPkg->GetServiceCode();
-	if (serviceCode == "SOVREQ")
-	{
-		CSalesRecorderEntity *pEntity = dynamic_cast<CSalesRecorderEntity *>(m_pEntity);
-		pEntity->m_nUploadResult = -1;
-		DWORD dwSysCode, dwUserCode;
-		string strErrMsg;
-		ErrorCodeEnum rc = Error_Succeed;
-		if (pRecvPkg->GetErrMsg(dwSysCode, dwUserCode, strErrMsg))
-		{
-			rc = (ErrorCodeEnum)dwSysCode;
-			LogError(Severity_Middle, rc, dwUserCode, CSimpleStringA::Format("create sov packet fail! %s", strErrMsg.c_str()));
-			OnDisconnect();
-		}
-		else
-		{
-			int nLen = pRecvPkg->GetStructLen("SOVANS");
-			if (nLen > 0)
-			{
-				BYTE *pBuf = new BYTE[nLen];
-				memset(pBuf, 0, nLen);
-				int nArrayNum = 0;
-				if (pRecvPkg->GetStructData("SOVANS", pBuf, &nLen, &nArrayNum))
-				{
-					for (int i = 0; i < nArrayNum; ++i)
-					{
-						// TODO: need to post an event
-						SaveOfflineVideoReply reply;
-						ZeroMemory(&reply, sizeof(SaveOfflineVideoReply));
-						memcpy(&reply, pBuf+i*sizeof(SaveOfflineVideoReply), sizeof(SaveOfflineVideoReply));
-						pEntity->OnEndUploadRecord(reply.VideoSerialID, reply.ResultCode);
-					}
-				} 
-				else
-				{
-					Dbg("create invalid sovans packet!");
-					OnDisconnect();
-				}
-				delete []pBuf;
-				pBuf = NULL;
-			}
-		}
-		//SetEvent(pEntity->m_hUploadAnsEvt);
-		pEntity->SecureClientRelease(); // ¶Ï¿ªÁ¬½Ó
-	}
-	else
-	{
-		Dbg("unknown service code!");
-		OnDisconnect();
-	}
-}

+ 0 - 67
Module/mod_SalesRecorder/UploadOFLRecord.h

@@ -1,67 +0,0 @@
-#pragma once
-#include "SpSecureClient.h"
-#include "offline_video_record_t.h"
-
-namespace SalesRecorder {
-#define MAX_LISTSIZE 50            // 离线双录一次最大提交笔数  add by ly 2018/02/13
-
-#pragma pack(1)
-	//[StructName("SOVREQ")]
-	struct SaveOfflineVideoReq
-	{
-		char TerminalNo[16];
-		char VideoSerialID[20];
-		//char EndTime[20];
-		char CardNo[32];
-		char Name[32];
-		char ProductCode[32];
-		char ProductName[128];
-		char ManagerSAP[12];
-		char ManagerName[32];
-		char ProductType[12];
-		char BusinessType[12];
-		char CompanyCode[8];
-		char WitnessSAP[12];
-		char WitnessName[32];
-		int Duration;
-	};
-
-	//[StructName("SOVANS")]
-	struct SaveOfflineVideoReply
-	{
-		char TerminalNo[16];
-		char VideoSerialID[20];
-		int ResultCode;
-	};
-
-	struct OFLVideoRecord
-	{
-		char VideoSerialID[20];
-		char BeginTime[20];
-		char CardNo[32];
-		char Name[32];
-		char ProductCode[32];
-		char ProductName[128];
-		char ManagerSAP[12];
-		char ManagerName[32];
-		char ProductType[12];
-		char BusinessType[12];
-		char CompanyCode[8];
-		char WitnessSAP[12];
-		char WitnessName[32];
-		int Duration;
-	};
-
-	class CUploadOFLRecordConnection : public SpSecureClient
-	{
-	public:
-		explicit CUploadOFLRecordConnection(CEntityBase *pEntity) : SpSecureClient(pEntity) {}
-		void SendOFLVideoRecord(offline_video_record_t *offlinevideorecord);
-		void SendOFLVideoRecords(std::vector<offline_video_record_t *> &offlinevideorecordlist);
-	protected:
-		virtual ~CUploadOFLRecordConnection() { /*empty implementation*/ }
-		virtual void OnDisconnect();
-		virtual void OnPkgAnswer(const CSmartPointer<IPackage> &pRecvPkg);
-	};
-}
-

File diff suppressed because it is too large
+ 77 - 695
Module/mod_SalesRecorder/mod_SalesRecorder.cpp


+ 15 - 61
Module/mod_SalesRecorder/mod_SalesRecorder.h

@@ -13,7 +13,6 @@
 #include "libmediaplayer/libmediaplayer.h"
 #endif // RVC_OS_WIN
 #include "libwmvrecord/libwmvrecord.h"
-#include "UploadOFLRecord.h"
 #include "EventCode.h"
 
 #include "SalesRecorder_server_g.h"
@@ -70,7 +69,7 @@ using namespace SalesRecorder;
 #endif // RVC_OS_WIN
 	{
 	public:
-		CSalesRecorderEntity(): m_pRecorder(NULL), m_bStarted(FALSE), m_pPlayer(NULL),  m_bIsShowVideo(FALSE), m_pConnection(NULL) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
+		CSalesRecorderEntity(): m_pRecorder(NULL), m_bStarted(FALSE), m_pPlayer(NULL),  m_bIsShowVideo(FALSE) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
 		virtual ~CSalesRecorderEntity() { /*empty implementation*/ }
 
 		virtual const char *GetEntityName() const { return "SalesRecorder"; }
@@ -126,24 +125,21 @@ using namespace SalesRecorder;
 			const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID, 
 			const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage);
 
-
 		ErrorCodeEnum DecideCameraCount(int &nCount);
 
 		void StartRecord(const char *wmvfilename, int videoquality, int audioOutBitRate, SubtitleParam *subtitleParam = NULL, BOOL bWholeSection = FALSE, BOOL bSessionManage = FALSE, eRvcRecordType eRecordType = eSingleSide);
 
-		void StartPhone2PadRecord(const int fps, const char* wmvfilename, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam, BOOL bWholeSection, BOOL bSessionManage, eRvcRecordType eRecordType);
-
 		void StartOnSiteSalesRecord(const int fps, const char* wmvfilename, int videoquality, int audioOutBitRate, SubtitleParam* subtitleParam, BOOL bWholeSection, BOOL bSessionManage, eRvcRecordType eRecordType);
-
-		BOOL GetStandardQualityOnSiteSalesRecorder(const eRvcRecordType eRecordType);
-
-		BOOL GetHighQualityOnSiteSalesRecorder(const eRvcRecordType eRecordType);
-
+		
+		BOOL GetStandardQualityOnSiteSalesRecorder();
+		
+		BOOL GetHighQualityOnSiteSalesRecorder();
+		
 		ErrorCodeEnum StopRecord();
-
+		
 		ErrorCodeEnum ShowVideo(const char *wmvfilename);
+		
 		ErrorCodeEnum PlaySalesRecordVideo(const char *wmvfilename, int iWndX, int iWndY, int iWndWidth, int iWndHeight);
-		void DeleteAllVideo(const char *wmvfilename);
 
 		void DeleteVideo(const char *wmvfilename);
 
@@ -155,44 +151,22 @@ using namespace SalesRecorder;
 		// 获取终端准入状态(这个系统变量为A是表示准入通过)
 		CSimpleStringA GetTerminalStage();
 
-		ErrorCodeEnum LoadServerConfig();
-
 		bool SecureClientConnect();
 
 		void SecureClientRelease();
 
-		void OnEndUploadRecord(const char *videoserialid, int result);
-
 		ErrorCodeEnum StopRecordVideo();
 
-		// 初始化离线双录记录
-		BOOL OFLRecordInit(char *pszVideoParam[]);
-
-		// 保存离线双录时长
-		void SaveOFLRecordDuration(int nDuration);
-
-		// 提交离线双录记录
-		void UploadOFLVideoRecord(const char *videorecordname);
-
-		// 获取待上传的离线双录记录(返回给用户桌面)
-		CSimpleStringW GetOFLVideoRecords(CSimpleStringA Name, CSimpleStringA CardNo, CSimpleStringA BeginTime, CSimpleStringA EndTime);
-
-		//add by clp 20190919
-		//void HandleStartRecord(const char *pszMessage);
 		ErrorCodeEnum HandleStopRecord(const char *pszMessage);
 		ErrorCodeEnum HandleDisplayVideo();
 		ErrorCodeEnum HandleSaveVideo();
 		void HandleDeleteVideo();
-		void HandleReturnMenu();
-		void HandleUkeyPullout();
 		void HandleVideoAppendWatermark(const char* pszMessage);
 		void HandleStartRecord(const char *pszMessage, const bool bRemoteRecord);
 		ErrorCodeEnum HandleSalesRecordEntityException(const char* pszMessage);
 		ErrorCodeEnum RealSelfCheck();
 
 		void UploadTempPathVideos();
-		int GetSystemMemoryUsage();
-		double GetSystemCpuUsage();
 		ErrorCodeEnum SetRecordAudioQuality(int iAudioQuality);
 		ErrorCodeEnum SetRecordAudioNsPolicy(int iNsPolicy);
 
@@ -203,6 +177,9 @@ using namespace SalesRecorder;
 		ErrorCodeEnum HandleStopShowVideo();
 		ErrorCodeEnum HandlePlaySalesRecordVideo(int iWndX, int iWndY, int iWndWidth, int iWndHeight);
 
+		BOOL InitSalesRecorder();
+		BOOL ReleaseSalesRecorder();
+
 		int m_nUploadResult;				// 上传结果 -1:调用失败 0:上传失败 1:上传成功  add by ly 20180213
 	private:
 		DeviceTypeEnum m_eDeviceType;
@@ -219,20 +196,13 @@ using namespace SalesRecorder;
 		BOOL m_bIsShowVideo;
 		CAutoArray<CUUID> m_arrListener;
 		char m_SalesVideoName[MAX_PATH];
-		int  m_nSysCallType;                //0:普通模式,1:手机模式  add by chh 20170320    
+		int  m_nSysCallType;                
 		BOOL m_bStarted;
 		Clibwmvrecord *m_pRecorder;
 
-		CSimpleStringA m_terminalNo;        // 设备终端号   add by ly 20180213
-		CSimpleStringA m_TempDir;			// 录像临时目录 add by ly 20180213
-		CSimpleStringA m_RecordSaveDir;		// 录像上传目录 add by ly 20180213
-
-		CUploadOFLRecordConnection *m_pConnection;
-
-		CSimpleStringA m_server1;           // 分行服务地址(主) add by ly 20170320 add by ly 20180213
-		int m_server1_port;                 // 分行服务端口(主) add by ly 20170320 add by ly 20180213
-		CSimpleStringA m_server2;           // 分行服务地址(备) add by ly 20170320 add by ly 20180213
-		int m_server2_port;                 // 分行服务端口(备) add by ly 20170320 add by ly 20180213
+		CSimpleStringA m_terminalNo;        
+		CSimpleStringA m_TempDir;			
+		CSimpleStringA m_RecordSaveDir;		
 
 		BOOL m_last_disk_overtop;		    // 最近一次磁盘检查是否占用过高 add by ly at 2018/02/24
 		int m_max_disk_percent;			    // 磁盘最大占用百分比 add by ly at 2018/02/24
@@ -247,23 +217,7 @@ using namespace SalesRecorder;
 		bool m_bIsAudioNsOn;
 		int m_iAudioNsPolicy;
 		bool m_bIsAudioTransOn;
-
-		friend class CUploadOFLRecordConnection;
 		friend class SalesRecordServiceSession;
-
-		__int64  m_xIdlePre,m_xKernelPre,m_xUserPre;
-	};
-
-	struct UploadOFLVideoRecordTask : public ITaskSp
-	{
-		explicit UploadOFLVideoRecordTask(CSalesRecorderEntity* pEntity) 
-			: m_pEntity(pEntity) {}
-
-		void Process();
-
-	private:
-		CSalesRecorderEntity* m_pEntity;
 	};
 
-
 #endif

+ 0 - 59
Module/mod_SalesRecorder/mod_SalesRecorder.vcxproj.filters

@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="源文件">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="头文件">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="资源文件">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="mod_SalesRecorder.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="SalesRecorder_client_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="SalesRecorder_def_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="SalesRecorder_server_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="offline_video_record_t.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="UploadOFLRecord.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="$(FrameworkHeadRoot)\Common\stdafx.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="mod_SalesRecorder.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="offline_video_record_t.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="UploadOFLRecord.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="$(FrameworkHeadRoot)\Common\stdafx.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\Version.rc">
-      <Filter>资源文件</Filter>
-    </ResourceCompile>
-  </ItemGroup>
-</Project>

+ 0 - 24
Module/mod_SalesRecorder/offline_video_record_t.cpp

@@ -1,24 +0,0 @@
-#include "stdafx.h"
-#include "offline_video_record_t.h"
-#include <memutil.h>
-
-namespace SalesRecorder {
-	void offline_video_record_destroy( offline_video_record_t *record )
-	{
-		if (record != NULL)
-		{
-			toolkit_free(record->TerminalNo);
-			toolkit_free(record->VideoSerialID);
-			//toolkit_free(record->EndTime);
-			toolkit_free(record->CardNo);
-			toolkit_free(record->Name);
-			toolkit_free(record->ProductCode);
-			toolkit_free(record->ProductName);
-			toolkit_free(record->ManagerSAP);
-			toolkit_free(record->ManagerName);
-			toolkit_free(record->ProductType);
-			toolkit_free(record);
-			record = NULL;
-		}
-	}
-}

+ 0 - 26
Module/mod_SalesRecorder/offline_video_record_t.h

@@ -1,26 +0,0 @@
-#pragma once
-
-namespace SalesRecorder {
-	typedef struct offline_video_record_t offline_video_record_t;
-
-	struct offline_video_record_t
-	{
-		char *TerminalNo;
-		char *VideoSerialID;
-		//char *EndTime;
-		char *CardNo;
-		char *Name;
-		char *ProductCode;
-		char *ProductName;
-		char *ManagerSAP;
-		char *ManagerName;
-		char *ProductType;
-		char *BusinessType;
-		char *CompanyCode;
-		char *WitnessSAP;
-		char *WitnessName;
-		int Duration;
-	};
-
-	void offline_video_record_destroy(offline_video_record_t *record);
-}

+ 3 - 3
Module/mod_assistantchannel/VideoDesc.h

@@ -51,7 +51,7 @@ static inline CSimpleStringA BuildVideoViewParam(int local_view_x, int local_vie
 static inline CSimpleStringA BuildVideoDesc(const char *remote_ip, int remote_video_rtp, int remote_video_width, int remote_video_height, int remote_video_fps, int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy)
 {
 	char param[512] = {0};
-	_snprintf(param, 512, 
+	snprintf(param, 512, 
 		"remote_ip:%s\r\n"
 		"remote_video_rtp:%d\r\n"
 		"remote_video_width:%d\r\n"
@@ -102,7 +102,7 @@ static inline ErrorCodeEnum ParseVideoDesc(const char *param, CSimpleStringA &re
 static inline CSimpleStringA BuildVideoRenderDesc(int local_view_x, int local_view_y, int local_view_cx, int local_view_cy)
 {
 	char param[512] = { 0 };
-	_snprintf(param, 512,
+	snprintf(param, 512,
 		"local_view_x:%d\r\n"
 		"local_view_y:%d\r\n"
 		"local_view_cx:%d\r\n"
@@ -118,7 +118,7 @@ static inline CSimpleStringA BuildVideoRenderDesc(int local_view_x, int local_vi
 static inline CSimpleStringA BuildDoubleVideoRenderDesc(int local_view_x, int local_view_y, int local_view_cx, int local_view_cy, int remote_view_x, int remote_view_y, int remote_view_cx, int remote_view_cy)
 {
 	char param[512] = { 0 };
-	_snprintf(param, 512,
+	snprintf(param, 512,
 		"local_view_x:%d\r\n"
 		"local_view_y:%d\r\n"
 		"local_view_cx:%d\r\n"

+ 4 - 4
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -111,7 +111,7 @@ public:
 			if (ePhone_Terminated == Msg.state){
 				if (!m_bSipConnected){
 					char strmsg[MAX_PATH] = { 0 };
-					_snprintf(strmsg, MAX_PATH, "sip connect failed for %s.", Msg.status.GetData());
+					snprintf(strmsg, MAX_PATH, "sip connect failed for %s.", Msg.status.GetData());
 					LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_SIP_CONNECT_FAILED,strmsg);
 				}
 			}
@@ -384,14 +384,14 @@ void ACMCallFSM::OnStateTrans(int iSrcState, int iDstState)
 			{
 				if (eState_Fail != st1 || eState_Connecting != st2){
 					char strmsg[MAX_PATH] = {0};
-					_snprintf(strmsg, MAX_PATH,"Broadcast state from %d to %d", st1, st2);
+					snprintf(strmsg, MAX_PATH,"Broadcast state from %d to %d", st1, st2);
 					Dbg(strmsg);
 					SpSendBroadcast(GetEntityBase()->GetFunction(), SP_MSG_OF(PhoneState), SP_MSG_SIG_OF(PhoneState), evt);
 					LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_BROADCAST_CALL_STATE, strmsg);
 				} 
 				else{
 					char strinfo[MAX_PATH] = {0};
-					_snprintf(strinfo, MAX_PATH,"state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2);
+					snprintf(strinfo, MAX_PATH,"state from %d to %d, auto reconnect, not broadcast state to ui.", st1, st2);
 					LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_AUTO_RECONNECT,strinfo);
 				}
 
@@ -682,7 +682,7 @@ void ACMCallFSM::s11_on_entry()
 				m_nCurChanServer = BACK_SERVER;
 				node->bused = TRUE;
 				char strmsg[256] = { 0 };
-				_snprintf(strmsg, 256, "head office make call result:0x%08x", Error);
+				snprintf(strmsg, 256, "head office make call result:0x%08x", Error);
 				LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_HEADOFFICE_CALL, strmsg);
 				center_connect = TRUE;
 			}	

+ 10 - 10
Module/mod_counterconnector/callrouter.cpp

@@ -53,7 +53,7 @@ static int get_sys_time(char* pDst, size_t iLen)
 	time_t tt;
 	time(&tt);
 	t = localtime(&tt);
-	_snprintf(pDst, iLen, "%04d%02d%02d%02d%02d%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
+	snprintf(pDst, iLen, "%04d%02d%02d%02d%02d%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
 #endif
 	iret = strlen(pDst);
 	return iret;
@@ -113,7 +113,7 @@ static int request_voipgateway_address(call_info_t *call_info, proxy_rsp_packet_
 		sa.sin_port = htons(call_info->callroute_server_port);
 		memset(sa.sin_zero, 0, sizeof(sa.sin_zero));
 		char strmsg[256] = { 0 };
-		_snprintf(strmsg, 256, "dest route addr is %s:%d.", call_info->callroute_server_ip.GetData(), call_info->callroute_server_port);
+		snprintf(strmsg, 256, "dest route addr is %s:%d.", call_info->callroute_server_ip.GetData(), call_info->callroute_server_port);
 		LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_ADDRESS, strmsg);
 		//控制为非阻塞方式
 #ifdef RVC_OS_WIN
@@ -155,7 +155,7 @@ static int request_voipgateway_address(call_info_t *call_info, proxy_rsp_packet_
 			close(client_socket);
 #endif // RVC_OS_WIN
 			char strerror[256];
-			_snprintf(strerror, 256, "request_voipgateway_address connect callroute server timeout(%d).", errno);
+			snprintf(strerror, 256, "request_voipgateway_address connect callroute server timeout(%d).", errno);
 			LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_CONNECT_FAILED, strerror);
 			return ret;      //超时
 		} 
@@ -203,7 +203,7 @@ static bool is_response_packet_valid(proxy_rsp_packet_t* packet_info)
 		    memcpy(tradefrom, packet_info->req_hdr.tradefrom, 3);
 			memcpy(requestcode, packet_info->req_hdr.requestcode, 16);
 			char strmsg[256] = { 0 };
-			_snprintf(strmsg, 256, "get mediaserver address from callroute server failed, rsp packgelen:%s, tradefrom:%s, requestcode:%s!", 
+			snprintf(strmsg, 256, "get mediaserver address from callroute server failed, rsp packgelen:%s, tradefrom:%s, requestcode:%s!", 
 				packgelen,tradefrom, requestcode);
 			LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_FAILED, strmsg);
 		}else{
@@ -273,17 +273,17 @@ static node_list_head_t *create_node_list_by_callernum(call_info_t *call_info, p
 					fifter_string(to_uri, RVC_DATALEN, dpname, '\'');
 					//to url 前面+8
 					if ('8' == dpname[0]){
-						_snprintf(new_touri, RVC_DATALEN, "%s%s", "sip:", to_uri);
+						snprintf(new_touri, RVC_DATALEN, "%s%s", "sip:", to_uri);
 					}
 					else{
-						_snprintf(new_touri, RVC_DATALEN, "%s%s%s", "sip:", "8", to_uri);
+						snprintf(new_touri, RVC_DATALEN, "%s%s%s", "sip:", "8", to_uri);
 					}
 					//new new_caller_id_number=callernum#assist_int_ip
 					get_interger_netaddr(strinterip, RVC_DATALEN, packet_info->rsp_body.video_content_ip);
-					_snprintf(new_caller_number, RVC_DATALEN, "%s%s%s",
+					snprintf(new_caller_number, RVC_DATALEN, "%s%s%s",
 						call_info->szcaller_num.GetData(), "#", strinterip);
 					char strmsg[256] = { 0 };
-					_snprintf(strmsg, 256,"new callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!", 
+					snprintf(strmsg, 256,"new callroute node: new_caller_number:%s new_touri:%s, assist_ip:%s, assist_port:%s!", 
 									new_caller_number, new_touri, packet_info->rsp_body.video_content_ip, packet_info->rsp_body.video_content_port);
 					LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_FAILED, strmsg);
 					add_node_to_list(phead, new_caller_number, new_touri, packet_info->rsp_body.video_content_ip, packet_info->rsp_body.video_content_port);
@@ -292,7 +292,7 @@ static node_list_head_t *create_node_list_by_callernum(call_info_t *call_info, p
 		}
 	}else{
 		char strerror[256] = { 0 };
-		_snprintf(strerror, 256, "create_node_list_by_callernum failed. szbranchno:%s, szcaller_num:%s, szdest_num:%s.", call_info->szbranchno.GetData(), call_info->szcaller_num.GetData(), call_info->szdest_num.GetData());
+		snprintf(strerror, 256, "create_node_list_by_callernum failed. szbranchno:%s, szcaller_num:%s, szdest_num:%s.", call_info->szbranchno.GetData(), call_info->szcaller_num.GetData(), call_info->szdest_num.GetData());
 		LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_FAILED, strerror);
 	}
 
@@ -317,7 +317,7 @@ node_list_head_t *get_callroute_list(call_info_t *call_info)
 	ret = request_voipgateway_address(call_info, &rsp_info, recvlen);
 	if (ret <= 0){
 		char strmsg[256] = { 0 };
-		_snprintf(strmsg, 256, "get_callroute_list failed szbranchno:%s, szcaller_num:%s, szdest_num:%s.", call_info->szbranchno.GetData(), call_info->szcaller_num.GetData(), call_info->szdest_num.GetData());
+		snprintf(strmsg, 256, "get_callroute_list failed szbranchno:%s, szcaller_num:%s, szdest_num:%s.", call_info->szbranchno.GetData(), call_info->szcaller_num.GetData(), call_info->szdest_num.GetData());
 		LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALLROUTE_FAILED, strmsg);
 		return NULL;
 	}

+ 1 - 1
Module/mod_counterconnector/mod_counterconnector.cpp

@@ -727,7 +727,7 @@ void ChannelCounterConnectorClient::OnMessage(ErrorCodeEnum Error, ChannelServic
 
 			if (eChannelState_Connected == m_eLastState){
 				char strmsg[MAX_PATH] = {0};
-				_snprintf(strmsg, MAX_PATH, "call connected time is %us.", y2k_time_now() - m_uConnectTime);
+				snprintf(strmsg, MAX_PATH, "call connected time is %us.", y2k_time_now() - m_uConnectTime);
 				LogWarn(Severity_Middle, Error_Debug, LOG_WARN_COUNTERCONNECT_CALL_CONNECT_TIME, strmsg);
 			}
 

+ 1 - 1
Module/mod_counterconnector/strutil.cpp

@@ -140,7 +140,7 @@ int connect_strings(char* strbuf, size_t ulen, const char* psrca, const char* ps
 	ulenstr = strlen(pstr);
 
 	if (ulen > ulena + ulenb + ulenstr){
-		_snprintf(strbuf, ulen, "%s%s%s", psrca, pstr, psrcb);
+		snprintf(strbuf, ulen, "%s%s%s", psrca, pstr, psrcb);
 		ret = 0;
 	}
 

+ 1 - 1
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -2680,7 +2680,7 @@ void UIServiceSession::Handle_AjustVideoPreviewSize(SpReqAnsContext<UIService_Aj
 	}
 	else{
 		char strvideoparam[MAX_PATH] = {0};
-		_snprintf(strvideoparam, MAX_PATH, "%d@%d@%d@%d", ctx->Req.leftx, ctx->Req.lefty, ctx->Req.width, ctx->Req.height);
+		snprintf(strvideoparam, MAX_PATH, "%d@%d@%d@%d", ctx->Req.leftx, ctx->Req.lefty, ctx->Req.width, ctx->Req.height);
 		LogEvent(Severity_Middle, LOG_EVT_UI_ADJUSTVIDEOECHOSIZE, strvideoparam);
 		Dbg("adjust video preview size, param is %s.", strvideoparam);
 		ctx->Ans.ErrorCode = 0;

+ 2 - 2
Module/mod_livenessdetection/RvcFaceCapturer.cpp

@@ -528,7 +528,7 @@ namespace RvcFaceCapture
 				if(!bGetVideo0&&!bGetVideo1)
 				{
 					//发送告警信息
-					LogError(Severity_High,Error_Debug,LOG_EVT_ACTIVECAPTURENOVIDEO,"No VideoFrame in videoqueue");
+					LogWarn(Severity_Middle, Error_Debug,LOG_EVT_ACTIVECAPTURENOVIDEO,"No VideoFrame in videoqueue");
 					Dbg("No VideoFrame in videoqueue!!!!");
 				}
 
@@ -884,7 +884,7 @@ namespace RvcFaceCapture
 		{
 			//发送告警信息
 			CSimpleString msg = CSimpleString::Format("failed to load RvcFaceCapture dll(%d)", GetLastError());
-			LogError(Severity_High,Error_Debug, LOG_EVT_ACTIVECAPTURELOADDEPFAIL, msg.GetData());
+			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_ACTIVECAPTURELOADDEPFAIL, msg.GetData());
 			Dbg(msg.GetData());
 			return Error_Null;
 		}

+ 1 - 1
Module/mod_localmediaplay/AdvertManage/BaseFun.cpp

@@ -282,7 +282,7 @@ BOOL DeleteDirectory(const char * DirName)
 #ifdef RVC_OS_WIN
 	//    CFileFind tempFind;        //声明一个CFileFind类变量,以用来搜索
 	char szCurPath[MAX_PATH];        //用于定义搜索格式
-	_snprintf(szCurPath, MAX_PATH, "%s//*.*", DirName);    //匹配格式为*.*,即该目录下的所有文件
+	snprintf(szCurPath, MAX_PATH, "%s//*.*", DirName);    //匹配格式为*.*,即该目录下的所有文件
 	WIN32_FIND_DATAA FindFileData;
 	ZeroMemory(&FindFileData, sizeof(WIN32_FIND_DATAA));
 	HANDLE hFile = FindFirstFileA(szCurPath, &FindFileData);

+ 5 - 5
Module/mod_localmediaplay/mod_localmediaplay.cpp

@@ -838,7 +838,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 				BOOL bRet = IsFileExisted(strVideoFullPath.GetData());
 				if (FALSE == bRet && false == entity->GetLocalLogFlag()){
 					char strmsg[MAX_PATH] = {0};
-					_snprintf(strmsg, MAX_PATH, "adv video file %s not exist!", strVideoFullPath.GetData());
+					snprintf(strmsg, MAX_PATH, "adv video file %s not exist!", strVideoFullPath.GetData());
 					LogWarn(Severity_Middle, Error_Debug, LOG_EVT_ADV_VIDEO_NOT_EXIST, strmsg);
 					entity->SetLocalLogFlag(true);
 				}
@@ -878,7 +878,7 @@ DWORD WINAPI MediaPlayThread(LPVOID param)
 				BOOL bRet = IsFileExisted(strPicFullPath.GetData());
 				if (FALSE == bRet && false == entity->GetLocalPicLogFlag()){
 					char strmsg[MAX_PATH] = {0};
-					_snprintf(strmsg, MAX_PATH, "adv picture file %s not exist!", strPicFullPath.GetData());
+					snprintf(strmsg, MAX_PATH, "adv picture file %s not exist!", strPicFullPath.GetData());
 					LogWarn(Severity_Middle, Error_Debug, LOG_EVT_ADV_PIC_NOT_EXIST, strmsg);
 					entity->SetLocalPicLogFlag(true);
 				}
@@ -1424,7 +1424,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartNotice(int nCfgInx, int nWndX, int nWn
 			if (0 == err) {
 				Dbg("create notice play thread[%u] success.", m_uNoticePlayThreadId);
 				char strinfo[MAX_PATH] = { 0 };
-				_snprintf(strinfo, MAX_PATH, "start play video notice %s", strNoticeFileName.GetData());
+				snprintf(strinfo, MAX_PATH, "start play video notice %s", strNoticeFileName.GetData());
 				LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_NOTICE_PLAY, strinfo);
 			}
 			else {
@@ -1434,7 +1434,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::StartNotice(int nCfgInx, int nWndX, int nWn
 		else {
 			Error = Error_InvalidState;
 			char strmsg[MAX_PATH] = { 0 };
-			_snprintf(strmsg, MAX_PATH, "play notice failed for %s not exist!", strNoticeFileName.GetData());
+			snprintf(strmsg, MAX_PATH, "play notice failed for %s not exist!", strNoticeFileName.GetData());
 			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_NOTICE_FILE_NOT_EXIST, strmsg);
 		}
 	}
@@ -1460,7 +1460,7 @@ ErrorCodeEnum CLocalMediaPlayEntity::StopNotice(int nCfgInx)
 			if (0 == pthread_join(m_uNoticePlayThreadId, NULL)) {
 				if (m_lastPlayVideo.length() > 0) {
 					char strmsg[MAX_PATH] = { 0 };
-					_snprintf(strmsg, MAX_PATH, "%s%s", "success to stop play notice ", m_lastPlayVideo.c_str());
+					snprintf(strmsg, MAX_PATH, "%s%s", "success to stop play notice ", m_lastPlayVideo.c_str());
 					LogWarn(Severity_Middle, Error_Debug, LOG_EVT_STOP_NOTICE_PLAY, strmsg);
 				}
 			}

+ 1 - 1
Module/mod_recorder/mod_recorder.cpp

@@ -325,7 +325,7 @@ private:
 			{
 				if (m_bStarted)
 				{
-					Dbg("Sessionid change to %s,close record and start new video file",strSessionID);
+					Dbg("Sessionid change to %s,close record and start new video file",strSessionID.GetData());
 					m_pRecorder->ReNameVideoFile(strSessionID);
 				}
 

+ 1 - 1
Module/mod_sipphone/audio_session.cpp

@@ -543,7 +543,7 @@ static int phonemedia_start(audio_session_t *session)
 	rc = rtp_session_create2(conf->local_rtp_ip, conf->local_rtp_port, 2, &media->rtpsess);
 	if (rc != 0) {
 		char strmsg[MAX_PATH] = { 0 };
-		_snprintf(strmsg, MAX_PATH, "audio rtp session create2 failed and local port is %d, rc=%d", conf->local_rtp_port, rc);
+		snprintf(strmsg, MAX_PATH, "audio rtp session create2 failed and local port is %d, rc=%d", conf->local_rtp_port, rc);
 		LogWarn(Severity_Middle, Error_Debug, ERROR_MOD_SIP_AUDIO_RTP_SESSION_CREATE_FAILED, strmsg);
 		LogWarn(Severity_Middle, Error_InvalidState, EVENT_MOD_SIP_AUDIO_RTP_CREATE, strmsg);
 		goto on_error;

+ 11 - 13
Module/mod_sipphone/endpoint.cpp

@@ -286,7 +286,6 @@ static void endpoint_media_update_video(endpoint_call_t *call, media_desc_t *vid
 		video_conf.ref_Up_Fps = call->ep->conf.ref_Up_Fps;
 		video_conf.eDeviceType = call->eDeviceType;
 		video_conf.nCallType = call->nCallType;
-		Dbg("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, cb, cb->on_video_render, cb->user_data);
 		memcpy(&video_conf.video_render_cb, cb, sizeof(rvc_video_render_callback_t));
 		video_conf.ilocal_wind_flags = VIDEOPLAYER_FLAG_PULL|VIDEOPLAYER_FLAG_CHECKTOP;
 		video_conf.iremote_wind_flags = VIDEOPLAYER_FLAG_PUSH|VIDEOPLAYER_FLAG_CHECKTOP;
@@ -405,7 +404,7 @@ static void endpoint_media_update_audio(endpoint_call_t *call, media_desc_t *aud
 		if (rc != 0) 
 		{
 			char strmsg[MAX_PATH] = {0};
-			_snprintf(strmsg, MAX_PATH, "start audio session failed! rc = %d.", rc);
+			snprintf(strmsg, MAX_PATH, "start audio session failed! rc = %d.", rc);
 			LogWarn(Severity_Middle, Error_Debug, ERROR_MOD_SIP_AUDIO_INITFAIL, strmsg);
 			audio_session_destroy(call->audio);
 			call->audio = NULL;
@@ -800,7 +799,7 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
 			endpoint_media_update_audio(call, &audio_desc, call->ep->curr_audio_dev_type);
 			call->last_media_desc_hash = hash_code;
 			char strmsg[MAX_PATH] = {0};
-			_snprintf(strmsg, MAX_PATH, "negotiate audio success!local audio ip=%s port=%d pt=%d,remote audio ip=%s port=%d,pt=%d",str_local,audio_desc.local_port,audio_desc.local_pt,str_remote,audio_desc.remote_port,audio_desc.remote_pt);
+			snprintf(strmsg, MAX_PATH, "negotiate audio success!local audio ip=%s port=%d pt=%d,remote audio ip=%s port=%d,pt=%d",str_local,audio_desc.local_port,audio_desc.local_pt,str_remote,audio_desc.remote_port,audio_desc.remote_pt);
 			LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_CALL_AUDIO_NEGOTIATE, strmsg);
 		}
 	}
@@ -823,7 +822,7 @@ static void negotiate_sdp(endpoint_call_t *call, const sdp_session_t *local_sdp,
 			call->sdpvieo_desc.remote_rtp_port = video_desc.remote_port;
 			call->last_media_desc_hash = hash_code;
 			char strmsg[MAX_PATH] = {0};
-			_snprintf(strmsg, MAX_PATH, "negotiate video success!local video ip=%s port=%d pt=%d,remote video ip=%s port=%d pt=%d",str_local,video_desc.local_port,video_desc.local_pt,str_remote,video_desc.remote_port,video_desc.remote_pt);
+			snprintf(strmsg, MAX_PATH, "negotiate video success!local video ip=%s port=%d pt=%d,remote video ip=%s port=%d pt=%d",str_local,video_desc.local_port,video_desc.local_pt,str_remote,video_desc.remote_port,video_desc.remote_pt);
 			LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_CALL_VIDEO_NEGOTIATE, strmsg);
 		}
 	}
@@ -869,7 +868,7 @@ static void on_state(CONDITION_PARAMS)
 		TAG_END());
 
 	char strmsg[MAX_PATH] = { 0 };
-	_snprintf(strmsg, MAX_PATH, "state = %d, offer_recv=%d, answer_recv=%d, offer_sent=%d, answer_sent=%d", state, offer_recv, answer_recv, offer_sent, answer_sent);
+	snprintf(strmsg, MAX_PATH, "state = %d, offer_recv=%d, answer_recv=%d, offer_sent=%d, answer_sent=%d", state, offer_recv, answer_recv, offer_sent, answer_sent);
 	LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strmsg);
 
 	switch (state)
@@ -877,7 +876,7 @@ static void on_state(CONDITION_PARAMS)
 		case nua_callstate_calling:
 			{
 				char strcalling[MAX_PATH] = { 0 };
-				_snprintf(strcalling, MAX_PATH, "nua_callstate_calling, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
+				snprintf(strcalling, MAX_PATH, "nua_callstate_calling, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strcalling);
 				if (local_sdp_str) {
 					sdp_parser_t* parser = sdp_parse(call->home, local_sdp_str, strlen(local_sdp_str), -1);
@@ -893,7 +892,7 @@ static void on_state(CONDITION_PARAMS)
 		case nua_callstate_proceeding:
 			{
 				char strproceeding[MAX_PATH] = { 0 };
-				_snprintf(strproceeding, MAX_PATH, "nua_callstate_proceeding, status = %d, has_local_sdp: %d, has_remote_sdp : %d", status, !!local_sdp_str, !!remote_sdp_str);
+				snprintf(strproceeding, MAX_PATH, "nua_callstate_proceeding, status = %d, has_local_sdp: %d, has_remote_sdp : %d", status, !!local_sdp_str, !!remote_sdp_str);
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strproceeding);
 				st = PROCEEDING;
 				call->cb.on_call_state(st, state_desc[st], phrase, call->cb.user_data);
@@ -914,7 +913,7 @@ static void on_state(CONDITION_PARAMS)
 			{
 				st = COMPLETING;
 				char strcompleting[MAX_PATH] = { 0 };
-				_snprintf(strcompleting, MAX_PATH, "nua_callstate_completing, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
+				snprintf(strcompleting, MAX_PATH, "nua_callstate_completing, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strcompleting);
 				call->cb.on_call_state(st, state_desc[st], phrase, call->cb.user_data);
 				if (remote_sdp_str) {
@@ -933,7 +932,7 @@ static void on_state(CONDITION_PARAMS)
 		case nua_callstate_completed:
 			{
 				char strcompleted[MAX_PATH] = { 0 };
-				_snprintf(strcompleted, MAX_PATH, "nua_callstate_completed, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
+				snprintf(strcompleted, MAX_PATH, "nua_callstate_completed, has_local_sdp : %d, has_remote_sdp : %d", !!local_sdp_str, !!remote_sdp_str);
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strcompleted);
 				if (remote_sdp_str) {
 					if (!call->last_sdp) {
@@ -959,7 +958,7 @@ static void on_state(CONDITION_PARAMS)
 			{
 				call->connected = true;
 				char strready[MAX_PATH] = { 0 };
-				_snprintf(strready, MAX_PATH, "nua_callstate_ready, has_local_sdp : %d, has_remote_sdp : %d.", !!local_sdp_str, !!remote_sdp_str);
+				snprintf(strready, MAX_PATH, "nua_callstate_ready, has_local_sdp : %d, has_remote_sdp : %d.", !!local_sdp_str, !!remote_sdp_str);
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strready);
 				st = READY;
 				call->cb.on_call_state(st, state_desc[st], phrase, call->cb.user_data);
@@ -994,7 +993,7 @@ static void on_state(CONDITION_PARAMS)
 			{
 				st = TERMINATED;
 				char strterminated[MAX_PATH] = { 0 };
-				_snprintf(strterminated, MAX_PATH, "call terminated! in sofia thread!");
+				snprintf(strterminated, MAX_PATH, "call terminated! in sofia thread!");
 				LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_PROCESS_MSG, strterminated);
 				{
 					media_desc_t audio_desc = { 0 };
@@ -1382,7 +1381,7 @@ endpoint_call_t *endpoint_call_create(endpoint_t *ep, const endpoint_call_params
 	}
 
 	if (NULL != pcallparam->local_ip){
-		_snprintf(call->local_ip, RVC_MAX_IP_LEN, "%s", pcallparam->local_ip);
+		snprintf(call->local_ip, RVC_MAX_IP_LEN, "%s", pcallparam->local_ip);
 	}
 	
 	call->eDeviceType = pcallparam->nDeviceType;
@@ -1524,7 +1523,6 @@ int endpoint_call_start_video(endpoint_call_t* call, endpoint_call_param_t* pcal
 		//video_desc.param[i++] = pcallparam->remote_hwd_move;
 		//video_desc.param[i++] = pcallparam->local_fresh_time;
 		//video_desc.param[i++] = pcallparam->remote_fresh_time;
-		Dbg("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, render_cb, render_cb->on_video_render, render_cb->user_data);
 		endpoint_media_update_video(call, &video_desc, render_cb);
 
 		char str_local_ip[RVC_MAX_IP_LEN]={0};

+ 21 - 12
Module/mod_sipphone/mod_sipphone.cpp

@@ -126,26 +126,33 @@ static int __release_call(void *user_data)
 	return 0;
 }
 
+
 static void __video_render_log(void* user_data, const char* fmt, va_list arg)
 {
 	vDbg(fmt, arg);
 }
 
-static int __remote_video_render_callback(void* videoframe, void* user_data)
+static int __on_stop_remote_video_render_callback(void* user_data)
 {
+	int iret = -1;
 	CSIPEntity* pThis = static_cast<CSIPEntity*>(user_data);
-
-	if (DOUBLERECORD_CALLTYPE == pThis->m_nCallType) {
-		if (NULL != pThis->m_render) {
-			if (pThis->m_render->remote_render_threadid > 0) {
-				rvc_stop_remote_video_render(pThis->m_render);
-			}
+	if (NULL != pThis->m_render) {
+		if (pThis->m_render->remote_render_threadid > 0) {
+			iret = rvc_stop_remote_video_render(pThis->m_render);
 		}
 	}
 
-	return rvc_start_remote_video_render(pThis->m_render, videoframe);
+	return iret;
+}
+
+static int __remote_video_render_callback(void* videoframe, void* user_data)
+{
+	CSIPEntity* pThis = static_cast<CSIPEntity*>(user_data);
+
+	return rvc_remote_video_render(pThis->m_render, videoframe);
 }
 
+
 CSIPEntity::CSIPEntity() : m_pCurrentSession(NULL), m_state(INIT),m_iPickupPhoneState(ePickupMicrophoneState_Off) 
 {
 	m_kept_volume_in[0] = m_kept_volume_in[1] = 0;
@@ -464,6 +471,7 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 	}
 }
 
+
 void CSIPEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
 {
 	if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
@@ -2125,7 +2133,7 @@ void CSIPPhoneSession::Handle_MakeCall( SpReqAnsContext<PhoneService_MakeCall_Re
 	LOG_FUNCTION();
 
 	char strmsg[MAX_PATH] = {0};
-	_snprintf(strmsg, MAX_PATH, "make call [%s]", (LPCSTR)ctx->Req.to_uri);
+	snprintf(strmsg, MAX_PATH, "make call [%s]", (LPCSTR)ctx->Req.to_uri);
 	LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_CALL_URL, strmsg);
 
 	int rc;
@@ -2407,7 +2415,7 @@ void CSIPPhoneSession::on_call_state(int state, const char *state_desc, const ch
 	if (m_spCallbackContext != NULL) 
 	{
 		char strmsg[MAX_PATH] = {0};
-		_snprintf(strmsg, MAX_PATH, "on_call_state message state = %d, status=%s, phrase=%s!", state, state_desc, phrase);
+		snprintf(strmsg, MAX_PATH, "on_call_state message state = %d, status=%s, phrase=%s!", state, state_desc, phrase);
 		LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_CALL_STATE_INFO, strmsg);
 		PhoneService_PhoneState_Info Info;
 		Info.state = state;
@@ -2501,8 +2509,9 @@ void CSIPPhoneSession::control_video( ControlVideoCommand *pCmd )
 
 			rvc_video_render_callback_t t_callback = { 0 };
 			t_callback.user_data = m_pEntity;
-			t_callback.on_video_render = &__remote_video_render_callback;
-			Dbg("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, &t_callback, t_callback.on_video_render, t_callback.user_data);
+			t_callback.on_remote_video_render = &__remote_video_render_callback;
+			t_callback.on_stop_remote_video_render = &__on_stop_remote_video_render_callback;
+			Dbg("%s:%d video_render_cb = 0x%08x and video_render_cb->on_video_render = 0x%08x, video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, &t_callback, t_callback.on_remote_video_render, t_callback.user_data);
 			endpoint_call_start_video(m_pCall, &callparam, &t_callback);
 			if (DOUBLERECORD_CALLTYPE != m_pEntity->m_nCallType) {
 				rvc_video_render_params_t render_param = { 0 };

+ 13 - 28
Module/mod_sipphone/video_render.cpp

@@ -6,11 +6,10 @@
 #include "../../Other/rvcmediacommon/rvc_media_common.h"
 #include "fileutil.h"
 
-extern "C"
-{
-#include <libavutil/avutil.h>
-#include <libavcodec/avcodec.h>
-#include <libswscale/swscale.h>
+extern "C"{
+	#include <libavutil/avutil.h>
+	#include <libavcodec/avcodec.h>
+	#include <libswscale/swscale.h>
 }
 #include "../../Other/libvideoframework/video_common/ffmpeg_api_cpp_adapter.h"
 
@@ -18,6 +17,7 @@ extern "C"
 #include "highgui.h"
 #include "y2k_time.h"
 
+
 static int translate_image_resolution(video_frame** dstframe, const int iwidth, const int iheight, const video_frame* psrcframe)
 {
 	int i = -1;
@@ -48,6 +48,7 @@ static int translate_image_resolution(video_frame** dstframe, const int iwidth,
 	return i;
 }
 
+
 static int rvc_video_shm_enqueue(Clibvideoqueue* shm_queue, video_frame* frame, int flags)
 {
 	videoq_frame tmp_frm;
@@ -57,8 +58,7 @@ static int rvc_video_shm_enqueue(Clibvideoqueue* shm_queue, video_frame* frame,
 	tmp_frm.width = frame->width;
 	tmp_frm.height = frame->height;
 	unsigned int nowtime = y2k_time_now();
-	if (!shm_queue->InsertVideo(&tmp_frm, flags, nowtime))
-	{
+	if (!shm_queue->InsertVideo(&tmp_frm, flags, nowtime)){
 		Dbg("caution: insert shm video failed!");
 		return Error_Unexpect;
 	}
@@ -84,27 +84,20 @@ static int get_local_video_frame(Clibvideoqueue* local_video_queue, video_frame*
 }
 
 
-int rvc_start_remote_video_render(rvc_video_render_t* prender, void* videoframe)
+int rvc_remote_video_render(rvc_video_render_t* prender, void* videoframe)
 {
 	if (NULL != prender->premote_render) {
 		video_frame* echoframe = NULL;
 		if (0 == translate_image_resolution(&echoframe, prender->location_param.iremote_view_cx, prender->location_param.iremote_view_cy, (const video_frame*)videoframe)) {
 			prender->premote_render->RenderVideoFrame(echoframe, RVC_FLIP_VERTICAL);
-			//session->bshow_remote = true;
 			video_frame_delete(echoframe);
 			echoframe = NULL;
 		}
 		else {
 			prender->premote_render->RenderVideoFrame((video_frame*)videoframe, RVC_FLIP_VERTICAL);
-			//session->bshow_remote = true;
 		}
 	}
 
-	//if (false == session->bremoterender) {
-	//	LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_STARTED, "start remote video render.");
-	//	session->bremoterender = true;
-	//}
-
 	return 0;
 }
 
@@ -131,8 +124,8 @@ void* rvc_videorender_func(void* arg)
 		}
 	}
 
-	if (param->location_param.iremote_view_x || param->location_param.iremote_view_y || param->location_param.iremote_view_cx || param->location_param.iremote_view_cy) {
-		Dbg("%s:%d create remote video hwnd x = %d, y = %d, width = %d, height = %d.", __FUNCTION__, __LINE__, param->location_param.iremote_view_x, param->location_param.iremote_view_y, param->location_param.iremote_view_cx, param->location_param.iremote_view_cy);
+	if (0 != param->location_param.iremote_view_cx && 0 != param->location_param.iremote_view_cy) {
+		Dbg("%s:%d create remote video width = %d, height = %d.", __FUNCTION__, __LINE__, param->location_param.iremote_view_cx, param->location_param.iremote_view_cy);
 		if (NULL != param->premote_render) {
 			videorender_param_t tparam_remote = { 0 };
 			tparam_remote.icx = param->location_param.iremote_view_x;
@@ -141,7 +134,7 @@ void* rvc_videorender_func(void* arg)
 			tparam_remote.uheight = param->location_param.iremote_view_cy;
 			tparam_remote.ivideoformat = VIDEO_FORMAT_RGB24;
 			if (0 == param->premote_render->VideoRenderSetParam(&tparam_remote)) {
-				//session->premote_render->ShowVideoWindow();
+				//param->premote_render->ShowVideoWindow();
 			}
 		}
 		else {
@@ -150,7 +143,6 @@ void* rvc_videorender_func(void* arg)
 	}
 
 	if (NULL != param->plocal_render) {
-		//start_video(session);
 		bool bshow_local = false;
 		bool bset = true;
 
@@ -182,11 +174,6 @@ void* rvc_videorender_func(void* arg)
 						param->plocal_render->RenderVideoFrame(local_video_frame, RVC_FLIP_VERTICAL);
 					}
 
-					//if (false == session->blocalrender) {
-					//	LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_STARTED, "start local video render.");
-					//	session->blocalrender = true;
-					//}
-
 					bshow_local = true;
 					video_frame_delete(local_video_frame);
 					local_video_frame = NULL;
@@ -232,8 +219,7 @@ void* rvc_remote_videorender_func(void* arg)
 	video_frame* remote_frame = video_frame_new(irecord_video_frame_width, irecord_video_frame_heigt, VIDEO_FORMAT_RGB24);
 	video_frame_fill_black(remote_frame);
 
-	if (ExistsFile(strImgPath))
-	{
+	if (ExistsFile(strImgPath)){
 		IplImage* img = cvLoadImage(strImgPath, 1);
 		videoq_frame* vframe = new videoq_frame;
 		if (NULL != img) {
@@ -281,8 +267,7 @@ void* rvc_remote_videorender_func(void* arg)
 		ts.tv_sec += (unsec / 1000000000);
 		ts.tv_nsec = (unsec % 1000000000);
 		if (0 != sem_timedwait(&param->remote_render_stop_sem, &ts) && (ETIMEDOUT == errno)){
-			rvc_start_remote_video_render(param, showframe);
-
+			rvc_remote_video_render(param, showframe);
 			if (NULL != video_shm_q_remote){
 				int rc = rvc_video_shm_enqueue(video_shm_q_remote, remote_frame, VIDEOQUEUE_FLAG_VERTICAL_FLIP);
 				if (rc != Error_Succeed){

+ 2 - 1
Module/mod_sipphone/video_render.h

@@ -14,7 +14,8 @@ typedef struct rvc_video_box_move_callback_s {
 
 
 typedef struct rvc_video_render_callback_s {
-	int (*on_video_render)(void* videoframe, void* user_data);
+	int (*on_stop_remote_video_render)(void* user_data);
+	int (*on_remote_video_render)(void* videoframe, void* user_data);
 	void* user_data;
 }rvc_video_render_callback_t;
 

+ 8 - 286
Module/mod_sipphone/video_session.cpp

@@ -71,21 +71,6 @@ BOOL g_bEwsRecord = FALSE;    // add by ly@2019/04/18
 //int nRecvFrameNum = 0;   //一秒钟内收到的视频帧数
 //int nFpsKeepTime = 0;  //每个帧频保持时间3s,防止频繁跳动
 
-
-typedef struct picture_record_s{
-#ifdef RVC_OS_WIN
-	HANDLE evt;
-	HANDLE work_thread;
-#else
-	sem_t sem_evt;
-	pthread_t work_threadid;
-#endif // RVC_OS_WIN
-
-	video_session_t* session;
-	video_frame* show_frame;
-	video_frame* record_frame;
-}picture_record_t;
-
 struct video_session_t
 {
 	video_session_conf_t conf;
@@ -240,6 +225,7 @@ static int video_shm_enqueue(Clibvideoqueue *shm_queue, video_frame *frame, int
 		return Error_Succeed;
 	}
 }
+
 static inline Clibvideoqueue *get_active_videoqueue(video_session_t *session)
 {
 	int agent_option = *session->conf.ref_camera_switch;
@@ -400,40 +386,8 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 {
 	//LOG_FUNCTION();
 	video_session_t *session = (video_session_t *)user_data;
-	////计算当前接收到的视频帧频,用于移动版
-	//DWORD nCurFrameTime = GetTickCount();
-	//nRecvFrameNum++;
-	//if ((nCurFrameTime-g_nLastRecFrameTime)>1000)
-	//{
-	//	if((nRecvFrameNum < g_nDynamicFps-2)&&(nRecvFrameNum>=1))
-	//	{
-	//		g_nDynamicFps = nRecvFrameNum;
-	//		nFpsKeepTime = 0;
-	//		//Dbg("adj down stream fps to %d",g_nDynamicFps);
-	//	}
-	//	else if((nRecvFrameNum >= g_nDynamicFps)&&(g_nDynamicFps < g_nSysFps)&&(nFpsKeepTime>=FPS_KEEP_TIME))
-	//	{
-	//		(g_nDynamicFps<(g_nSysFps-2))?g_nDynamicFps=g_nDynamicFps+2:g_nDynamicFps=g_nSysFps;
-	//		nFpsKeepTime = 0;
-	//		//Dbg("adj down stream fps to %d",g_nDynamicFps);
-	//	}
-	//	else
-	//	{
-	//		nFpsKeepTime++;
-	//	}
-	//	//更新时间、帧数
-	//	nRecvFrameNum = 0;
-	//	g_nLastRecFrameTime = GetTickCount();
-	//}
 
-	if (session->conf.nCallType == MOBILETOPAD_CALLTYPE) {
-		int rc = video_shm_enqueue(session->video_shm_q_remote, frame, VIDEOQUEUE_FLAG_VERTICAL_FLIP);
-		if (rc != Error_Succeed) {
-			Dbg("mobile mod insert remote video to queue failed.");
-		}
-		//Dbg("remote video queue get video lens:%d.", session->video_shm_q_remote->GetVideoLens());
-	}
-	else if (DOUBLERECORD_CALLTYPE == session->conf.nCallType) {
+	if (DOUBLERECORD_CALLTYPE == session->conf.nCallType) {
 		if (eStand2sType == session->conf.eDeviceType) {
 			//大机对远端视频进行缩放匹配
 			video_frame* recordframe = NULL;
@@ -452,6 +406,9 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 				Dbg("not eStand2sType record call mod insert remote video to queue.");
 			}
 		}
+		if (false == session->bremoterender) {
+			session->conf.video_render_cb.on_stop_remote_video_render(session->conf.video_render_cb.user_data);
+		}
 	}
 
 	int used = 0;
@@ -464,28 +421,9 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 		}
 	}
 #else
-	//static int icount = 0;
-	//if (icount == 0){
-	//	video_frame_save_bmpfile("remote_test.bmp", frame);
-	//	icount++;
-	//}
-	//if (NULL != session->premote_render){
-	//	Dbg("session plocal_render RenderVideoFrame");
-	//	video_frame* echoframe = NULL;
-	//	if (0 == translate_image_resolution(&echoframe,session->conf.remote_video_view_cx,session->conf.remote_video_view_cy, frame)) {
-	//		session->premote_render->RenderVideoFrame(echoframe, RVC_FLIP_VERTICAL);
-	//		session->bshow_remote = true;
-	//		video_frame_delete(echoframe);
-	//		echoframe = NULL;
-	//	}
-	//	else {
-	//		session->premote_render->RenderVideoFrame(frame, RVC_FLIP_VERTICAL);
-	//		session->bshow_remote = true;
-	//	}
-
-		Dbg("%s:%d session->conf.video_render_cb = 0x%08x and session->conf.video_render_cb->on_video_render = 0x%08x, session->conf.video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, session->conf.video_render_cb, session->conf.video_render_cb.on_video_render, session->conf.video_render_cb.user_data);
-		session->conf.video_render_cb.on_video_render(frame, session->conf.video_render_cb.user_data);
-		Dbg("%s:%d", __FUNCTION__, __LINE__);
+		//Dbg("%s:%d session->conf.video_render_cb = 0x%08x and session->conf.video_render_cb->on_video_render = 0x%08x, session->conf.video_render_cb->user_data = 0x%08x.", __FUNCTION__, __LINE__, session->conf.video_render_cb, session->conf.video_render_cb.on_remote_video_render, session->conf.video_render_cb.user_data);
+		session->conf.video_render_cb.on_remote_video_render(frame, session->conf.video_render_cb.user_data);
+		//Dbg("%s:%d", __FUNCTION__, __LINE__);
 
 		used = 1;
 
@@ -493,7 +431,6 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 			LogWarn(Severity_Middle, Error_Debug, EVENT_MOD_SIP_REMOTE_VIDEO_RENDER_STARTED, "start remote video render.");
 			session->bremoterender = true;
 		}
-	//}
 
 #endif
 	return used;
@@ -983,61 +920,6 @@ static int get_local_video_frame(void* user_data, video_frame** frame)
 #endif // RVC_OS_WIN
 
 
-int show_agent_picture_proc(void *arg)
-{
-	LOG_FUNCTION();
-	picture_record_t *t_record = (picture_record_t*)arg;
-	if (NULL == t_record){
-		Dbg("show_agent_picture_proc param valid.");
-		return -1;
-	}
-
-#ifdef RVC_OS_WIN
-	SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL);
-#endif 
-	for (;;) {
-#ifdef RVC_OS_WIN
-		DWORD dwRet = WaitForSingleObject(t_record->evt, 200);
-		if (dwRet == WAIT_TIMEOUT){
-#else
-		struct timespec ts;
-		clock_gettime(CLOCK_REALTIME, &ts);
-		long unsec = ts.tv_nsec + (1000 * 1000 * 200);
-		ts.tv_sec += (unsec / 1000000000);
-		ts.tv_nsec = (unsec % 1000000000);
-		if (0 != sem_timedwait(&t_record->sem_evt, &ts)) {
-#endif
-			if (NULL != t_record->session)
-			{
-				if (NULL != t_record->session->video_shm_q_remote)
-				{
-					int rc = video_shm_enqueue(t_record->session->video_shm_q_remote, t_record->record_frame, VIDEOQUEUE_FLAG_VERTICAL_FLIP);
-					if (rc != Error_Succeed) 
-					{
-						Dbg("mobile mod insert remote video to queue.");
-					}
-				}
-
-				video_frame* showframe = video_frame_new(t_record->show_frame->width, t_record->show_frame->height, VIDEO_FORMAT_RGB24);
-				video_frame_fill_black(showframe);
-				video_frame_copy(showframe, t_record->show_frame);
-
-				on_rx_frame(showframe, t_record->session);
-				if (NULL != showframe){
-					video_frame_delete(showframe);
-					showframe = NULL;
-				}
-			}
-		} 
-		else {
-			Dbg("show_agent_picture_proc thread exit.");
-			break;
-		}
-	}
-
-	return 0;
-}
-
 //static void showagentpicdump_exception(PEXCEPTION_POINTERS ExceptionInfo)
 //{
 //	char tmp[MAX_PATH];
@@ -1064,167 +946,7 @@ int show_agent_picture_proc(void *arg)
 //}
 
 
-//坐席端图像显示线程
-#ifdef RVC_OS_WIN
-static unsigned int __stdcall agent_picture_show_thread(void* arg)
-#else
-void* agent_picture_show_thread(void* arg)
-#endif
-{
-	//__try {
-		show_agent_picture_proc(arg);
-	//} 
-	//__except(showagentpicdump_exception(GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) 
-	//{
-	//	Dbg("show_agent_picture_proc exception.");
-	//}
-
-	return 0;
-}
-
-static int agent_picture_video_start(picture_record_t* t_record)
-{
-	LOG_FUNCTION();
-#ifdef RVC_OS_WIN
-	t_record->evt = CreateEventA(NULL, FALSE, FALSE, NULL);
-	t_record->work_thread = (HANDLE)_beginthreadex(NULL, 0, &agent_picture_show_thread, t_record, 0, NULL);
-#else
-	sem_init(&t_record->sem_evt, 0, 0);
-	pthread_attr_t attr;
-	pthread_attr_init(&attr);
-	struct sched_param param;
-	param.sched_priority = sched_get_priority_max(SCHED_RR);
-	pthread_attr_setschedpolicy(&attr, SCHED_RR);
-	pthread_attr_setschedparam(&attr, &param);
-	pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
-	int err = pthread_create(&t_record->work_threadid, NULL, agent_picture_show_thread, t_record);
-	if (0 == err) {
-		Dbg("create agent picture show thread success, %u.", t_record->work_threadid);
-	}
-	else {
-		Dbg("create agent picture show thread failed for %s.", strerror(errno));
-	}
-#endif // RVC_OS_WIN
-	return 0;
-}
-
-static int agent_picture_video_stop(picture_record_t* t_record)
-{
-	Dbg("agent picture video stop called, stop static picture show thread.");
-
-#ifdef RVC_OS_WIN
-	if (t_record->evt) {
-		SetEvent(t_record->evt);
-		if (t_record->work_thread) {
-			WaitForSingleObject(t_record->work_thread, INFINITE);
-			CloseHandle(t_record->work_thread);
-			t_record->work_thread = NULL;
-		}
-		CloseHandle(t_record->evt);
-		t_record->evt = NULL;
-	}
-
-#else
-	
-	sem_post(&t_record->sem_evt);
-	if (t_record->work_threadid > 0) {
-		pthread_join(t_record->work_threadid, NULL);
-		t_record->work_threadid = 0;
-	}
-	sem_destroy(&t_record->sem_evt);
-
-#endif // RVC_OS_WIN
-	if (t_record->record_frame){
-		video_frame_delete(t_record->record_frame);
-		t_record->record_frame = NULL;
-	}
-
-	if (t_record->show_frame){
-		video_frame_delete(t_record->show_frame);
-		t_record->show_frame = NULL;
-	}
-
-	Dbg("stop static picture show thread end.");
-
-	return 0;
-}
-
-
-static void	show_remote_agnet_picture(video_session_t *t_session)
-{
-	LOG_FUNCTION();
-	char strPath[MAX_PATH_SIZE]={0};
-	char strImgPath[MAX_PATH_SIZE]={0};
-
-	int irecord_video_frame_width = REC_COMMON_VIDEO_SSM_AGENT_WIDTH;
-	int irecord_video_frame_heigt = REC_COMMON_VIDEO_SSM_AGENT_HEIGHT;
-
-	if (t_session->conf.eDeviceType == eStand2sType){
-		irecord_video_frame_width = /*REC_COMMON_VIDEO_DSM_AGENT_WIDTH*/REC_COMMON_VIDEO_SNAPSHOT_PREVIEW_WIDTH;
-		irecord_video_frame_heigt = /*REC_COMMON_VIDEO_DSM_AGENT_HEIGHT*/REC_COMMON_VIDEO_SNAPSHOT_PREVIEW_HEIGHT;
-	}
-
-#ifdef RVC_OS_WIN
-	GetCurrentRunPath(strPath);
-	sprintf(strImgPath, "%s\\bin\\agent.jpg", strPath);
-#else
-	strcpy_s(strImgPath, MAX_PATH_SIZE, "./bin/agent.jpg");
-#endif // RVC_OS_WIN
-
-	video_frame* remote_frame = video_frame_new(irecord_video_frame_width, irecord_video_frame_heigt, VIDEO_FORMAT_RGB24);
-	video_frame_fill_black(remote_frame);
-
-	if (ExistsFile(strImgPath))
-	{
-		IplImage*img = cvLoadImage(strImgPath,1);
-		videoq_frame* vframe = new videoq_frame;
-		if (img != NULL)
-		{
-			Dbg("load img success");
-			vframe->format = VIDEOQ_FORMAT_RGB24;
-			vframe->framesize = img->imageSize;
-			vframe->width = img->width;
-			vframe->height = img->height;
-			vframe->data = new unsigned char[img->imageSize];
-			memcpy(vframe->data,img->imageData,img->imageSize);
-			cvReleaseImage(&img);
-		}
-		SwsContext*sws = sws_getContext(vframe->width, vframe->height,PIX_FMT_BGR24,
-			irecord_video_frame_width,
-			irecord_video_frame_heigt, 
-			PIX_FMT_BGR24,
-			SWS_POINT, NULL, NULL, NULL);
-		uint8_t *src_data[4] = {(unsigned char*)vframe->data+(vframe->height-1)*vframe->width*3,NULL,NULL,NULL};
-		int src_linesize[4] = {-vframe->width*3,0,0,0};
-		unsigned char *dst[4] = {remote_frame->data[0],NULL,NULL,NULL};
-		int dst_linesize[4] = {remote_frame->linesize[0],0,0,0};
-		sws_scale(sws, src_data, src_linesize, 0, vframe->height, dst, dst_linesize);
-		sws_freeContext(sws);
-
-		if (vframe){
-			delete vframe->data;
-			delete vframe;
-		}
-	}
-
-	if (NULL != t_session->video_shm_q_remote)
-	{
-		int rc = video_shm_enqueue(t_session->video_shm_q_remote, remote_frame, VIDEOQUEUE_FLAG_VERTICAL_FLIP);
-		if (rc != Error_Succeed) 
-		{
-			Dbg("insert agent picture to remote video queue.");
-		}
-	}
 
-	video_frame * showframe = NULL;
-	if (-1 == translate_image_resolution(&showframe,t_session->conf.remote_video_width,t_session->conf.remote_video_height,remote_frame))
-	{
-		showframe = video_frame_new(t_session->conf.remote_video_width,t_session->conf.remote_video_height, VIDEO_FORMAT_RGB24);
-		video_frame_fill_black(showframe);
-		video_frame_copy(showframe, remote_frame);
-	}
-	
-}
 
 
 static int start_video_rtpsession(video_session_t* session)

+ 0 - 1
Other/CMakeLists.txt

@@ -16,7 +16,6 @@ add_subdirectory(libaudioframework)
 add_subdirectory(libvideoframework)
 add_subdirectory(libfacecapture)
 add_subdirectory(libaudions)
-add_subdirectory(libaudiotransqueue)
 add_subdirectory(libwmvrecord)
 add_subdirectory(libCMBPrint)
 

+ 0 - 55
Other/libaudiotransqueue/CMakeLists.txt

@@ -1,55 +0,0 @@
-set(MODULE_NAME "libaudiotransqueue")
-set(MODULE_PREFIX "LIBAUDIOTRANSQUEUE_FUNC")
-
-
-set(${MODULE_PREFIX}_SRCS
-	libaudiotransqueue.h
-	libaudiotransqueue.cpp
-)
-
-add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
-
-
-target_include_directories(${MODULE_NAME} PRIVATE
-   "${CONAN_RVCFRAMEWORK_ROOT}/include"
-	${RVC_COMMON_INCLUDE_DIR}
-	${OTHER_LIB_BASE_DIR}/libaudioqueue
-	${OTHER_LIB_BASE_DIR}/libsharememory
-	)
-
-
-target_link_directories(${MODULE_NAME} PRIVATE
-	audioqueue
-	sharememory
-	)
-
-
-target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS} PRIVATE
-	audioqueue
-	sharememory
-	)  
-
-target_compile_definitions(${MODULE_NAME} PUBLIC "LIBAUDIOTRANSQUEUE_API")
-
-
-
-if(MSVC)
-	install(TARGETS ${MODULE_NAME} 
-    RUNTIME DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT libraries
-    ARCHIVE DESTINATION "${RVC_LIBRARY_PATH}" COMPONENT develops EXCLUDE_FROM_ALL
-    LIBRARY DESTINATION "${RVC_LIBRARY_PATH}" COMPONENT libraries
-    )
-else()
-install(TARGETS ${MODULE_NAME} 
-    RUNTIME DESTINATION "${RVC_RUNTIME_PATH}"
-    ARCHIVE DESTINATION "${RVC_LIBRARY_PATH}"
-    LIBRARY DESTINATION "${RVC_RUNTIME_PATH}"
-    COMPONENT libraries)
-endif(MSVC)
-
-# 设置要依赖拷贝的第三方库
-if(MSVC)
-set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_BIN_DIRS} PARENT_SCOPE)
-else()
-set(OTHER_CONAN_DEP_LIBS ${OTHER_CONAN_DEP_LIBS} ${CONAN_LIB_DIRS} PARENT_SCOPE)
-ENDIF(MSVC)

+ 0 - 48
Other/libaudiotransqueue/ReadMe.txt

@@ -1,48 +0,0 @@
-========================================================================
-    DYNAMIC LINK LIBRARY : libaudiotransqueue Project Overview
-========================================================================
-
-AppWizard has created this libaudiotransqueue DLL for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your libaudiotransqueue application.
-
-
-libaudiotransqueue.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-libaudiotransqueue.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-libaudiotransqueue.cpp
-    This is the main DLL source file.
-
-	When created, this DLL does not export any symbols. As a result, it
-	will not produce a .lib file when it is built. If you wish this project
-	to be a project dependency of some other project, you will either need to
-	add code to export some symbols from the DLL so that an export library
-	will be produced, or you can set the Ignore Input Library property to Yes
-	on the General propert page of the Linker folder in the project's Property
-	Pages dialog box.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named libaudiotransqueue.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 19
Other/libaudiotransqueue/dllmain.cpp

@@ -1,19 +0,0 @@
-// dllmain.cpp : Defines the entry point for the DLL application.
-#include "stdafx.h"
-
-BOOL APIENTRY DllMain( HMODULE hModule,
-                       DWORD  ul_reason_for_call,
-                       LPVOID lpReserved
-					 )
-{
-	switch (ul_reason_for_call)
-	{
-	case DLL_PROCESS_ATTACH:
-	case DLL_THREAD_ATTACH:
-	case DLL_THREAD_DETACH:
-	case DLL_PROCESS_DETACH:
-		break;
-	}
-	return TRUE;
-}
-

+ 0 - 321
Other/libaudiotransqueue/libaudiotransqueue.cpp

@@ -1,321 +0,0 @@
-// libaudiotransqueue.cpp : Defines the exported functions for the DLL application.
-//
-
-//#include "stdafx.h"
-#include "SpBase.h"
-#include "libaudiotransqueue.h"
-#include "libsharememory.h"
-
-
-
-typedef struct  Qnode
-{
-	unsigned int videoframeindex;
-	unsigned int nextqnodeindex;
-}Qnode, *queueptr;
-
-typedef struct linkqueue
-{
-	unsigned int frontindex;
-	unsigned int rearindex;
-	unsigned int queuelens;
-}linkqueue;
-
-class libaudiotransqueue_impl
-{
-private:
-	Clibsharememory m_ShareMem;
-	LPVOID m_lpMem;
-	linkqueue*m_pQueue;
-	int m_nQueueAddrLens;
-	int m_nQnodeAddrLens;
-	int m_nFrameAddrLens;
-	int m_nDataAddrlens;
-	LPCTSTR szShareMemName;
-	unsigned long aQnodeAddr[MAX_AUDIOTRANSQUEUE_LENS];
-	unsigned long aAudioFrameAddr[MAX_AUDIOTRANSQUEUE_LENS];
-	unsigned long aAudioDataAddr[MAX_AUDIOTRANSQUEUE_LENS];
-
-public:
-	libaudiotransqueue_impl(LPCTSTR audioqueuename,int framesize=MAX_AUDIOQNODE_SIZE)
-	{
-		m_lpMem = NULL;
-		m_pQueue = NULL;
-		szShareMemName = NULL;
-		m_nQueueAddrLens = 0;
-		m_nQnodeAddrLens = 0;
-		m_nFrameAddrLens = 0;
-		m_nDataAddrlens = 0;
-		for(int i=0;i<MAX_AUDIOTRANSQUEUE_LENS;i++)
-		{
-			aQnodeAddr[i] = 0;
-			aAudioFrameAddr[i] = 0;
-			aAudioDataAddr[i] = 0;
-		}
-		InitQueue(audioqueuename,framesize);
-	}
-
-	~libaudiotransqueue_impl()
-	{
-		ClearQueue();
-	}
-	//初始化队列
-	BOOL InitQueue(LPCTSTR szName,int framesize=MAX_AUDIOQNODE_SIZE)
-	{
-		m_nQueueAddrLens = sizeof(linkqueue);
-		m_nQnodeAddrLens = MAX_AUDIOTRANSQUEUE_LENS*sizeof(Qnode);
-		m_nFrameAddrLens = MAX_AUDIOTRANSQUEUE_LENS*sizeof(audio_frame);
-		m_nDataAddrlens	= MAX_AUDIOTRANSQUEUE_LENS*framesize;
-		int nMemTotalNum = m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+m_nDataAddrlens;
-		if (m_ShareMem.Create(szName,nMemTotalNum)&&(m_nDataAddrlens!=0))
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				memset(m_lpMem,0,nMemTotalNum);
-				m_pQueue = (linkqueue *)m_lpMem;
-				for(int i =0;i<MAX_AUDIOTRANSQUEUE_LENS;i++)
-				{
-					aQnodeAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+sizeof(Qnode)*i;
-					aAudioFrameAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+sizeof(audio_frame)*i;
-					aAudioDataAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+framesize*i;
-				}
-				m_pQueue->frontindex = m_pQueue->rearindex = 0;
-				m_pQueue->queuelens = 0;
-				m_ShareMem.Unlock();
-			}
-
-		} 
-		else if(m_ShareMem.Open(szName))
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				m_pQueue = (linkqueue *)m_lpMem;
-				for(int i =0;i<MAX_AUDIOTRANSQUEUE_LENS;i++)
-				{
-					aQnodeAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+sizeof(Qnode)*i;
-					aAudioFrameAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+sizeof(audio_frame)*i;
-					aAudioDataAddr[i] = (unsigned long)m_pQueue+m_nQueueAddrLens+m_nQnodeAddrLens+m_nFrameAddrLens+framesize*i;
-				}
-				m_ShareMem.Unlock();
-			}
-		}
-		return TRUE;
-	}
-	//返回队列的元素个数,音频队列长度
-	int GetQueueLens()
-	{
-		int iRet = 0;
-		if(m_ShareMem.IsValid())
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				int num = m_pQueue->queuelens;
-				m_ShareMem.Unlock();
-				iRet = num;
-			}
-		}
-
-		return iRet;
-	}
-
-
-	//往音频循环队列尾部插节点
-	bool EnAudioQueue(audio_frame* pItem)
-	{
-		bool bRet = false;
-		if(m_ShareMem.IsValid())
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				unsigned int nRearNextIndex = 0;
-				//保存当前对位指针的序列号
-				queueptr rearptrfront = (queueptr)aQnodeAddr[m_pQueue->rearindex];
-				//如果队列已满
-				if(m_pQueue->queuelens == MAX_AUDIOTRANSQUEUE_LENS)
-				{
-					m_pQueue->rearindex = (m_pQueue->rearindex+1)%MAX_AUDIOTRANSQUEUE_LENS;
-					m_pQueue->frontindex = (m_pQueue->frontindex+1)%MAX_AUDIOTRANSQUEUE_LENS;
-					m_pQueue->queuelens = MAX_AUDIOTRANSQUEUE_LENS;
-				}
-				else if (m_pQueue->queuelens == 0)
-				{
-					m_pQueue->rearindex  = 0;
-					m_pQueue->frontindex  = 0;
-					m_pQueue->queuelens++;
-				}
-				else
-				{
-					m_pQueue->rearindex = (m_pQueue->rearindex+1)%MAX_AUDIOTRANSQUEUE_LENS;
-					m_pQueue->frontindex = m_pQueue->frontindex;
-					m_pQueue->queuelens++;
-				}
-				if (NULL != pItem)
-				{
-					queueptr rearqnodetmp			= (queueptr)aQnodeAddr[m_pQueue->rearindex];
-					rearqnodetmp->videoframeindex	= m_pQueue->rearindex;
-					rearqnodetmp->nextqnodeindex	= 0;
-					audio_frame*audiotmp			= (audio_frame*)aAudioFrameAddr[m_pQueue->rearindex];
-					audiotmp->data					= (char*)aAudioDataAddr[m_pQueue->rearindex ];
-					audiotmp->bitspersample			= pItem->bitspersample;
-					audiotmp->format				= pItem->format;
-					audiotmp->framesize				= pItem->framesize;
-					audiotmp->nchannels				= pItem->nchannels;
-					audiotmp->samplespersec			= pItem->samplespersec;
-					audiotmp->iseriesnumber			= pItem->iseriesnumber;
-					memcpy(audiotmp->data,pItem->data,pItem->framesize);
-					rearptrfront->nextqnodeindex = m_pQueue->rearindex;
-				}
-				m_ShareMem.Unlock();
-				bRet = true;
-			}
-		}
-		return bRet;
-	}
-
-
-	//读音频队列头部节点
-	bool TryDequeue(audio_frame* pItem)	
-	{
-		bool bRet = false;
-		if(m_ShareMem.IsValid())
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				if (m_pQueue->queuelens == 0)
-				{
-					m_ShareMem.Unlock();
-					bRet = false;
-				}
-				else
-				{
-					audio_frame*audiotemp = (audio_frame*)aAudioFrameAddr[m_pQueue->frontindex];;
-					pItem->format			= audiotemp->format;
-					pItem->framesize		= audiotemp->framesize;
-					pItem->bitspersample	= audiotemp->bitspersample;
-					pItem->nchannels		= audiotemp->nchannels;
-					pItem->samplespersec	= audiotemp->samplespersec;
-					pItem->iseriesnumber	= audiotemp->iseriesnumber;
-					memcpy(pItem->data,(char*)aAudioDataAddr[m_pQueue->frontindex],audiotemp->framesize);
-					m_ShareMem.Unlock();
-					bRet = true;
-				}
-			}
-		}
-		return bRet;
-	}
-
-	//清除队列
-	bool ClearQueue()
-	{
-		bool bRet = false;
-		if(m_ShareMem.IsValid())
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				if (m_pQueue->queuelens != 0)
-				{
-					while(m_pQueue->queuelens != 0)
-					{
-						audio_frame*audiotemp = (audio_frame*)aAudioFrameAddr[m_pQueue->frontindex];
-						char*data = (char*)aAudioDataAddr[m_pQueue->frontindex];
-						memset(data,0,audiotemp->framesize);
-						memset(audiotemp,0,sizeof(audio_frame));
-						queueptr qnodetmp			= (queueptr)aQnodeAddr[m_pQueue->frontindex];
-						m_pQueue->frontindex		= qnodetmp->nextqnodeindex;
-						qnodetmp					= (queueptr)aQnodeAddr[m_pQueue->rearindex];
-						qnodetmp->nextqnodeindex	= 0;
-						m_pQueue->queuelens--;	
-					}					
-				}
-				m_ShareMem.Unlock();
-				bRet = true;
-			}
-		}
-		return bRet;
-	}
-
-
-	//删除队头的数据
-	bool DeleteQueueHead()  
-	{
-		bool bRet = false;
-		if(m_ShareMem.IsValid())
-		{
-			m_lpMem = m_ShareMem.Lock(1000);
-			if(m_lpMem != NULL)
-			{
-				if (m_pQueue->queuelens != 0)
-				{	
-					audio_frame*audiotemp = (audio_frame*)aAudioFrameAddr[m_pQueue->frontindex];
-					char*data = (char*)aAudioDataAddr[m_pQueue->frontindex];
-					memset(data,0,audiotemp->framesize);
-					memset(audiotemp,0,sizeof(audio_frame));
-					queueptr qnodetmp			= (queueptr)aQnodeAddr[m_pQueue->frontindex];
-					m_pQueue->frontindex		= qnodetmp->nextqnodeindex;
-					qnodetmp					= (queueptr)aQnodeAddr[m_pQueue->rearindex];
-					qnodetmp->nextqnodeindex	= 0;
-					m_pQueue->queuelens--;			
-				}
-				m_ShareMem.Unlock();
-				bRet = true;
-			}
-		}	
-		return bRet;
-	}
-};
-
-
-Clibaudiotransqueue::Clibaudiotransqueue(LPCTSTR audioqueuename,int framesize)
-{
-	m_pImpl = new libaudiotransqueue_impl(audioqueuename,framesize);
-	return;
-}
-
-Clibaudiotransqueue::~Clibaudiotransqueue()
-{
-	ClearQueue();
-	delete m_pImpl;
-	return;
-}
-
-bool Clibaudiotransqueue::Enqueue(audio_frame* pItem)
-{
-	bool bRet = m_pImpl->EnAudioQueue(pItem);
-	return bRet;
-}
-
-bool Clibaudiotransqueue::TryDequeue(audio_frame* pItem)
-{
-	bool bRet = m_pImpl->TryDequeue(pItem);
-	return bRet;
-}
-
-bool Clibaudiotransqueue::DeleteQueueHead()
-{
-	bool bRet = m_pImpl->DeleteQueueHead();
-	return bRet;
-}
-
-bool Clibaudiotransqueue::IsEmpty()
-{
-	bool bRet = m_pImpl->GetQueueLens() == 0 ? true : false;
-	return bRet;
-}
-
-int Clibaudiotransqueue::Count()
-{
-	int iRet = m_pImpl->GetQueueLens();
-	return iRet;
-}
-
-bool Clibaudiotransqueue::ClearQueue()
-{
-	bool bRet = m_pImpl->ClearQueue();
-	return bRet;
-}

+ 0 - 54
Other/libaudiotransqueue/libaudiotransqueue.h

@@ -1,54 +0,0 @@
-#ifndef _LIB_AUDIO_TRANS_QUEUE_H
-#define _LIB_AUDIO_TRANS_QUEUE_H
-
-
-#ifdef _WIN32
-#ifdef LIBAUDIOTRANSQUEUE_EXPORTS
-#define LIBAUDIOTRANSQUEUE_API __declspec(dllexport)
-#else
-#define LIBAUDIOTRANSQUEUE_API __declspec(dllimport)
-#endif
-#else
-#define LIBAUDIOTRANSQUEUE_API
-#endif
-
-
-#include "libaudioqueue.h"
-
-using namespace std ;
-
-
-#ifndef MAX_AUDIOTRANSQUEUE_LENS
-#define MAX_AUDIOTRANSQUEUE_LENS     2048				//音频队列最大节点数量
-#endif
-
-#ifndef MAX_AUDIOQNODE_SIZE
-#define MAX_AUDIOQNODE_SIZE			16000				//音频队列单个节点默认最大长度
-#endif
-
-
-
-class libaudiotransqueue_impl;  //桥接
-
-
-class LIBAUDIOTRANSQUEUE_API Clibaudiotransqueue 
-{
-public:
-	//audioqueuename:用于访问音频共享内存的共享内存文件名。framesize:默认最大长度,一般使用默认值即可
-	Clibaudiotransqueue(LPCTSTR audioqueuename,int framesize=MAX_AUDIOQNODE_SIZE);
-	~Clibaudiotransqueue();
-	// TODO: 在此添加您的方法。
-private:
-	libaudiotransqueue_impl*m_pImpl;
-
-public:
-	bool Enqueue(audio_frame* pItem);
-	bool TryDequeue(audio_frame* pItem);
-	bool DeleteQueueHead();
-	bool IsEmpty();
-	int Count();
-	bool ClearQueue();
-};
-
-
-#endif

+ 0 - 111
Other/libaudiotransqueue/libaudiotransqueue.vcxproj

@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{5D044B5D-E5FF-4DF1-B896-E0A89E124778}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>libaudiotransqueue</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>Windows7.1SDK</PlatformToolset>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-    <PlatformToolset>Windows7.1SDK</PlatformToolset>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <Import Project="..\libmake.setting" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBAUDIOTRANSQUEUE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(FrameworkHeadRoot)\Common;..\libsharememory;..\libaudioqueue</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBAUDIOTRANSQUEUE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>$(FrameworkHeadRoot)\Common;..\libsharememory</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="$(FrameworkHeadRoot)\Common\stdafx.h" />
-    <ClCompile Include="$(FrameworkHeadRoot)\Common\stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Use</PrecompiledHeader>
-    </ClCompile>
-    <ClCompile Include="dllmain.cpp">
-      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </PrecompiledHeader>
-      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-      </PrecompiledHeader>
-    </ClCompile>
-    <ClCompile Include="libaudiotransqueue.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-    </ClCompile>
-    <ClInclude Include="libaudiotransqueue.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\Version.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libsharememory\libsharememory.vcxproj">
-      <Project>{5b4b7c43-3e8d-4523-91a7-b2943240abd3}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 1
Other/libvideoframework/video_common/videoutil.c

@@ -466,7 +466,6 @@ int video_frame_fill_black(video_frame *frame)
 	return 0;
 }
 
-
 void yvyu_to_yu12(uint8_t* outframe, uint8_t* inframe, int width, int height)
 {
 	/*assertions*/

+ 0 - 4
Other/libwmvrecord/CMakeLists.txt

@@ -28,7 +28,6 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${OTHER_LIB_BASE_DIR}/libaudioqueue
     ${OTHER_LIB_BASE_DIR}/libvideoqueue
 	${OTHER_LIB_BASE_DIR}/libaudions
-	${OTHER_LIB_BASE_DIR}/libaudiotransqueue
 	${OTHER_LIB_BASE_DIR}/rvcmediacommon/common_video
 	${OTHER_LIB_BASE_DIR}/libvideoframework
 	)
@@ -41,7 +40,6 @@ target_link_directories(${MODULE_NAME} PRIVATE
 	${CONAN_LIB_DIRS_FREETYPE}
 	audioqueue
 	videoqueue
-	libaudiotransqueue
 	libaudions
 	)
 else(MSVC)
@@ -53,7 +51,6 @@ target_link_directories(${MODULE_NAME} PRIVATE
 	${CONAN_LIB_DIRS_FREETYPE}
 	audioqueue
 	videoqueue
-	libaudiotransqueue
 	libaudions
 	)
 endif(MSVC)	
@@ -65,7 +62,6 @@ target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS} PRIVATE
 	${CONAN_LIBS_FREETYPE}
 	audioqueue
 	videoqueue
-	libaudiotransqueue
 	libaudions
 	)  
 

+ 2 - 1
Other/libwmvrecord/FFmpegWriter.h

@@ -1,7 +1,6 @@
 // FFmpegWriter.h: interface for the FFmpegWriter class.
 #pragma once
 
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -42,6 +41,7 @@ public:
 	FFmpegWmvWriter(LogApi* pLogAPI) {m_pLogApi = pLogAPI; video_st = NULL; audio_st = NULL; fmt = NULL; oc = NULL; 
 		audio_codec = NULL; video_codec = NULL; have_video = 0; have_audio = 0; audio_input_buffer = NULL;};
 	~FFmpegWmvWriter() {}
+
 private://内部成员变量
 	OutputStream *video_st;
 	OutputStream *audio_st;
@@ -55,6 +55,7 @@ private://内部成员变量
 	LogApi* m_pLogApi;
 	ByteBuffer* audio_input_buffer;
 	void Close();
+
 public:
 	bool InitWmvWriter(char* filename, int width, int height, int colorbit, int nfps,
 		int nSanplePsec, int nchannels, int nBitPerSample, int nmaxspacing, int nquality, int nOutBitRate, int iAudioType);

+ 60 - 135
Other/libwmvrecord/libwmvrecord.cpp

@@ -26,7 +26,6 @@
 #include "CvxText.h" // 用于中文字幕添加 add by ly
 #include <speex/speex_resampler.h>
 #include "iaudionsinterface.h"
-#include "libaudiotransqueue.h"
 #include <semaphore.h>
 
 #define SLASH '/'
@@ -134,7 +133,6 @@ public:
 		memset(videoframe,0,sizeof(videoq_frame));
 		audioframe		= new audio_frame;
 		memset(audioframe,0,sizeof(audio_frame));
-		m_hRecordThread	= NULL;
 		m_nRecordthreadId	= 0;
 		sem_init(&m_semt, 0, 0);
 
@@ -149,35 +147,31 @@ public:
 		memset(m_videoqueue2name, 0, MAX_PATH);
 		memset(m_remotevideoqueuename, 0, MAX_PATH);
 		memset(m_remoteaudioqueuename, 0, MAX_PATH);
-		//音频传输队列,初始化为空
-		m_salestransqueue = NULL;
-		// 支持现场销售双录使用独立的音频队列 edit by ly@2018/06/13
 		m_audioqueue = NULL;
-		//m_localaudioqueue = new Clibaudioqueue((char *)audioqueuename);
+
 		strncpy(m_audioqueuename, audioqueuename, (strlen(audioqueuename) > MAX_PATH) ? (MAX_PATH - 1): strlen(audioqueuename));
 		m_salesaudioqueue = NULL;
-		if (salesaudioqueuename)
-		{
+		if (salesaudioqueuename){
 			strncpy(m_salesaudioqueuename, salesaudioqueuename, (strlen(salesaudioqueuename) > MAX_PATH) ? (MAX_PATH - 1) : strlen(salesaudioqueuename));
 		}
+
 		m_videoqueue = NULL;
-		if (videoqueuename)
-		{
+		if (videoqueuename){
 			strncpy(m_videoqueuename, videoqueuename, (strlen(videoqueuename) > MAX_PATH) ? (MAX_PATH - 1) : strlen(videoqueuename));
 		}
+
 		m_videoqueue2 = NULL;
-		if (videoqueue2name)
-		{
+		if (videoqueue2name){
 			strncpy(m_videoqueue2name, videoqueue2name, (strlen(videoqueue2name) > MAX_PATH) ? (MAX_PATH - 1) : strlen(videoqueue2name));
 		}
+
 		m_remotevideoqueue = NULL;
-		if (remotevideoqueuename)
-		{
+		if (remotevideoqueuename){
 			strncpy(m_remotevideoqueuename, remotevideoqueuename, (strlen(remotevideoqueuename) > MAX_PATH) ? (MAX_PATH - 1) : strlen(remotevideoqueuename));
 		}
+
 		m_remoteaudioqueue = NULL;
-		if (remoteaudioqueuename)
-		{
+		if (remoteaudioqueuename){
 			strncpy(m_remoteaudioqueuename, remoteaudioqueuename, (strlen(remoteaudioqueuename) > MAX_PATH) ? (MAX_PATH - 1) : strlen(remoteaudioqueuename));
 		}
 		
@@ -192,68 +186,53 @@ public:
 
 	~libwmvrecord_impl()
 	{
-		if (videoframe->data != NULL)
-		{
+		if (videoframe->data != NULL){
 			delete videoframe->data;
 			videoframe->data = NULL;
 		}
 
-		if (videoframe != NULL)
-		{
+		if (videoframe != NULL){
 			delete videoframe;
 			videoframe = NULL;
 		}
 
-		if (audioframe != NULL)
-		{
+		if (audioframe != NULL){
 			delete audioframe;
 			audioframe = NULL;
 		}
 
-		if (m_hRecordThread)
-		{
-			m_hRecordThread = NULL;
-		}
-
-		if (m_pWriter!= NULL)
-		{
+		if (m_pWriter!= NULL){
 			delete m_pWriter;
 			m_pWriter = NULL;
 		}
 
-		if (m_localaudioqueue != NULL)
-		{
+		if (m_localaudioqueue != NULL){
 			delete m_localaudioqueue;
 			m_localaudioqueue = NULL;
 		}
 
-		if (m_salesaudioqueue != NULL)
-		{
+		if (m_salesaudioqueue != NULL){
 			delete m_salesaudioqueue;
 			m_salesaudioqueue = NULL;
 		}
 
 		m_audioqueue = NULL;
-		if (m_remoteaudioqueue != NULL)
-		{
+		if (m_remoteaudioqueue != NULL){
 			delete m_remoteaudioqueue;
 			m_remoteaudioqueue = NULL;
 		}
 
-		if (m_videoqueue != NULL)
-		{
+		if (m_videoqueue != NULL){
 			delete m_videoqueue;
 			m_videoqueue = NULL;
 		}
 
-		if (m_videoqueue2 != NULL)
-		{
+		if (m_videoqueue2 != NULL){
 			delete m_videoqueue2;
 			m_videoqueue2 = NULL;
 		}
 
-		if (m_remotevideoqueue != NULL)
-		{
+		if (m_remotevideoqueue != NULL){
 			delete m_remotevideoqueue;
 			m_remotevideoqueue = NULL;
 		}
@@ -267,12 +246,6 @@ public:
 			DestroyIAudioNsObj(m_pAudioNsObj);
 			m_pAudioNsObj = NULL;
 		}
-
-		if (NULL != m_salestransqueue){
-			//Dbg("delete m_salestransqueue ing .......");
-			delete m_salestransqueue;
-			m_salestransqueue = NULL;
-		}
 	}
 
 	CWmvHostApi* GetHostApi()
@@ -290,11 +263,8 @@ private:
 	BOOL m_bIsAudioTransOn;		  //是否开始音频传输到识别服务器开关
 
 	int m_nFps;
-	////字幕信息 add by ly
-	//struct RecordSubTitle m_SubTitle;
 	/************************************************************************/
 	int m_videoquality;
-	//int m_audioOutBitRate;
 	SubtitleParam m_SubtitleParam;
 	BOOL m_bWholeSection;
 	BOOL m_bSessionManage;
@@ -304,10 +274,10 @@ private:
 	Clibaudioqueue*m_audioqueue;
 	Clibvideoqueue*m_videoqueue;
 	Clibvideoqueue*m_videoqueue2;
-	Clibvideoqueue*m_remotevideoqueue;  //远端视频,用于双向录像,add by chh 20170320
-	Clibaudioqueue*m_remoteaudioqueue;  //远端音频,用于双向录像,add by chh 20170320
-	Clibaudioqueue*m_localaudioqueue;   //本地音频,add by ly@2018/06/13
-	Clibaudioqueue*m_salesaudioqueue;   //现场销售音频,add by ly@2018/06/13
+	Clibvideoqueue*m_remotevideoqueue;  //远端视频,用于双向录像
+	Clibaudioqueue*m_remoteaudioqueue;  //远端音频,用于双向录像
+	Clibaudioqueue*m_localaudioqueue;   //本地音频
+	Clibaudioqueue*m_salesaudioqueue;   //现场销售音频
 	char m_audioqueuename[MAX_PATH];
 	char m_videoqueuename[MAX_PATH];
 	char m_videoqueue2name[MAX_PATH];
@@ -315,9 +285,6 @@ private:
 	char m_remotevideoqueuename[MAX_PATH];
 	char m_remoteaudioqueuename[MAX_PATH];
 
-	Clibaudiotransqueue *m_salestransqueue;
-
-	pthread_t m_hRecordThread;
 	pthread_t m_nRecordthreadId;
 	char m_FileName[MAX_PATH];
 	char m_PathName[MAX_PATH];
@@ -339,60 +306,53 @@ private:
 
 	BOOL EndRecord()
 	{
-		if (!m_pWriter->End())
-		{
+		if (!m_pWriter->End()){
 			return FALSE;
 		}	
-		if (m_pWriter)
-		{
+
+		if (m_pWriter){
 			delete m_pWriter;
 			m_pWriter = NULL;
 		}
-		if (videoframe->data)
-		{
+
+		if (videoframe->data){
 			delete videoframe->data;
 			videoframe->data = NULL;
 		}
-		if (m_pAudioBufferTmp!=NULL)
-		{
+
+		if (m_pAudioBufferTmp!=NULL){
 			delete m_pAudioBufferTmp;
 			m_pAudioBufferTmp = NULL;
 			m_iAudioBufferSize = 0;
 		}
 
-		if (m_localaudioqueue != NULL)
-		{
+		if (m_localaudioqueue != NULL){
 			delete m_localaudioqueue;
 			m_localaudioqueue = NULL;
 		}
 
-		if (m_salesaudioqueue != NULL)
-		{
+		if (m_salesaudioqueue != NULL){
 			delete m_salesaudioqueue;
 			m_salesaudioqueue = NULL;
 		}
 
 		m_audioqueue = NULL;
-		if (m_remoteaudioqueue != NULL)
-		{
+		if (m_remoteaudioqueue != NULL){
 			delete m_remoteaudioqueue;
 			m_remoteaudioqueue = NULL;
 		}
 
-		if (m_videoqueue != NULL)
-		{
+		if (m_videoqueue != NULL){
 			delete m_videoqueue;
 			m_videoqueue = NULL;
 		}
 
-		if (m_videoqueue2 != NULL)
-		{
+		if (m_videoqueue2 != NULL){
 			delete m_videoqueue2;
 			m_videoqueue2 = NULL;
 		}
 
-		if (m_remotevideoqueue != NULL)
-		{
+		if (m_remotevideoqueue != NULL){
 			delete m_remotevideoqueue;
 			m_remotevideoqueue = NULL;
 		}
@@ -431,6 +391,7 @@ private:
 	//开始录制视频
 	BOOL StartRecord()
 	{
+		BOOL bRet = FALSE;
 		m_pWriter = new FFmpegWmvWriter(this);
 		if (m_bIsAudioNsOn){
 			audions_callback_t t_callback = { 0 };
@@ -440,12 +401,13 @@ private:
 		}
 		
 		if (0 == pthread_create(&m_nRecordthreadId, NULL, VideoRecordThread, (void*)this)) {
+			bRet = TRUE;
 			m_pHostApi->Debug("create video record thread and thread id is %u.", m_nRecordthreadId);
 		}
 		else {
 			m_pHostApi->Debug("create video record thread failed.");
 		}
-		return TRUE;
+		return bRet;
 	}
 
 	//获取指定队列的SIZE
@@ -691,7 +653,7 @@ private:
 			{
 				//将大机摄像头和远端视频拼接到一张画布中
 				memset(Video->data,0,Video->framesize);
-				BOOL bRslt =FALSE;
+				BOOL bRslt = FALSE;
 				int width  = 0;
 				int height = 0;
 				m_videoqueue->GetFrameSize(width,height);
@@ -1160,7 +1122,7 @@ private:
 			TtcDir += fontfile;
 			pText = new CvxText(m_pHostApi, TtcDir.c_str());
 			int type = 0;
-			CvScalar scalar = {22, 0.5, 0.2, 0}; //字体大小/空白比例/间隔比例/旋转角度
+			CvScalar scalar = {16, 0.3, 0.2, 0}; //字体大小/空白比例/间隔比例/旋转角度
 			bool underline = false;
 			float diaphaneity = 1.0;
 			pText->setFont(&type, &scalar, &underline, &diaphaneity); //字体类型/size/下滑线/透明度
@@ -1496,17 +1458,6 @@ private:
 								if ((0 == nAudioFromQueNum%100) && 0 != audioframe->iseriesnumber){
 									//m_pHostApi->Debug("single side record current audio queue len is %d and audio series number is: %d.",nAudioLens, audioframe->iseriesnumber);
 								}
-
-								if (m_bIsAudioTransOn && NULL != m_salestransqueue){
-									if (m_salestransqueue->Enqueue(audioframe)){
-										//if (0 == audioframe->iseriesnumber%100){
-											//m_pHostApi->Debug("audio frame enqueue sales trans queue, and frame series number is %d.", audioframe->iseriesnumber);
-										//}
-									}
-									else{
-										//m_pHostApi->Debug("audio frame enqueue sales trans queue failed, and frame series number is %d.", audioframe->iseriesnumber);
-									}
-								}
 							}
 							else{
 								//m_pHostApi->Debug("get audio from m_audioqueue failed.");
@@ -2006,36 +1957,35 @@ private:
 		return &iRet;
 	}
 public:
-	//开始录制 ly@2018/06/05
+
 	BOOL StartWmvRecord(int fps,int videoquality,const SubtitleParam *subtitleParam,BOOL bWholeSection,
 		BOOL bSessionManage,const char *pathname,int pathlength,const char *wmvfilename,int filenamelength, Rvc_RecordAudioParam_t* pAudioParam)//开始记录
 	{
-		m_salestransqueue = NULL;
 		m_audioqueue = NULL;
 		m_localaudioqueue = new Clibaudioqueue((char *)m_audioqueuename);
+		
 		m_salesaudioqueue = NULL;
-		if (strlen(m_salesaudioqueuename) != 0)
-		{
+		if (strlen(m_salesaudioqueuename) != 0){
 			m_salesaudioqueue = new Clibaudioqueue((char*)m_salesaudioqueuename);
 		}
+
 		m_videoqueue = NULL;
-		if (strlen(m_videoqueuename) != 0)
-		{
+		if (strlen(m_videoqueuename) != 0){
 			m_videoqueue = new Clibvideoqueue((char*)m_videoqueuename);
 		}
+
 		m_videoqueue2 = NULL;
-		if (strlen(m_videoqueue2name) != 0)
-		{
+		if (strlen(m_videoqueue2name) != 0){
 			m_videoqueue2 = new Clibvideoqueue((char*)m_videoqueue2name);
 		}
+
 		m_remotevideoqueue = NULL;
-		if (strlen(m_remotevideoqueuename) != 0)
-		{
+		if (strlen(m_remotevideoqueuename) != 0){
 			m_remotevideoqueue = new Clibvideoqueue((char*)m_remotevideoqueuename);
 		}
+
 		m_remoteaudioqueue = NULL;
-		if (strlen(m_remoteaudioqueuename) != 0)
-		{
+		if (strlen(m_remoteaudioqueuename) != 0){
 			m_remoteaudioqueue = new Clibaudioqueue((char*)m_remoteaudioqueuename);
 		}
 
@@ -2063,21 +2013,8 @@ public:
 			m_videoquality = 75;
 		}
 
-		//if (audioOutBitRate < 8 || audioOutBitRate > 256){
-		//	//m_pHostApi->Debug("warn: audioOutBitRate is illegal, will use default instead!");
-		//	//m_audioOutBitRate = 8000;
-		//}
-		//else
-		//{
-		//	m_audioOutBitRate = audioOutBitRate*1000;
-		//}
-		//远程双录双声道,输出码率是原来的2倍
-		//if (eStand2Agent == eRecordType || ePad2Agent == eRecordType){
-		//	m_audioOutBitRate *= 2;
-		//}
-
 		memset(&m_SubtitleParam, 0, sizeof(SubtitleParam));
-		if(subtitleParam != NULL) // 接收字幕信息 add by ly
+		if(subtitleParam != NULL) // 接收字幕信息
 		{
 			memcpy(&m_SubtitleParam, subtitleParam, sizeof(SubtitleParam));
 		}
@@ -2095,24 +2032,13 @@ public:
 			m_audioqueue = m_salesaudioqueue;
 		}
 
-		//Dbg("m_audioOutBitRate = %d.", m_audioOutBitRate);
 		m_pHostApi->Debug("record output audio quality type is = %s, noise suppression flag is %s, noise suppression policy is %d, audio transfer flag is %s.", audio_quality_type_table[m_eAudioType], m_bIsAudioNsOn ? "true":"false", m_iNsPolicy, m_bIsAudioTransOn ? "true":"false");
-		//m_salestransqueue = new Clibaudiotransqueue(m_FileName);
-		if (m_bIsAudioTransOn){
-			m_salestransqueue = new Clibaudiotransqueue(m_FileName);
-			if (NULL != m_salestransqueue){
-				Dbg("get sales trans audio queue success, queue name is %s and addr is 0x%08x.", m_FileName, m_salestransqueue);
-			}
-		}
 
-		if (m_hRecordThread == NULL)
-		{
-			return StartRecord();
-		}
-		else
-		{
-			return FALSE;
+		if (0 != m_nRecordthreadId){
+			StopWmvRecord();
 		}
+
+		return StartRecord();
 	}
 
 	BOOL StopWmvRecord()				//退出
@@ -2126,7 +2052,6 @@ public:
 		else {
 			m_pHostApi->Debug("thread join video record thread failed!");
 		}
-		m_eRecordType = eSingleSide;
 
 		return TRUE;
 	}
@@ -2188,7 +2113,7 @@ Clibwmvrecord::~Clibwmvrecord()
 	return;
 }
 
-// ly@2018/06/05
+
 BOOL Clibwmvrecord::StartWmvRecord( 
 	int fps, 
 	int videoquality, 
@@ -2229,7 +2154,7 @@ BOOL Clibwmvrecord::SetRightVideoWaterMark(wchar_t* strWaterMark)
 	}
 
 	size_t ulen = wcslen(strWaterMark);
-	m_pImpl->setRightWaterMark(strWaterMark, ulen);
+	bRet = m_pImpl->setRightWaterMark(strWaterMark, ulen*sizeof(wchar_t));
 
 	return bRet;
 }

Some files were not shown because too many files changed in this diff