فهرست منبع

Z991239-5745 #comment 合并摄像头压测工具分支

80274480 10 ماه پیش
والد
کامیت
fe3ef191dc
31فایلهای تغییر یافته به همراه636 افزوده شده و 175 حذف شده
  1. 0 1
      Module/mod_SalesRecorder/Event.h
  2. 2 1
      Module/mod_SalesRecorder/mod_SalesRecorder.cpp
  3. 2 2
      Module/mod_assistantchannel/VideoDesc.h
  4. 0 3
      Module/mod_customeraware/Event.h
  5. 1 0
      Module/mod_customeraware/mod_customeraware.cpp
  6. 2 1
      Module/mod_initiativetransfer/CMakeLists.txt
  7. 3 0
      Module/mod_initiativetransfer/Event.h
  8. 3 5
      Module/mod_initiativetransfer/mod_initiativetransfer.cpp
  9. 5 8
      Module/mod_interactivecontrol/Event.h
  10. 17 0
      Module/mod_interactivecontrol/InteractiveControl.xml
  11. 98 0
      Module/mod_interactivecontrol/InteractiveControl_client_g.h
  12. 46 0
      Module/mod_interactivecontrol/InteractiveControl_def_g.h
  13. 15 0
      Module/mod_interactivecontrol/InteractiveControl_msg_g.h
  14. 54 0
      Module/mod_interactivecontrol/InteractiveControl_server_g.h
  15. 98 8
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  16. 31 1
      Module/mod_interactivecontrol/mod_interactivecontrol.h
  17. 31 1
      Module/mod_recorder/mod_recorder.cpp
  18. 1 34
      Module/mod_sipphone/Event.h
  19. 106 23
      Module/mod_sipphone/mod_sipphone.cpp
  20. 4 2
      Module/mod_sipphone/mod_sipphone.h
  21. 0 4
      Module/mod_sipphone/unix/video_session.cpp
  22. 0 4
      Module/mod_sipphone/uuid.cpp
  23. 16 4
      Module/mod_sipphone/video_render.cpp
  24. 1 0
      Module/mod_sipphone/video_render.h
  25. 49 51
      Module/mod_snapshot/mod_snapshot.cpp
  26. 1 1
      Other/libaudiomgr/linux/libaudiomgr_linux.cpp
  27. 2 2
      Other/libvideorecord/libvideorecord_impl.cpp
  28. 1 1
      Other/libvideorecord/libvideorecord_impl.h
  29. 4 3
      Other/unix/libvideocapture/ivideocaptureinterface.h
  30. 40 13
      Other/unix/libvideocapture/linux/videocapture_linux.cpp
  31. 3 2
      Other/unix/libvideocapture/linux/videocapture_linux.h

+ 0 - 1
Module/mod_SalesRecorder/Event.h

@@ -8,7 +8,6 @@
 #define LOG_EVT_START_REMOTERECORD						0x31510001				//开始远程双录
 #define LOG_EVT_STOP_REMOTERECORD						0x31510002				//停止远程双录
 #define LOG_EVT_SALESRECORD_FAILED						0x31510003				//销售双录失败		
-#define LOG_EVT_RECORD_ENTITY_EXCEPTION					0x31510004				//销售双录实体异常	
 #define LOG_EVT_RECORD_FINISHED							0x31510005				//销售双录已完成
 #define LOG_EVT_RECORD_SAVED_SUCCESS					0x31510006				//双录文件保存成功
 #define LOG_EVT_RECORD_SAVED_FAILED						0x31510007				//双录文件保存失败

+ 2 - 1
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -19,6 +19,7 @@
 #include "mod_customeraware/Event.h"
 #include "mod_facetracking/sysvar.h"
 #include "mod_mediacontroller/Event.h"
+#include "mod_interactivecontrol/Event.h"
 
 #include <assert.h>
 #include "EventCode.h"
@@ -658,7 +659,7 @@ void CSalesRecorderEntity::OnRecordFailed(eRvcRecordFailedCase eCase, const char
 void CSalesRecorderEntity::OnRecordEntityExcption()
 {
 	LogEvent(Severity_High,LOG_EVT_SALESRECORD_ENTITY_EXCEPTION,"现场销售双录出现异常,请稍候重录,系统正在恢复中,预计60秒!");
-	LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORD_ENTITY_EXCEPTION, "sales record entity exception!");
+	LogWarn(Severity_Low, Error_Debug, LOG_EVT_SALESRECORD_ENTITY_EXCEPTION, "sales record entity exception!");
 }
 
 void CSalesRecorderEntity::OnRecordFinished()

+ 2 - 2
Module/mod_assistantchannel/VideoDesc.h

@@ -137,9 +137,9 @@ static inline CSimpleStringA ConstructVideoRenderParam(CSimpleStringA strMsg, bo
 {
 	int lxPos, lyPos, lwidth, lheight;
 	CSimpleStringA strVideoParam;
-	CSimpleStringA str;
+	char str[256] = {0};
 	if (false == bDoubleVideo) {
-		sscanf(strMsg.GetData(), "%d@%d@%d@%d@%s", &lxPos, &lyPos, &lwidth, &lheight, &str);
+		sscanf(strMsg.GetData(), "%d@%d@%d@%d@%s", &lxPos, &lyPos, &lwidth, &lheight, str);
 		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("local video param : (x=%d,y=%d,width=%d,height=%d).", lxPos, lyPos, lwidth, lheight);
 		strVideoParam = BuildVideoRenderDesc(lxPos, lyPos, lwidth, lheight);
 	}

+ 0 - 3
Module/mod_customeraware/Event.h

@@ -2,11 +2,8 @@
 #define EVENT_MOD_CUSTOMERAWARE_BEGIN				0x30830001
 #define EVENT_MOD_CUSTOMERAWARE_END					0x30830002
 
-#define LOG_EVT_UI_RETURNMENU						0x30B00006				//退出到主菜单
 #define LOG_EVT_UI_EXITSALESRECORD					0x40100004				//退出录像事件
 
-#define LOG_EVT_UI_STARTREMOTERECORD				0x30B0000F				//开始远程双录
-
 #define SYSVAR_DESKTOPTYPE	"DesktopType"		//桌面类型
 #define DESKTOPTYPE_BUS			'B'				//业务屏
 #define DESKTOPTYPE_INFO		'I'				//信息屏

+ 1 - 0
Module/mod_customeraware/mod_customeraware.cpp

@@ -5,6 +5,7 @@
 #include "CustomerHandleFSM.h"
 #include "Event.h"
 #include "EventCode.h"
+#include "../mod_interactivecontrol/Event.h"
 
 #define EVT_CONVERTER	"EventConverter"
 

+ 2 - 1
Module/mod_initiativetransfer/CMakeLists.txt

@@ -2,7 +2,8 @@
 define_module("initiativetransfer")
 
 
-set(${MODULE_PREFIX}_SRCS
+set(${MODULE_PREFIX}_SRCS 
+	Event.h
 	mod_initiativetransfer.cpp
 	InitiativeTransfer_server_g.h
 	InitiativeTransfer_msg_g.h

+ 3 - 0
Module/mod_initiativetransfer/Event.h

@@ -0,0 +1,3 @@
+#pragma once
+
+#define LOG_EVT_ENTER_ACM_FLOW	 0x30500001				//进入坐席控制流程

+ 3 - 5
Module/mod_initiativetransfer/mod_initiativetransfer.cpp

@@ -1,10 +1,13 @@
 #include "stdafx.h"
 #include "SpBase.h"
 #include "FlowControlFSM.h"
+#include "Event.h"
 
 #include "InitiativeTransfer_server_g.h"
 #include "InitiativeTransfer_msg_g.h"
 #include "EventCode.h"
+#include "../mod_interactivecontrol/Event.h"
+
 
 using namespace InitiativeTransfer;
 
@@ -12,11 +15,6 @@ using namespace InitiativeTransfer;
 #define RVC_CONNECT_ASSIST_ID 1
 #endif
 
-#define LOG_EVT_ENTER_ACM_FLOW	 0x30500001				//进入坐席控制流程
-
-#define LOG_EVT_UI_RETURNMENU		0x30B00006				//退出到主菜单
-#define LOG_EVT_UI_EXIT_BACKRUN		0x30B00016				//前端主动退出后端模式
-
 class CFlowControlEntity;
 
 class FlowControlServiceSession : public FlowService_ServerSessionBase

+ 5 - 8
Module/mod_interactivecontrol/Event.h

@@ -1,16 +1,10 @@
 #pragma once
 
 /*----InteractiveControl----*/
-#define LOG_EVT_UI_STARTRECORD						0x30B00001				//开始录像
-#define LOG_EVT_UI_STOPRECORD						0x30B00002				//停止录像
 #define LOG_EVT_UI_RETURNMENU						0x30B00006				//退出到主菜单
 #define LOG_EVT_UI_STARTPHOTOGRAPH					0x30B00007				//开始复杂产品合同拍照
 #define LOG_EVT_UI_STOPPHOTOGRAPH					0x30B00008				//停止复杂产品合同拍照
 #define LOG_EVT_UI_SENDOPERATESTATE					0x30B00009				//UI发送操作状态,用于业务层锁定交易页面
-#define LOG_EVT_UI_START_CONTINURECORD				0x30B0000A				//开始全程录像
-#define LOG_EVT_UI_STOP_CONTINURECORD				0x30B0000B				//停止全程录像
-#define LOG_EVT_UI_START_ECHO_CONTINURECORD			0x30B0000C				//开始回显全程录像
-#define LOG_EVT_UI_STOP_ECHO_CONTINURECORD			0x30B0000D				//停止回显全程录像
 #define LOG_EVT_UI_VIDEOAPPENDWATERMARK				0x30B0000E				//双录视频追加水印
 #define LOG_EVT_UI_STARTREMOTERECORD				0x30B0000F				//开始远程双录
 #define LOG_EVT_UI_STOPREMOTERECORD					0x30B00018				//停止远程录像
@@ -20,11 +14,11 @@
 #define LOG_EVT_UI_SHOWLOCALVIDEO					0x30B00013				//显示本地视频窗口
 #define LOG_EVT_UI_HIDEPERSONAREA					0x30B00014				//隐藏人形框
 #define LOG_EVT_UI_SHOWPERSONAREA					0x30B00015				//显示隐藏人形框
+#define LOG_EVT_UI_EXIT_BACKRUN						0x30B00016				//前端主动退出后端模式
+
 
 #define LOG_EVT_LOCALMEDIAPLAYER_LOST				0x30B00B01				//本地媒体播放lost
 #define LOG_EVT_PLAYER_CANNTFIND_FILE				0x30B00B02				//找不到要播放的文件
-#define LOG_EVT_OPEN_ADV_FROM_LOCAL_CONFIG			0x30B00B03		     	//通过本地配置要求打开广告播放
-#define LOG_EVT_FORBIDDIEN_ADV_FROM_LOCAL_CONFIG	0x30B00B04 				//通过本地配置要求关闭广告播放
 #define LOG_EVT_STOP_NOTICEPLAY_FAILED				0x30B00B05				//停止业务视频播放失败
 
 #define LOG_EVT_START_REMOTERECORD_SUCCESS			0x30B10001				//启动远程双录成功
@@ -64,4 +58,7 @@
 #define LOG_EVT_SET_REMOTERECORDCAMERA_SUCCESS		0x30B1001E				//设置摄像头成功
 #define LOG_EVT_SET_REMOTERECORDCAMERA_FAILED		0x30B1001F				//设置摄像头失败
 
+#define LOG_EVT_UI_STARTCAMERACAPTURE				0x30B10020				//开始摄像头图像采集
+#define LOG_EVT_UI_STOPCAMERACAPTURE				0x30B10021				//停止摄像头图像采集
+
 /*----End--InteractiveControl------------------------------*/

+ 17 - 0
Module/mod_interactivecontrol/InteractiveControl.xml

@@ -525,6 +525,19 @@
 			<res>
 			</res>
 		</twoway>
+    <twoway name="StartCameraCapture" overlap="true">
+      <req>
+        <param name="strParam" type="string"/>
+      </req>
+      <res>
+      </res>
+    </twoway>
+    <twoway name="StopCameraCapture" overlap="true">
+      <req>
+      </req>
+      <res>
+      </res>
+    </twoway>
 	</class>
 	
 
@@ -639,4 +652,8 @@
 		<!-- 失败提示 -->
 		<param name="failedmsg" type="wstring"/>
 	</message>
+  <!-- 上摄像头稳定性数据 -->
+  <message name="EnvCameraCapProcess">
+    <param name="envcapmsg" type="wstring"/>
+  </message>
 </entity>

+ 98 - 0
Module/mod_interactivecontrol/InteractiveControl_client_g.h

@@ -2919,6 +2919,104 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum StartCameraCapture(UIService_StartCameraCapture_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(UIService_Method_StartCameraCapture, UIService_MethodSignature_StartCameraCapture, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum StartCameraCapture(UIService_StartCameraCapture_Req &Req, UIService_StartCameraCapture_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StartCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum StartCameraCapture(UIService_StartCameraCapture_Req &Req, UIService_StartCameraCapture_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StartCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum StartCameraCapture(UIService_StartCameraCapture_Req &Req, UIService_StartCameraCapture_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StartCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
+	ErrorCodeEnum StopCameraCapture(UIService_StopCameraCapture_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(UIService_Method_StopCameraCapture, UIService_MethodSignature_StopCameraCapture, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum StopCameraCapture(UIService_StopCameraCapture_Req &Req, UIService_StopCameraCapture_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StopCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum StopCameraCapture(UIService_StopCameraCapture_Req &Req, UIService_StopCameraCapture_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StopCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum StopCameraCapture(UIService_StopCameraCapture_Req &Req, UIService_StopCameraCapture_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = StopCameraCapture(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 46 - 0
Module/mod_interactivecontrol/InteractiveControl_def_g.h

@@ -88,6 +88,8 @@ namespace InteractiveControl {
 #define UIService_Method_GetPickUpStatus 66
 #define UIService_Method_GetCameraState 67
 #define UIService_Method_SetRemoteRecordCamera 68
+#define UIService_Method_StartCameraCapture 69
+#define UIService_Method_StopCameraCapture 70
 
 #define UIService_MethodSignature_SetUIState -649355360
 #define UIService_MethodSignature_SendAgentText -389826246
@@ -158,6 +160,8 @@ namespace InteractiveControl {
 #define UIService_MethodSignature_GetPickUpStatus -1057807018
 #define UIService_MethodSignature_GetCameraState 1106777089
 #define UIService_MethodSignature_SetRemoteRecordCamera 644742714
+#define UIService_MethodSignature_StartCameraCapture -1747552500
+#define UIService_MethodSignature_StopCameraCapture -1434897600
 
 #define UIService_LogCode_SetUIState "QLR040230B00"
 #define UIService_LogCode_SendAgentText "QLR040230B01"
@@ -226,6 +230,10 @@ namespace InteractiveControl {
 #define UIService_LogCode_GetCameraInfo "QLR040230B64"
 #define UIService_LogCode_GetMediaDeviceInfo "QLR040230B65"
 #define UIService_LogCode_GetPickUpStatus "QLR040230B66"
+#define UIService_LogCode_GetCameraState "QLR040230B67"
+#define UIService_LogCode_SetRemoteRecordCamera "QLR040230B68"
+#define UIService_LogCode_StartCameraCapture "QLR040230B69"
+#define UIService_LogCode_StopCameraCapture "QLR040230B70"
 
 struct UIService_SetUIState_Info
 {
@@ -1530,6 +1538,44 @@ struct UIService_SetRemoteRecordCamera_Ans
 
 };
 
+struct UIService_StartCameraCapture_Req
+{
+	CSimpleStringA strParam;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & strParam;
+	}
+
+};
+
+struct UIService_StartCameraCapture_Ans
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct UIService_StopCameraCapture_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct UIService_StopCameraCapture_Ans
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
 
 ///////////////////////////
 

+ 15 - 0
Module/mod_interactivecontrol/InteractiveControl_msg_g.h

@@ -30,6 +30,7 @@ namespace InteractiveControl {
 #define eMsg_CommonWebMsg 18
 #define eMsg_H5BackSyncData 19
 #define eMsg_SalesRecordingFailed 20
+#define eMsg_EnvCameraCapProcess 21
 
 #define eMsgSig_CustomerState 175614460
 #define eMsgSig_Stop -150723185
@@ -52,6 +53,7 @@ namespace InteractiveControl {
 #define eMsgSig_CommonWebMsg -1026578513
 #define eMsgSig_H5BackSyncData -1217690931
 #define eMsgSig_SalesRecordingFailed -1402924427
+#define eMsgSig_EnvCameraCapProcess -1158933893
 
 struct CustomerState
 {
@@ -332,5 +334,18 @@ struct SalesRecordingFailed
 
 ///////////////////////////
 
+struct EnvCameraCapProcess
+{
+	CSimpleStringW envcapmsg;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & envcapmsg;
+	}
+
+};
+
+///////////////////////////
+
 } // namespace InteractiveControl
 #endif // __INTERACTIVECONTROL_MSG_G_H

+ 54 - 0
Module/mod_interactivecontrol/InteractiveControl_server_g.h

@@ -513,6 +513,20 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case UIService_Method_StartCameraCapture:
+			if (dwSignature == UIService_MethodSignature_StartCameraCapture) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case UIService_Method_StopCameraCapture:
+			if (dwSignature == UIService_MethodSignature_StopCameraCapture) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -869,6 +883,16 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case UIService_Method_StartCameraCapture:
+			if (dwSignature != UIService_MethodSignature_StartCameraCapture) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case UIService_Method_StopCameraCapture:
+			if (dwSignature != UIService_MethodSignature_StopCameraCapture) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -1221,6 +1245,16 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_StartCameraCapture(SpReqAnsContext<UIService_StartCameraCapture_Req, UIService_StartCameraCapture_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
+	virtual void Handle_StopCameraCapture(SpReqAnsContext<UIService_StopCameraCapture_Req, UIService_StopCameraCapture_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -1927,6 +1961,26 @@ public:
 						Handle_SetRemoteRecordCamera(ctx);
 					}
 					break;
+				case UIService_Method_StartCameraCapture:
+					{
+						SpReqAnsContext<UIService_StartCameraCapture_Req,UIService_StartCameraCapture_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<UIService_StartCameraCapture_Req,UIService_StartCameraCapture_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_StartCameraCapture(ctx);
+					}
+					break;
+				case UIService_Method_StopCameraCapture:
+					{
+						SpReqAnsContext<UIService_StopCameraCapture_Req,UIService_StopCameraCapture_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<UIService_StopCameraCapture_Req,UIService_StopCameraCapture_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_StopCameraCapture(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 98 - 8
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -65,6 +65,14 @@ void CITCtrlEntity::OnAudioPlayRet(const char *pszEntityName, DWORD dwMessageId,
 }
 	
 
+void CITCtrlEntity::OnEnvCameraCapInfo(const char* pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, MediaController::EnvCameraCapInfo& evt)
+{
+	EnvCameraCapProcess ret;
+	ret.envcapmsg = evt.cameracapmsg;
+	SpSendBroadcast(GetFunction(), eMsg_EnvCameraCapProcess, eMsgSig_EnvCameraCapProcess, ret);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SpSendBroadcast EnvCameraCapProcess info is %s.", CSimpleStringW2A(ret.envcapmsg).GetData());
+}
+
 CServerSessionBase* CITCtrlEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char * /*pszParam*/)
 {
 	return new UIServiceSession(this);
@@ -77,6 +85,11 @@ void CITCtrlEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("subscribe LocalMediaPlay evt failed!");
 	}
 
+	Error = GetFunction()->SubscribeBroadcast("MediaController", NULL, this, m_uidMediaControllerListenser);
+	if (Error != Error_Succeed) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("subscribe MediaController evt failed!");
+	}
+
 	Error = __OnStart(Error_Succeed);
 	pTransactionContext->SendAnswer(Error);
 }
@@ -830,9 +843,6 @@ ErrorCodeEnum CITCtrlEntity::GetLocalAudioVolume(int& nVolume, DWORD dwTimeout)
 
 ErrorCodeEnum CITCtrlEntity::SetLocalVideoVolume(int nCfgInx, int nVolume, DWORD dwTimeout)
 {
-	//LogEvent(Severity_Middle, 0x10303042, "handfree call");
-	LogEvent(Severity_Middle, 0x10303041, "pickup call");
-
 	if (!IsPlayerEntityAvailable()){
 		return Error_Param;
 	}
@@ -1713,7 +1723,7 @@ ErrorCodeEnum CITCtrlEntity::StartTransactionRecord(CSimpleStringA strVideoName)
 		LogWarn(Severity_Low, Error_Debug, LOG_EVT_START_TRANSACTIONRECORD_SUCCESS, CSimpleStringA::Format("start transaction record %s success.", strVideoName.GetData()).GetData());
 	}
 	else {
-		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_TRANSACTIONRECORD_FAILED, CSimpleStringA::Format("start transaction record %s failed for 0x%08x", strVideoName.GetData(), rc).GetData());
+		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_START_TRANSACTIONRECORD_FAILED, CSimpleStringA::Format("start transaction record %s failed for 0x%08x.", strVideoName.GetData(), rc).GetData());
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040230BZ90101").setResultCode("RTA3B07")("启动交易录像超时");
 	}
 
@@ -1735,7 +1745,7 @@ ErrorCodeEnum CITCtrlEntity::StopTransactionRecord(CSimpleStringA strVideoName)
 	ErrorCodeEnum rc = (*m_pRecordClient)(EntityResource::getLink().upgradeLink())->StopTransactionRecord(req, ans, 5000);
 	if (Error_Succeed == rc) {
 		LogWarn(Severity_Low, Error_Debug, LOG_EVT_STOP_TRANSACTIONRECORD_SUCCESS, CSimpleStringA::Format("stop transaction record %s success.", strVideoName.GetData()).GetData());
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ90201")("stop transaction record success");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040230BZ90201")("stop transaction record success.");
 	}
 	else {
 		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_STOP_TRANSACTIONRECORD_FAILED, CSimpleStringA::Format("stop transaction record %s failed for 0x%08x.", strVideoName.GetData(), rc).GetData());
@@ -1947,12 +1957,61 @@ ErrorCodeEnum CITCtrlEntity::SetRemoteRecordCamera(int iCamera)
 	req.iCamera = iCamera;
 	ErrorCodeEnum rc = (*m_pSalesRecordClient)(EntityResource::getLink().upgradeLink())->SetRecordCamera(req, ans, 5000);
 	if (Error_Succeed != rc) {
-		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SET_REMOTERECORDCAMERA_FAILED, CSimpleStringA::Format("set remote record camera failed for 0x%08x", rc).GetData());
+		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SET_REMOTERECORDCAMERA_FAILED, CSimpleStringA::Format("set remote record camera failed for 0x%08x.", rc).GetData());
+	}
+
+	return rc;
+}
+
+
+ErrorCodeEnum CITCtrlEntity::StartCameraCaptrue()
+{
+	LOG_FUNCTION();
+
+	if (!IsRecordEntityAvailable()) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("start camera capture failed for connect Recordr failed!");
+		return Error_DevConnFailed;
+	}
+
+	if (!IsSipPhoneEntityAvailable()) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("start camera capture failed for connect SipphoneClient failed!");
+		return Error_DevConnFailed;
+	}
+
+	if (!IsMediaCtrEntityAvailable()) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("start camera capture failed for connect MediaCtrClient failed!");
+		return Error_DevConnFailed;
+	}
+
+	MediaService_TurnOnCamera_Req req;
+	MediaService_TurnOnCamera_Ans ans;
+	ErrorCodeEnum rc = (*m_pMediaCtlClient)(EntityResource::getLink().upgradeLink())->TurnOnCamera(req, ans, 10000);
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)(CSimpleStringA::Format("turn on camera result is 0x%08x.", rc).GetData());
+
+	return rc;
+}
+
+ErrorCodeEnum CITCtrlEntity::StopCameraCaptrue()
+{
+	LOG_FUNCTION();
+
+	if (!IsMediaCtrEntityAvailable()) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("stop camera capture failed for connect MediaCtrClient failed!");
+		return Error_DevConnFailed;
+	}
+
+	MediaService_TurnOffCamera_Req req;
+	MediaService_TurnOffCamera_Ans ans;
+	ErrorCodeEnum rc = (*m_pMediaCtlClient)(EntityResource::getLink().upgradeLink())->TurnOffCamera(req, ans, 5000);
+	if (Error_Succeed != rc) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)(CSimpleStringA::Format("turn off failed for 0x%08x.", rc).GetData());
 	}
 
 	return rc;
 }
 
+
+
 void UIServiceSession::Handle_SetUIState(SpOnewayCallContext<UIService_SetUIState_Info>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
@@ -2446,6 +2505,7 @@ void UIServiceSession::Handle_StopPlayNotice(SpReqAnsContext<UIService_StopPlayN
 	}
 }
 
+
 void UIServiceSession::Handle_GetRecordMode(SpReqAnsContext<UIService_GetRecordMode_Req, UIService_GetRecordMode_Ans>::Pointer ctx)
 {
 	DbgToBeidou(ctx->link, __FUNCTION__)();
@@ -2633,6 +2693,38 @@ void UIServiceSession::Handle_SetRemoteRecordCamera(SpReqAnsContext<UIService_Se
 	ctx->Answer(Error);
 }
 
+void UIServiceSession::Handle_StartCameraCapture(SpReqAnsContext<UIService_StartCameraCapture_Req, UIService_StartCameraCapture_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+
+	ErrorCodeEnum Error = m_pEntity->StartCameraCaptrue();
+	if ((Error_EnvCamera != Error) && (Error_AllCamera != Error)) {
+		LogEvent(Severity_Middle, LOG_EVT_UI_STARTCAMERACAPTURE, ctx->Req.strParam.GetData());
+		Error = Error_Succeed;
+	}
+	else {
+		Error = Error_InvalidState;
+	}
+
+	ctx->Answer(Error);
+}
+
+void UIServiceSession::Handle_StopCameraCapture(SpReqAnsContext<UIService_StopCameraCapture_Req, UIService_StopCameraCapture_Ans>::Pointer ctx)
+{
+	DbgToBeidou(ctx->link, __FUNCTION__)();
+
+	ErrorCodeEnum Error = m_pEntity->StopCameraCaptrue();
+	if (Error_Succeed == Error) {
+		LogEvent(Severity_Middle, LOG_EVT_UI_STOPCAMERACAPTURE, "");
+	}
+	else {
+		Error = Error_InvalidState;
+	}
+
+	ctx->Answer(Error);
+}
+
+
 ChannelClient::ChannelClient( CITCtrlEntity *pEntity ) : ChannelService_ClientBase(pEntity)
 {
 
@@ -2659,13 +2751,11 @@ void ChannelClient::OnMessage( ErrorCodeEnum Error, ChannelService_State_Info &M
 	}
 }
 
-
 LocalPlayClient::LocalPlayClient(CITCtrlEntity *pEntity) : PlayService_ClientBase(pEntity)
 {
 	
 }
 
-
 SalesRecordClient::SalesRecordClient(CITCtrlEntity* pEntity): SalesRecorderSerVice_ClientBase(pEntity)
 {
 

+ 31 - 1
Module/mod_interactivecontrol/mod_interactivecontrol.h

@@ -24,6 +24,7 @@ using namespace SalesRecorder;
 using namespace SIPPhone;
 
 #include "../mod_mediacontroller/MediaController_client_g.h"
+#include "../mod_mediacontroller/MediaController_msg_g.h"
 using namespace MediaController;
 
 #include "../mod_recorder/Recorder_client_g.h"
@@ -115,6 +116,8 @@ public:
 
 	void OnAudioPlayRet(const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, LocalMediaPlay::AudioPlayRet &evt);
 
+	void OnEnvCameraCapInfo(const char* pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, MediaController::EnvCameraCapInfo& evt);
+
 	virtual CServerSessionBase *OnNewSession(const char* /*pszRemoteEntityName*/, const char * /*pszParam*/);
 
 	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext);
@@ -229,6 +232,10 @@ public:
 
 	ErrorCodeEnum SetRemoteRecordCamera(int iCamera);
 
+	ErrorCodeEnum StartCameraCaptrue();
+
+	ErrorCodeEnum StopCameraCaptrue();
+
 private:
 	ErrorCodeEnum ConnectAssistChannel();
 
@@ -284,7 +291,6 @@ private:
 
 	void FreeCounterClient();
 
-
 	SP_BEGIN_MSG_DISPATCH_MAP(CITCtrlEntity)
 		SP_BEGIN_ENTITY_MSG("LocalMediaPlay")
 #ifdef RVC_OS_WIN
@@ -303,6 +309,25 @@ private:
 				LOG_TRACE("%s signature mismatched!", "AudioPlayRet"); \
 		}\
 			break;
+#endif
+		SP_END_ENTITY_MSG()
+		SP_BEGIN_ENTITY_MSG("MediaController")
+#ifdef RVC_OS_WIN
+			SP_MSG_HANDLE_NS(MediaController, EnvCameraCapInfo, OnEnvCameraCapInfo)
+#else
+		case eMsg_EnvCameraCapInfo:\
+			if (eMsgSig_EnvCameraCapInfo == dwMessageSignature) {
+				\
+					MediaController::EnvCameraCapInfo t; \
+					ErrorCodeEnum Error = SpBuffer2Object(Buffer, t); \
+					if (Error == Error_Succeed)\
+						OnEnvCameraCapInfo(pszEntityName, dwMessageId, dwMessageSignature, t); \
+			}
+			else {
+				\
+					LOG_TRACE("%s signature mismatched!", "EnvCameraCapInfo"); \
+			}\
+				break;
 #endif
 		SP_END_ENTITY_MSG()
 	SP_END_MSG_DISPATCH_MAP()
@@ -321,6 +346,7 @@ private:
 	ConnectClient* m_pConnectClient;
 	CAutoArray<CUUID> m_arrListener;
 	CUUID m_uidLocalMediaListenser;
+	CUUID m_uidMediaControllerListenser;
 	bool m_bConnectAssist;
 	bool m_bConnectPlayer;
 	int m_iRecordMode;
@@ -467,6 +493,10 @@ public:
 
 	virtual void Handle_SetRemoteRecordCamera(SpReqAnsContext<UIService_SetRemoteRecordCamera_Req, UIService_SetRemoteRecordCamera_Ans>::Pointer ctx);
 
+	virtual void Handle_StartCameraCapture(SpReqAnsContext<UIService_StartCameraCapture_Req, UIService_StartCameraCapture_Ans>::Pointer ctx);
+
+	virtual void Handle_StopCameraCapture(SpReqAnsContext<UIService_StopCameraCapture_Req, UIService_StopCameraCapture_Ans>::Pointer ctx);
+
 private:
 	CITCtrlEntity *m_pEntity;
 };

+ 31 - 1
Module/mod_recorder/mod_recorder.cpp

@@ -210,7 +210,7 @@ ErrorCodeEnum CRecorderEntity::__OnStart(ErrorCodeEnum preOperationError)
 	InitRecorder();
 		
 	int i = 0;
-	m_arrListener.Init(8);
+	m_arrListener.Init(10);
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_Middle, Error_IgnoreAll, EVENT_MOD_PAUSE_RECORD, NULL, false);
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_Middle, Error_IgnoreAll, EVENT_MOD_CONTINUE_RECORD, NULL, false);
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_Middle, Error_IgnoreAll, LOG_EVT_RECORDER_SECTION_FINISHED, NULL, false);
@@ -219,6 +219,8 @@ ErrorCodeEnum CRecorderEntity::__OnStart(ErrorCodeEnum preOperationError)
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_Middle, Error_IgnoreAll, LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED, NULL, false);
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_Middle, Error_IgnoreAll, LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED, NULL, false);
 	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_RETURNMENU, NULL, false);
+	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTCAMERACAPTURE, NULL, false);
+	GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPCAMERACAPTURE, NULL, false);
 
 	GetFunction()->RegistSysVarEvent(SYSVAR_ACTIVETRACKINGCAMERA,this);
 	GetFunction()->RegistSysVarEvent(SYSVAR_CAMERASTATE,this);
@@ -613,6 +615,34 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_RETURNMENU event");
 		break;
 
+	case LOG_EVT_UI_STARTCAMERACAPTURE:
+		{
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_STARTCAMERACAPTURE event");
+	#ifdef RVC_OS_WIN
+
+	#else
+			if (m_bStarted) {
+				StopRecord();
+			}
+			int local_view_x = 0;
+			int local_view_y = 0;
+			int local_view_cx = 0;
+			int local_view_cy = 0;
+			char strvideoname[256] = {0};
+			int isecond = 0;
+			sscanf(pszMessage, "%d@%d@%d@%d@%d@%s", &local_view_x, &local_view_y, &local_view_cx, &local_view_cy, &isecond, strvideoname);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("record name is %s, picture interval time is %d.", strvideoname, isecond);
+			SetRecordSessionID(strvideoname);
+			StartRecord(CSimpleStringA::Format("%s%s", RVC_TRANSATCION_RECORD_SUFFIX, strvideoname).GetData());
+	#endif
+		}
+		break;
+
+	case LOG_EVT_UI_STOPCAMERACAPTURE:
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_STOPCAMERACAPTURE event");
+		StopRecord();
+		break;
+
 	default:
 		break;
 	}

+ 1 - 34
Module/mod_sipphone/Event.h

@@ -155,46 +155,13 @@
 #define EVENT_MOD_SIP_PROCESS_MSG									0x301A0003	//sip process messsage
 #define EVENT_MOD_SIP_ENTITY_STARTING_COST							0x301A0004	//实体启动耗时
 
-//event
-#define EVENT_MOD_CONNECT_PICKUP_CALL								0x10303041	//提机呼叫
-
-#define EVENT_MOD_CONNECT_HANDFREE_TO_PICKUP						0x10303046	//免提->提机
-#define EVENT_MOD_CONNECT_PICKUP_TO_HANDFREE						0x10303047	//提机->免提
-
-#define EVENT_MOD_CONNECT_SLV_HANDFREECALL							0x10303050	//界面拨号,免提呼叫发送给SIPPHONE
-#define EVENT_MOD_CONNECT_SLV_PICKUPCALL							0x10303051  //界面拨号,话筒呼叫发送给SIPPHONE
-
-#define EVENT_MOD_CONNECT_AGENT_HANDFREE_PICKUP						0x10303052	//坐席控制免提转话筒
-#define EVENT_MOD_CONNECT_AGENT_PICKUP_HANDFREE						0x10303053	//坐席控制话筒转免提
-
-#define EVENT_MOD_CONNECT_STOP_RECORD_BROADCAST						0x10303060	//结束双录语音播报
-#define EVENT_MOD_CONNECT_BEGAIN_RECORD_CALL						0x10303061	//开始双录呼叫
-
 #define LOG_EVT_ENTER_ACM_FLOW										0x30500001	//进入坐席控制流程(initiactivetransfer发送)
 #define LOG_EVT_EXIT_ACM_FLOW										0x30500002  //进入坐席控制流程(initiactivetransfer发送)
 
-#define LOG_EVT_RELEASELIVEDETECTION								0x30400003  //通知sipphone释放主动活体
-
-#define LOG_EVT_UI_HIDEONLINEVIDEO									0x30B00010	//隐藏视频连线窗口
-#define LOG_EVT_UI_SHOWONLINEVIDEO									0x30B00011	//显示视频连线窗口
-
-#define LOG_EVT_UI_HIDELOCALVIDEO									0x30B00012	//隐藏本地视频窗口
-#define LOG_EVT_UI_SHOWLOCALVIDEO									0x30B00013	//显示本地视频窗口
-
-#define LOG_EVT_UI_HIDEPERSONAREA									0x30B00014	//隐藏人形框
-#define LOG_EVT_UI_SHOWPERSONAREA									0x30B00015	//显示隐藏人形框
-
-#define LOG_EVT_UI_STARTRECORD										0x30B00001	//开始录像
-#define LOG_EVT_UI_STOPRECORD										0x30B00002	//停止录像
-#define LOG_EVT_UI_RETURNMENU										0x30B00006	//退出到主菜单
-
-#define LOG_EVT_UI_STARTREMOTERECORD								0x30B0000F	//开始远程双录
-#define LOG_EVT_UI_STOPREMOTERECORD									0x30B00018	//停止远程录像
-
 #define LOG_EVT_HANDFREE_MODE_REMOTE_CALL							0x30400006	//以免提模式开始远程连线
 #define LOG_EVT_PICKUP_MODE_REMOTE_CALL								0x30400007	//以话筒模式开始远程连线
 
-#define ACM_CONTROL_PERSONAREA					0x30 // 控制人形框,0:隐藏,1:显示
+#define ACM_CONTROL_PERSONAREA										0x30 // 控制人形框,0:隐藏,1:显示
 
 //sysvar
 #define SYSVAR_SOUNDCARDSTATE	"SoundCardState"

+ 106 - 23
Module/mod_sipphone/mod_sipphone.cpp

@@ -12,6 +12,7 @@
 #include "audio_session.h"
 #include "video_session.h"
 #include "../mod_counterconnector/Event.h"
+#include "../mod_evtconverter/Event.h"
 
 #define EVT_CONVERTER	"EventConverter"
 
@@ -384,14 +385,6 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 		}
 		break;
 
-	case LOG_EVT_RELEASELIVEDETECTION:
-		{
-			m_stVideoParam.bActiveInspect = 0;
-			m_stVideoParam.bShowActiveImg = 0;
-			m_stVideoParam.iCameraSwitch = CAMERA_TYPE_ENV;
-		}
-		break;
-
 	case LOG_EVT_UI_HIDEONLINEVIDEO:
 		{
 			m_stVideoParam.nWindowState = 2;
@@ -419,15 +412,14 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 		}
 		break;
 
-	case LOG_EVT_UI_STOPRECORD:
 	case LOG_EVT_UI_STOPREMOTERECORD:
 		{          
 			if (m_stVideoParam.bShowRecordArea){
 				m_stVideoParam.bShowRecordArea = 0;
 			}
-			#ifdef RVC_OS_LINUX
+		#ifdef RVC_OS_LINUX
 			rvc_stop_video_render(m_render);
-			#endif
+		#endif
 		}
 		break;
 
@@ -442,9 +434,9 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 			if (m_stVideoParam.nWindowState == 4)
 			{
 				m_stVideoParam.nWindowState = 3;
-				#ifdef RVC_OS_LINUX
+			#ifdef RVC_OS_LINUX
 				ShowLocalVideo();
-				#endif
+			#endif
 			}
 		}
 		break;
@@ -452,9 +444,9 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 	case LOG_EVT_UI_HIDELOCALVIDEO:
 		{
 			m_stVideoParam.nWindowState = 4;
-			#ifdef RVC_OS_LINUX
+		#ifdef RVC_OS_LINUX
 			HideLocalVideo();
-			#endif
+		#endif
 		}
 		break;
 
@@ -470,6 +462,29 @@ void CSIPEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,const
 		}
 		break;
 
+	case LOG_EVT_UI_STARTCAMERACAPTURE:
+		{
+		#ifdef RVC_OS_WIN
+		#else
+			int local_view_x = 0;
+			int local_view_y = 0;
+			int local_view_cx = 0;
+			int local_view_cy = 0;
+			char str[256] = {0};
+			int isecond = 0;
+			sscanf(pszMessage, "%d@%d@%d@%d@%d@%s", &local_view_x, &local_view_y, &local_view_cx, &local_view_cy, &isecond, str);
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("local_view_x = %d, local_view_y = %d, local_view_cx = %d, local_view_cy = %d.", local_view_x, local_view_y, local_view_cx, local_view_cy);
+			StartCameraRender(local_view_x, local_view_y, local_view_cx, local_view_cy);
+		#endif
+		}
+		break;
+
+	case LOG_EVT_UI_STOPCAMERACAPTURE:
+		{
+			StopCameraRender();
+		}
+		break;
+
 	default:
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown dwUserCode = 0x%08x.",dwUserCode);
@@ -958,7 +973,7 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
 		CSmartPointer<IEntityFunction> Func = GetFunction();
 		CUUID id;
 		int i = 0;
-		m_arrListener.Init(26);
+		m_arrListener.Init(25);
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_HANDFREE_TO_PICKUP, EVT_CONVERTER);
 		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, EVENT_MOD_CONNECT_PICKUP_TO_HANDFREE, EVT_CONVERTER);
@@ -979,16 +994,10 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
 		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_EXIT_ACM_FLOW,NULL,false);
 		m_arrListener[i++] = id;
-		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_RELEASELIVEDETECTION,NULL,false);
-		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_HIDEONLINEVIDEO,NULL,false);
 		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_SHOWONLINEVIDEO,NULL,false);
 		m_arrListener[i++] = id;
-		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTRECORD,NULL,false);
-		m_arrListener[i++] = id;
-		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPRECORD,NULL,false);
-		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_RETURNMENU,NULL,false);
 		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_HIDELOCALVIDEO,NULL,false);
@@ -1011,6 +1020,10 @@ ErrorCodeEnum CSIPEntity::__OnStart(ErrorCodeEnum preOperationError)
 		m_arrListener[i++] = id;
 		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_PICKUP_MODE_REMOTE_CALL,NULL,false);
 		m_arrListener[i++] = id;
+		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STARTCAMERACAPTURE, NULL, false);
+		m_arrListener[i++] = id;
+		Func->SubscribeLog(id, this, Log_Event, Severity_None, Error_IgnoreAll, LOG_EVT_UI_STOPCAMERACAPTURE, NULL, false);
+		m_arrListener[i++] = id;
 	}
 
 	{
@@ -2415,6 +2428,67 @@ CSimpleStringA CSIPEntity::GetAudioDeviceJsonInfos(bool bmicro)
 
 #endif
 
+ErrorCodeEnum CSIPEntity::StartCameraRender(int ivideoview_x, int ivideoview_y, int ivideoview_cx, int ivideoview_cy)
+{
+#ifdef RVC_OS_WIN
+#else
+	m_render = new rvc_video_render_t();
+	videorender_callback_t t_callback = { 0 };
+	t_callback.debug = &__video_render_log;
+	rvc_video_render_params_t render_param = { 0 };
+	render_param.ilocal_view_cx = ivideoview_cx;
+	render_param.ilocal_view_cy = ivideoview_cy;
+	render_param.ilocal_view_x = ivideoview_x;
+	render_param.ilocal_view_y = ivideoview_y;
+	render_param.ilocal_render_queue = 1;
+
+	m_render->plocal_render = CreateVideoRenderObj(&t_callback);
+	LogWarn(Severity_Low, Error_Debug, EVENT_MOD_SIP_LOCAL_VIDEO_RENDER_CREATE, "local video render create.");
+
+	memcpy(&m_render->render_param, &render_param, sizeof(rvc_video_render_params_t));
+	m_render->local_render_threadid = 0;
+	m_render->remote_render_threadid = 0;
+
+	rvc_video_box_move_callback_t t_render_callback = { 0 };
+	t_render_callback.on_video_box_move = &__on_video_box_move;
+	t_render_callback.user_data = this;
+
+	rvc_video_render_window_type_callback_t t_window_type_callback = { 0 };
+	t_window_type_callback.on_window_type = &__on_window_type_callback;
+	t_window_type_callback.user_data = this;
+	memcpy(&m_render->cb, &t_window_type_callback, sizeof(rvc_video_render_window_type_callback_t));
+	m_stVideoParam.bShowPersonArea = 0;
+
+	if (Error_Succeed == rvc_start_video_render(m_render, false, &t_render_callback)) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("start video render success.");
+	}
+#endif // RVC_OS_WIN
+
+	return Error_Succeed;
+}
+
+ErrorCodeEnum CSIPEntity::StopCameraRender()
+{
+#ifdef RVC_OS_WIN
+#else
+	if (Error_Succeed == rvc_stop_video_render(m_render)) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("stop video render success.");
+	}
+	if (NULL!= m_render->plocal_render) {
+		DestroyVideoRenderObj(m_render->plocal_render);
+	}
+
+	if (NULL != &m_render->local_render_stop_sem) {
+		sem_destroy(&m_render->local_render_stop_sem);
+	}
+
+	delete(m_render);
+	m_render = NULL;
+#endif // RVC_OS_WIN
+
+	return Error_Succeed;
+}
+
 //
 // CSIPPhoneSession
 //
@@ -2951,7 +3025,7 @@ void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
 }
 
 #else
-void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd )
+void CSIPPhoneSession::control_video( ControlVideoCommand_t *pCmd)
 {
 	if (m_pCall) 
 	{
@@ -3084,6 +3158,15 @@ int CSIPPhoneSession::stop_video_render()
 	}
 	DestroyVideoRenderObj(m_pEntity->m_render->plocal_render);
 	DestroyVideoRenderObj(m_pEntity->m_render->premote_render);
+
+	if (NULL != &m_pEntity->m_render->local_render_stop_sem) {
+		sem_destroy(&m_pEntity->m_render->local_render_stop_sem);
+	}
+
+	if (NULL != &m_pEntity->m_render->remote_render_stop_sem) {
+		sem_destroy(&m_pEntity->m_render->remote_render_stop_sem);
+	}
+
 	delete(m_pEntity->m_render);
 	m_pEntity->m_render = NULL;
 

+ 4 - 2
Module/mod_sipphone/mod_sipphone.h

@@ -348,9 +348,9 @@ private:
 	ErrorCodeEnum SaveRestartRunConfig(unsigned int utime);
 	ErrorCodeEnum AudioDspFlagsUseCentersetting(endpoint_conf_t* conf);
 	//载入运行时配置
-	ErrorCodeEnum LoadAudioRunConfig(int&nHandfreeout,int&nPickupout,int&nHandfreein,int&nPickupin);
+	ErrorCodeEnum LoadAudioRunConfig(int&nHandfreeout, int&nPickupout, int&nHandfreein, int&nPickupin);
 	//保存运行时
-	ErrorCodeEnum SaveAudioRunConfig(int nHandfreeout,int nPickupout,int nHandfreein,int nPickupin);
+	ErrorCodeEnum SaveAudioRunConfig(int nHandfreeout, int nPickupout, int nHandfreein, int nPickupin);
 	// we use root.ini Video section config to decide camera count
 	ErrorCodeEnum DecideScreenCount(int &nCount);
 	DeviceTypeEnum RvcGetDeviceType();
@@ -362,6 +362,8 @@ private:
 	uint32_t CheckAudioDevice();
 	ErrorCodeEnum SetSoundCardSysVar(const CSimpleStringA& newVal);
  	void HandleCheckAudioDevice(const char* pszValue);
+	ErrorCodeEnum StartCameraRender(int ivideoview_x, int ivideoview_y, int ivideoview_cx, int ivideoview_cy);
+	ErrorCodeEnum StopCameraRender();
 
 public:
 	int m_kept_volume_in[2];

+ 0 - 4
Module/mod_sipphone/unix/video_session.cpp

@@ -389,7 +389,6 @@ static void local_put_frame(void *user_data, video_frame *frame)
 
 static int on_rx_frame(video_frame *frame, void *user_data)
 {
-	//LOG_FUNCTION();
 	video_session_t *session = (video_session_t *)user_data;
 	session->irecv_frameid++;
 	if (DOUBLERECORD_CALLTYPE == session->conf.nCallType) {
@@ -430,10 +429,7 @@ static int on_rx_frame(video_frame *frame, void *user_data)
 		}
 	}
 #else
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%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);
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s:%d", __FUNCTION__, __LINE__);
-
 		used = 1;
 
 		if (false == session->bremoterender) {

+ 0 - 4
Module/mod_sipphone/uuid.cpp

@@ -16,10 +16,6 @@
 #include <audioclient.h>
 
 
-
-
-
-
 const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
 const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
 const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);

+ 16 - 4
Module/mod_sipphone/video_render.cpp

@@ -139,6 +139,7 @@ void* rvc_videorender_func(void* arg)
 {
 	rvc_video_render_t* param = (rvc_video_render_t*)arg;
 	int ilocal_video_fresh_time = param->render_param.ilocal_fresh_time;
+	bool bremote_video = false;
 
 	int irender_camera = CAMERA_TYPE_ENV;
 	if (param->render_param.ilocal_view_cx < param->render_param.ilocal_view_cy) {
@@ -150,9 +151,17 @@ void* rvc_videorender_func(void* arg)
 	int iwidth = 0;
 	int iheight = 0;
 	if (CAMERA_TYPE_ENV == irender_camera) {
-		local_video_queue = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_PREVIEW_QUEUE);
-		iwidth = REC_COMMON_VIDEO_PREVIEW_WIDTH;
-		iheight = REC_COMMON_VIDEO_PREVIEW_HEIGHT;
+		if (0 == param->render_param.ilocal_render_queue) {
+			local_video_queue = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_PREVIEW_QUEUE);
+			iwidth = REC_COMMON_VIDEO_PREVIEW_WIDTH;
+			iheight = REC_COMMON_VIDEO_PREVIEW_HEIGHT;
+		}
+		else {
+			local_video_queue = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE);
+			iwidth = REC_COMMON_VIDEO_SNAPSHOT_WIDTH;
+			iheight = REC_COMMON_VIDEO_SNAPSHOT_HEIGHT;
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("use sanpshot queue.");
+		}
 	}
 	else {
 		local_video_queue = new Clibvideoqueue(REC_COMMON_VIDEO_OPT_SHM_PREVIEW_QUEUE);
@@ -206,6 +215,7 @@ void* rvc_videorender_func(void* arg)
 			if (0 != param->premote_render->VideoRenderSetParam(&tparam_remote)) {
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("video render set param failed.");
 			}
+			bremote_video = true;
 		}
 		else {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("remote video render is null.");
@@ -258,7 +268,9 @@ void* rvc_videorender_func(void* arg)
 			if (bset) {
 				if (bshow_local) {
 					param->plocal_render->ShowVideoWindow();
-					param->premote_render->ShowVideoWindow();
+					if (bremote_video) {
+						param->premote_render->ShowVideoWindow();
+					}
 					bset = false;
 				}
 			}

+ 1 - 0
Module/mod_sipphone/video_render.h

@@ -43,6 +43,7 @@ typedef struct rvc_video_render_params_s {
 	int iremote_move; 
 	int ilocal_fresh_time;
 	int iremote_fresh_time;
+	int ilocal_render_queue;
 }rvc_video_render_params_t;
 
 

+ 49 - 51
Module/mod_snapshot/mod_snapshot.cpp

@@ -20,6 +20,8 @@ using namespace AssistantChannel;
 #include "cv.h"
 #include "highgui.h"
 
+#include "../mod_interactivecontrol/Event.h"
+
 
 #ifdef RVC_OS_WIN
 #define ENV_CAP_TIMEOUT 15
@@ -33,6 +35,10 @@ using namespace AssistantChannel;
 #define RVC_SAFE_DELETE(p) { if(p){ (p)->SafeDelete();  (p)=NULL;} }
 #endif //RVC_SAFE_DELETE
 
+#ifndef MAX_PATH
+#define  MAX_PATH  260
+#endif
+
 class CPhotoCaptureEntity;
 
 class ChannelClient : public ChannelService_ClientBase
@@ -80,7 +86,9 @@ int RotationDown(unsigned char* src, int srcW, int srcH, int channel)
 class CPhotoCaptureEntity : public CEntityBase, public ITimerListener, public ILogListener
 {
 public:
-	CPhotoCaptureEntity() : m_video_env_q(NULL), m_video_opt_q(NULL), m_dwCapture(0), m_bConnectAssist(FALSE) {m_pChannelClient = NULL;}
+	CPhotoCaptureEntity() : m_video_env_q(NULL), m_video_opt_q(NULL), m_dwCapture(0), m_bConnectAssist(false) {
+		m_pChannelClient = NULL;
+	}
 	virtual ~CPhotoCaptureEntity() {}
 	virtual const char *GetEntityName() const { return "Snapshot"; }
 
@@ -130,7 +138,7 @@ public:
 	{
 		m_pChannelClient = new ChannelClient(this);
 		if (Error_Succeed == ConnectAssistChannel()) {
-			m_bConnectAssist = TRUE;
+			m_bConnectAssist = true;
 		}
 		else {
 			GetFunction()->SetTimer(2, this, 3370);
@@ -298,8 +306,10 @@ public:
 			Info.data.m_iLength = sizeof(rc);
 			(*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
 		}
-		if (frm)
+
+		if (frm) {
 			video_frame_delete(frm);
+		}
 	}
 
 	ErrorCodeEnum StartCapture(int id)
@@ -307,7 +317,8 @@ public:
 #if defined(RVC_OS_LINUX)
 		if (eStand1SPlusType == m_eDeviceType) {
 			m_video_env_q = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE);
-		} else { //  == 2
+		} 
+		else { //  == 2
 			m_video_env_q = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_SNAPSHOT_QUEUE);
 			m_video_opt_q = new Clibvideoqueue(REC_COMMON_VIDEO_OPT_SHM_SNAPSHOT_QUEUE);
 		}
@@ -377,13 +388,13 @@ public:
 			m_dwCapture = 0;
 		}
 		else  if (2 == dwTimerID) {
-			if (FALSE == m_bConnectAssist) {
+			if (false == m_bConnectAssist) {
 				if (Error_Succeed == ConnectAssistChannel()) {
-					m_bConnectAssist = TRUE;
+					m_bConnectAssist = true;
 				}
 			}
 
-			if (TRUE == m_bConnectAssist) {
+			if (true == m_bConnectAssist) {
 				GetFunction()->KillTimer(2);
 			}
 		}
@@ -393,59 +404,45 @@ public:
 		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, const linkContext& pLinkInfo)
 	{
-		if (dwUserCode == MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_ENVOPT || 
-			dwUserCode == MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_OPT ||
-			dwUserCode == MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_ENV) 
+		switch (dwUserCode)
 		{
-			DWORD dwNow = SP::Module::Comm::RVCGetTickCount();
-			Capture(Error_Succeed);
-			StopCapture();
-		}
-		else if (LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS == dwUserCode)
-		{
-			Sleep(975);
-			if (m_pChannelClient != NULL){
-				m_pChannelClient->GetFunction()->CloseSession();
-				m_pChannelClient = NULL;
-				m_bConnectAssist = FALSE;
+		case MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_ENVOPT:
+		case MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_OPT:
+		case MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_ENV:
+			{
+				DWORD dwNow = SP::Module::Comm::RVCGetTickCount();
+				Capture(Error_Succeed);
+				StopCapture();
 			}
+			break;
 
-			if (Error_Succeed == ConnectAssistChannel()) {
-				m_bConnectAssist = TRUE;
-			}
-			else {
-				GetFunction()->SetTimer(2, this, 3370);
+		case LOG_EVT_MOD_ASSISCHAN_STARTED_SUCCESS:
+			{
+				Sleep(975);
+				if (m_pChannelClient != NULL) {
+					m_pChannelClient->GetFunction()->CloseSession();
+					m_pChannelClient = NULL;
+					m_bConnectAssist = false;
+				}
+
+				if (Error_Succeed == ConnectAssistChannel()) {
+					m_bConnectAssist = true;
+				}
+				else {
+					GetFunction()->SetTimer(2, this, 3370);
+				}
 			}
-		}
-	}
+			break;
 
-private:
-	// we use root.ini Video section config to decide camera count
-	ErrorCodeEnum DecideCameraCount(int &nCount)
-	{
-		CSmartPointer<IEntityFunction> spFunction = GetFunction();
-		CSmartPointer<IConfigInfo> spConfig;
-		ErrorCodeEnum Error = spFunction->OpenConfig(Config_Root, spConfig);
-		if (Error == Error_Succeed) 
-		{
-			CSimpleStringA strVideoEnv;
-			CSimpleStringA strVideoOpt;
-			SpIniMappingTable table;
-			nCount = 0;
-			table.AddEntryString("Video", "EnvCamera", strVideoEnv, "$");
-			table.AddEntryString("Video", "OptCamera", strVideoOpt, "$");
-			Error = table.Load(spConfig);
-			if (Error == Error_Succeed) 
+		default:
 			{
-				if (strVideoEnv.GetLength() > 1)
-					nCount++;
-				if (strVideoOpt.GetLength() > 1)
-					nCount++;
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("unknown dwUserCode = 0x%08x.", dwUserCode);
 			}
+			break;
 		}
-		return Error;
 	}
 
+private:
 	ErrorCodeEnum ConnectAssistChannel()
 	{
 		if (m_pChannelClient == NULL){
@@ -473,6 +470,7 @@ private:
 		return Error;
 	}
 
+
 private:
 	Clibvideoqueue *m_video_env_q;
 	Clibvideoqueue *m_video_opt_q;
@@ -481,7 +479,7 @@ private:
 	DWORD m_dwCapture;
 	DeviceTypeEnum m_eDeviceType;
 	CAutoArray<CUUID> m_arrListener;
-	BOOL m_bConnectAssist;
+	bool m_bConnectAssist;
 };
 
 void ChannelClient::OnMessage( ErrorCodeEnum Error, ChannelService_Packet_Info &Msg, CSmartPointer<IReleasable> pData )

+ 1 - 1
Other/libaudiomgr/linux/libaudiomgr_linux.cpp

@@ -605,7 +605,7 @@ int AudioMgrImpl::audio_get_device_name(char* pstrbuf, size_t ulen, bool binput,
 	else{
 		audio_device = audio_get_output_device(index);
 	}
-		
+
 	size_t unamelen = strlen(audio_device->description);
 	if (ulen > unamelen){
 		memcpy(pstrbuf, audio_device->description, ulen);

+ 2 - 2
Other/libvideorecord/libvideorecord_impl.cpp

@@ -1800,7 +1800,7 @@ bool libvideorecord_impl::PauseRecord()				//暂停录像
 
 
 bool libvideorecord_impl::StartVideoRecord(int fps, int videoquality, eVideoFormat eFormat, const SubtitleParam* subtitleParam, bool bWholeSection,
-	bool bSessionManage, const char* pathname, int pathlength, const char* wmvfilename, int filenamelength, Rvc_RecordAudioParam_t* pAudioParam)//开始记录
+	bool bSessionManage, const char* pathname, int pathlength, const char* pfilename, int filenamelength, Rvc_RecordAudioParam_t* pAudioParam)//开始记录
 {
 	m_audioqueue = NULL;
 
@@ -1823,7 +1823,7 @@ bool libvideorecord_impl::StartVideoRecord(int fps, int videoquality, eVideoForm
 #endif
 	}
 	else {
-		memcpy(m_FileName, wmvfilename, filenamelength);
+		memcpy(m_FileName, pfilename, filenamelength);
 	}
 
 	m_eFormat = eFormat;

+ 1 - 1
Other/libvideorecord/libvideorecord_impl.h

@@ -52,7 +52,7 @@ public:
 	CHostApi* GetHostApi();
 	int VideoRecord();
 	bool StartVideoRecord(int fps, int videoquality, eVideoFormat eFormat, const SubtitleParam* subtitleParam, bool bWholeSection,
-		bool bSessionManage, const char* pathname, int pathlength, const char* wmvfilename, int filenamelength, Rvc_RecordAudioParam_t* pAudioParam);//开始记录
+		bool bSessionManage, const char* pathname, int pathlength, const char* pfilename, int filenamelength, Rvc_RecordAudioParam_t* pAudioParam);//开始记录
 	bool StopVideoRecord();			//退出
 	bool PauseRecord();				//暂停录像
 	bool ContinueRecord();			//继续录像

+ 4 - 3
Other/unix/libvideocapture/ivideocaptureinterface.h

@@ -75,7 +75,7 @@
 #define VIDEOCAP_OPT_ENABLE_ASYNC_GRAB 0x08
 #define VIDEOCAP_OPT_HOZFLIP		0x10
 
-#define VIDEOCAP_MAX_MODE       12
+#define VIDEOCAP_MAX_MODE			12
 
 /* video device capability */
 typedef struct videocap_device_cap_s {
@@ -142,9 +142,10 @@ public:
 	virtual int StartVideoCapture() = 0;
 	virtual int StopVideoCapture() = 0;
 	virtual void VideoCaptureDestroy() = 0;
-	virtual int GetCamBrightness(int* ibright) = 0;
-	virtual int SetCamBrightness(int ibright) = 0;
+	virtual int GetCamBrightness(int* ibright, bool bRawRange) = 0;
+	virtual int SetCamBrightness(int ibright, bool bRawRange) = 0;
 	virtual int SetCamAutoBrightness() = 0;
+	virtual bool GetCamRawBrightnessRange(int* imin, int* imax) = 0;
 };
 
 

+ 40 - 13
Other/unix/libvideocapture/linux/videocapture_linux.cpp

@@ -142,8 +142,6 @@ int VideoCaptureImpl::VideoCaptureSetParam(videocap_param_t* param)
 	else {
 		//CapLog("%s", "param->option & VIDEOCAP_OPT_EANBLE_RESIZE success.");
 	}
-
-	//CapLog("%s:%d param->option = %d.", __FUNCTION__, __LINE__, param->option);
 	
 	m_capture = (videocap_t*)malloc(sizeof(videocap_t));
 	if (!m_capture) {
@@ -156,8 +154,6 @@ int VideoCaptureImpl::VideoCaptureSetParam(videocap_param_t* param)
 	if (param->option & VIDEOCAP_OPT_ENABLE_GRAB) {
 		int width = mode_width[param->cap_mode];
 		int height = mode_height[param->cap_mode];
-
-		//CapLog("%s:%d, width = %d, height = %d.", __FUNCTION__, __LINE__, width, height);
 		
 		if (video_frame_alloc(width, height, param->frame_fmt, &m_capture->cap_frame) != 0) {
 			free(m_capture);
@@ -174,8 +170,6 @@ int VideoCaptureImpl::VideoCaptureSetParam(videocap_param_t* param)
 		int width = mode_width[param->res_mode];
 		int height = mode_height[param->res_mode];
 		
-		//CapLog("%s:%d, width = %d, height = %d.", __FUNCTION__, __LINE__, width, height);
-		
 		if (video_frame_alloc(width, height, param->frame_fmt, &m_capture->res_frame) != 0) {
 			if (param->option & VIDEOCAP_OPT_ENABLE_GRAB) {
 				video_frame_free(&m_capture->res_frame);
@@ -204,8 +198,6 @@ int VideoCaptureImpl::VideoCaptureSetParam(videocap_param_t* param)
 			return -1;
 		}
 	}
-
-	//CapLog("%s:%d, param->irotate %d.", __FUNCTION__, __LINE__, param->irotate);
 	
 	m_rotate = RotateTrans(param->irotate);
 
@@ -860,6 +852,7 @@ bool VideoCaptureImpl::DeAllocateVideoBuffers()
 bool VideoCaptureImpl::AlignedMallocVideoBuffer()
 {
 	bool bret = false;
+
 	int stride_y = m_in_cap_width;
 	int stride_u = (m_in_cap_width + 1) / 2;
 	int stride_v = (m_in_cap_width + 1) / 2;
@@ -963,16 +956,23 @@ void VideoCaptureImpl::VideoCaptureDestroy()
 	delete this;
 }
 
-int VideoCaptureImpl::GetCamBrightness(int* ibright)
+int VideoCaptureImpl::GetCamBrightness(int* ibright, bool bRawRange)
 {
 	int iret = -1;
+
 	struct v4l2_control ctrl;
 	ctrl.id = V4L2_CID_BRIGHTNESS;
 	if (ioctl(m_deviceFd,VIDIOC_G_CTRL,&ctrl) == -1){
 		CapLog("VIDIOC_S_CTRL get V4L2_CID_BRIGHTNESS error for %s", strerror(errno));
 	}
 	else {
-		*ibright = TransFromRealBrightnessValue(ctrl.value);
+		if (bRawRange) {
+			*ibright = ctrl.value;
+		}
+		else {
+			*ibright = TransFromRealBrightnessValue(ctrl.value);
+		}
+		
 		iret = 0;
 	}	
 
@@ -980,16 +980,24 @@ int VideoCaptureImpl::GetCamBrightness(int* ibright)
 }
 
 
-int VideoCaptureImpl::SetCamBrightness(int ibright)
+int VideoCaptureImpl::SetCamBrightness(int ibright, bool bRawRange)
 {
 	int iret = -1;
+
 	struct v4l2_control ctrl;
 	ctrl.id = V4L2_CID_BRIGHTNESS;
-	ctrl.value = TransToRealBrightnessValue(ibright);
+	if (bRawRange) {
+		ctrl.value = ibright;
+	}
+	else {
+		ctrl.value = TransToRealBrightnessValue(ibright);
+	}
+	
 	if (ioctl(m_deviceFd, VIDIOC_S_CTRL, &ctrl) == -1){
-		CapLog("VIDIOC_S_CTRL set V4L2_CID_BRIGHTNESS error for %s", strerror(errno));
+		CapLog("VIDIOC_S_CTRL set V4L2_CID_BRIGHTNESS error for %s.", strerror(errno));
 	}
 	else{
+		CapLog("VIDIOC_S_CTRL set V4L2_CID_BRIGHTNESS to %d.", ibright);
 		iret = 0;
 	}
 
@@ -1037,6 +1045,25 @@ bool VideoCaptureImpl::GetCamBrightnessInfo()
 }
 
 
+bool VideoCaptureImpl::GetCamRawBrightnessRange(int* imin, int* imax)
+{
+	bool bret = false;
+
+	struct v4l2_queryctrl qctrl;
+	qctrl.id = V4L2_CID_BRIGHTNESS;
+	if (ioctl(m_deviceFd, VIDIOC_QUERYCTRL, &qctrl) == -1) {
+		CapLog("VIDIOC_QUERYCTRL get V4L2_CID_BRIGHTNESS error for %s", strerror(errno));
+	}
+	else {
+		CapLog("VIDIOC_QUERYCTRL get V4L2_CID_BRIGHTNESS success {min(%d) - max(%d)}, default is %d.", qctrl.minimum, qctrl.maximum, qctrl.default_value);
+		*imin = qctrl.minimum;
+		*imax = qctrl.maximum;
+		bret = true;
+	}
+
+	return bret;
+}
+
 //100 to real brightness value
 int VideoCaptureImpl::TransToRealBrightnessValue(int ibright)
 {

+ 3 - 2
Other/unix/libvideocapture/linux/videocapture_linux.h

@@ -54,9 +54,10 @@ public:
 	virtual int StartVideoCapture();
 	virtual int StopVideoCapture();
 	virtual void VideoCaptureDestroy();
-	int GetCamBrightness(int* ibright);
-	int SetCamBrightness(int ibright);
+	int GetCamBrightness(int* ibright, bool bRawRange);
+	int SetCamBrightness(int ibright, bool bRawRange);
 	int SetCamAutoBrightness();
+	bool GetCamRawBrightnessRange(int* imin, int* imax);
 
 	bool GetCamBrightnessInfo();
 	bool VideoCaptureStarted();