Browse Source

Z991239-5240 #comment mod_CameraConfig 移除

80374374 1 year ago
parent
commit
e49062bcf9

+ 0 - 3
Module/CMakeLists.txt

@@ -286,9 +286,6 @@ add_subdirectory(mod_vtmloader)
 #below should be compiled succesufully.
 add_subdirectory(mod_SalesRecorder)
 add_subdirectory(mod_sipphone)
-#to remove
-add_subdirectory(mod_CameraConfigManage)
-
 endif(MSVC)
 
 

+ 0 - 122
Module/mod_CameraConfigManage/CMakeLists.txt

@@ -1,122 +0,0 @@
-define_module("CameraConfigManage")
-
-if(MSVC)
-    set(${MODULE_PREFIX}_SRCS
-        ${CMAKE_CURRENT_SOURCE_DIR}/win/Capture.cpp
-        mod_CameraConfigManage.cpp
-        mod_CameraConfigManage.h
-        CameraConfigManage_client_g.h
-        CameraConfigManage_def_g.h
-        CameraConfigManage_msg_g.h
-        CameraConfigManage_server_g.h
-    )
-else()
-    set(${MODULE_PREFIX}_SRCS
-        ${MODULE_BASE_DIR}/mod_mediacontroller/${MODULE_PLAFORM_SUBDIR}/capture.cpp
-        mod_CameraConfigManage.cpp
-        mod_CameraConfigManage.h
-        CameraConfigManage_client_g.h
-        CameraConfigManage_def_g.h
-        CameraConfigManage_msg_g.h
-        CameraConfigManage_server_g.h
-    )
-endif(MSVC)
-
-set(MOD_VERSION_STRING "0.0.1-dev1")
-add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
-
-target_include_directories(${MODULE_NAME} PRIVATE
-    ${MODULE_BASE_DIR}/mod_ScannerSet
-	${MODULE_BASE_DIR}/mod_mediacontroller
-	${CONAN_INCLUDE_DIRS_OPENCV}
-	${CONAN_INCLUDE_DIRS_OPENCV}/opencv
-	${CONAN_INCLUDE_DIRS_OPENCV}/opencv2/imgcodecs
-	${MODULE_BASE_DIR}
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libvideoframework
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libvideohorflip
-	${OTHER_LIB_PLATFORM_BASE_DIR}/rvcmediacommon
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libaudioqueue
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libvideoqueue
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libmediadeviceinfo
-	${OTHER_LIB_BASE_DIR}/libaudiomgr
-	${OTHER_LIB_PLATFORM_BASE_DIR}/libvideocapture
-    ${CONAN_INCLUDE_DIRS_PORTAUDIO}
-    ${CONAN_INCLUDE_DIRS_FFMPEG}
-)
-
-target_link_directories(${MODULE_NAME} PRIVATE
-	${CONAN_LIB_DIRS_FFMPEG}
-	${CONAN_LIB_DIRS_SPANDSP}
-	${CONAN_LIB_DIRS_SPEEXDSP}
-)
-
-if(MSVC)
-	target_include_directories(${MODULE_NAME} PRIVATE
-		${CONAN_INCLUDE_DIRS_PORTAUDIO}
-		${CONAN_INCLUDE_DIRS_IPP}
-		${CONAN_INCLUDE_DIRS_SPEEXDSP}
-		${CONAN_INCLUDE_DIRS_APR}/apr-1
-		${CONAN_INCLUDE_DIRS_SPANDSP}
-	)
-	target_link_directories(${MODULE_NAME} PRIVATE
-		${CONAN_LIB_DIRS_PORTAUDIO}
-		${CONAN_LIB_DIRS_IPP}
-		${CONAN_LIB_DIRS_APACHE-APR}
-		${CONAN_LIB_DIRS_LIB8K}
-)
-else()
-		target_include_directories(${MODULE_NAME} PRIVATE
-			${CONAN_INCLUDE_DIRS_PULSEAUDIO})
-		target_link_directories(${MODULE_NAME} PRIVATE
-			${CONAN_LIB_DIRS_PULSEAUDIO}
-			${CONAN_LIB_DIRS_APR}
-			${CONAN_LIB_DIRS_SOFIA}
-			${CONAN_LIB_DIRS_ZLIB}
-			${CONAN_LIB_DIRS_OPENCV}
-		)
-endif(MSVC)
-
-
-
-# 添加实体需要依赖的其他共享库(包括系统库)
-if(MSVC)
-	set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} 
-		${CONAN_PKG_LIBS_IPP}
-		${CONAN_PKG_LIBS_PORTAUDIO}
-		${CONAN_PKG_LIBS_FFMPEG}
-		${CONAN_PKG_LIBS_APACHE-APR}
-		${CONAN_PKG_LIBS_LIB8K}
-		ws2_32
-		strmiids
-		winmm
-		Vfw32
-		ole32
-		libaudioframework
-		libvideoframework
-		audioqueue
-		videoqueue
-		libvideohorflip
-		audiorender
-	)
-else(MSVC)
-	set(${MODULE_PREFIX}_LIBS  ${MODULE_BASE_LIBS} 	
-		${CONAN_PKG_LIBS_FFMPEG}
-		mediadeviceinfo
-		videocapture
-		asound
-		libaudioframework
-		libvideoframework
-		audioqueue
-		videoqueue
-		${CONAN_PKG_LIBS_APR}
-		${CONAN_PKG_LIBS_SPANDSP}
-		${CONAN_PKG_LIBS_SPEEXDSP}
-		${CONAN_PKG_LIBS_PULSEAUDIO}
-		audiomgr
-	)
-endif(MSVC)
-
-target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
-deploy_module(${MODULE_PREFIX} ${MODULE_NAME})
-
-

+ 0 - 160
Module/mod_CameraConfigManage/CameraConfigManage.xml

@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="gb2312" ?>
-<entity name="CameraConfigManage">
-<!--1:外部扬声器;2:话筒扬声器:3:外部麦克风;4:话筒麦克风-->
-  <const name="MediaDev_OutSpeaker" value="1" />
-  <const name="MediaDev_InSpeaker" value="2" />
-  <const name="MediaDev_OutMicrophone" value="3" />
-  <const name="MediaDev_InMicrophone" value="4" />
-  
-	<!-- 摄像头配置管理服务 -->
-	<class name="CameraConfigManageService" overlap="true"  exclusive="false">
-		<!--开始摄像头配置管理-->
-		<oneway name="BeginCameraConfigManage" overlap="true">
-		</oneway>
-		<!--结束摄像头配置管理-->
-		<oneway name="EndCameraConfigManage" overlap="true">
-		</oneway>
-		<!--获取摄像头列表-->
-		<twoway name="GetCameraList" overlap="true">
-			<req>
-			</req>
-			<res>
-				<param name="AvailableList" type="array_string"/>
-				<param name="EnvCamera" type="string"/>
-				<param name="OptCamera" type="string"/>
-				<param name="EwsCamera" type="string"/>
-			</res>
-		</twoway>
-		<!--回显指定摄像头-->
-		<twoway name="EchoSomeCamera" overlap="true">
-			<req>
-				<param name="CameraName" type="string"/>
-				<param name="WndParams" type="string"/>
-			</req>
-			<res>
-				<param name="Error_Code" type="uint"/>
-				<param name="Error_Msg" type="string"/>
-			</res>
-		</twoway>
-		<!--保存配置请求-->
-		<twoway name="SaveCameraConfig" overlap="true">
-			<req>
-				<param name="EnvCamera" type="string"/>
-				<param name="OptCamera" type="string"/>
-				<param name="EwsCamera" type="string"/>
-			</req>
-			<res>
-				<param name="Error_Code" type="uint"/>
-				<param name="Error_Msg" type="string"/>
-			</res>
-		</twoway>
-		<!--结束回显指定摄像头-->
-		<twoway name="StopEchoSomeCamera" overlap="true">
-			<req>
-				<param name="CameraName" type="string"/>
-			</req>
-			<res>
-				<param name="Error_Code" type="uint"/>
-				<param name="Error_Msg" type="string"/>
-			</res>
-		</twoway>
-		<!--查询连线状态-->
-		<twoway name="QueryCallState" overlap="true">
-			<req>
-			</req>
-			<res>
-				<param name="CallState" type="string"/>
-			</res>
-		</twoway>
-		<!--查询UI状态-->
-		<twoway name="QueryUIState" overlap="true">
-			<req>
-			</req>
-			<res>
-				<param name="UIState" type="string"/>
-			</res>
-		</twoway>
-		<!--自纠正摄像头配置请求-->
-		<twoway name="AutoCorrectCameraConfig" overlap="true">
-			<req>
-			</req>
-			<res>
-				<param name="EnvCamera" type="string"/>
-				<param name="OptCamera" type="string"/>
-				<param name="EwsCamera" type="string"/>
-			</res>
-		</twoway>
-    <!--获取可用媒体信息-->
-    <twoway name="GetMediaAvailableList" overlap="true">
-      <req>
-        <!--0:获取所有设备信息(摄像头/扬声器/麦克风等);1:摄像头;2:麦克风:4:扬声器-->
-        <param name="type" type="uint"/>
-        <!--0:默认所有类型,对于摄像头:1-->
-        <param name="interest" type="uint"/>
-        <param name="reserverd1" type="int"/>
-        <param name="reserverd2" type="string"/>
-        <param name="reserverd3" type="string"/>
-      </req>
-      <res>
-        <param name="result" type="int"/>
-        <param name="message" type="string"/>
-        <param name="AvailableList" type="array_string"/>
-        <!--1:摄像头;2:麦克风:4:扬声器-->
-        <param name="ListItemType" type="array_int"/>
-        <param name="ListItemStatus" type="array_int"/>
-        <param name="reserverd1" type="int"/>
-        <param name="reserverd2" type="string"/>
-      </res>
-    </twoway>
-    <!--设置指定媒体设备类型-->
-    <twoway name="SetMediaDevice" overlap="true">
-      <req>
-        <!--1:外部扬声器;2:话筒扬声器:3:外部麦克风;4:话筒麦克风-->
-        <param name="type" type="uint"/>
-        <param name="name" type="string"/>
-        <param name="reserverd1" type="int"/>
-        <param name="reserverd2" type="string"/>
-      </req>
-      <res>
-        <param name="result" type="int"/>
-        <param name="message" type="string"/>
-      </res>
-    </twoway>
-    <!--测试媒体设备-->
-    <twoway name="TestAvailableMedieDev" overlap="true">
-      <req>
-        <!--1:外部扬声器;2:话筒扬声器:3:外部麦克风;4:话筒麦克风-->
-        <param name="type" type="uint"/>
-        <param name="name" type="string"/>
-        <param name="reserverd1" type="int"/>
-        <param name="reserverd2" type="int"/>
-        <param name="reserverd3" type="string"/>
-      </req>
-      <res>
-        <param name="result" type="int"/>
-        <param name="message" type="string"/>
-      </res>
-    </twoway>
-	</class>
-	
-	<!-- 摄像头启动状态变化消息 -->
-	<message name="CameraStateChanged">
-		<!-- 状态代码 -->
-		<param name="StateCode" type="uint"/>
-		<!-- 状态消息 -->
-		<param name="StateMsg" type="string"/>
-		<!-- 摄像头名称 -->
-		<param name="CameraName" type="string"/>
-	</message>
-	<!-- 摄像头插入消息 -->
-	<message name="CameraInserted">
-		<!-- 摄像头名称 -->
-		<param name="CameraName" type="string"/>
-	</message>
-	<!-- 摄像头移除消息 -->
-	<message name="CameraRemoved">
-		<!-- 摄像头名称 -->
-		<param name="CameraName" type="string"/>
-	</message>
-
-</entity>

+ 0 - 403
Module/mod_CameraConfigManage/CameraConfigManage_client_g.h

@@ -1,403 +0,0 @@
-
-#ifndef __CAMERACONFIGMANAGE_CLIENT_G_H
-#define __CAMERACONFIGMANAGE_CLIENT_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "CameraConfigManage_def_g.h"
-
-namespace CameraConfigManage {
-class CameraConfigManageService_ClientBase : public CClientSessionBase {
-public:
-	explicit CameraConfigManageService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
-
-	CameraConfigManageService_ClientBase* operator () (const linkContext &curLink) 
-	{
-		m_context = curLink;
-		return this;
-	}
-
-protected:
-	virtual ~CameraConfigManageService_ClientBase()
-	{
-		/// override by user
-	}
-public:
-
-	void OnConnectSucceed()
-	{
-		bSessionClosed = false;
-	}
-	void OnClose(ErrorCodeEnum)
-	{
-		Dbg("session closed.");
-		bSessionClosed = true;
-	}
-	bool QuerySessionClosed()
-	{
-		return bSessionClosed;
-	}
-	ErrorCodeEnum Connect(CSmartPointer<IAsynWaitSp> &spAsyncWait)
-	{
-		CSmartPointer<IEntityFunction> pFunc = m_pEntityBase->GetFunction();
-		ErrorCodeEnum Error = pFunc->ConnectRemoteEntity(this, "CameraConfigManage", "CameraConfigManageService", spAsyncWait);
-		if (Error == Error_Succeed) {
-			m_bSysManaged = true;
-			bSessionClosed = false;
-		}
-		return Error;
-	}
-	ErrorCodeEnum Connect()
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = Connect(spAsyncWait);
-		if (Error == Error_Succeed) {
-			Error = spAsyncWait->WaitAnswer();
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum BeginCameraConfigManage()
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		return pFunc->OnewayCall(CameraConfigManageService_Method_BeginCameraConfigManage, CameraConfigManageService_MethodSignature_BeginCameraConfigManage, m_context);
-	}
-
-	ErrorCodeEnum EndCameraConfigManage()
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		return pFunc->OnewayCall(CameraConfigManageService_Method_EndCameraConfigManage, CameraConfigManageService_MethodSignature_EndCameraConfigManage, m_context);
-	}
-
-	ErrorCodeEnum GetCameraList(CameraConfigManageService_GetCameraList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_GetCameraList, CameraConfigManageService_MethodSignature_GetCameraList, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetCameraList(CameraConfigManageService_GetCameraList_Req &Req, CameraConfigManageService_GetCameraList_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetCameraList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetCameraList(CameraConfigManageService_GetCameraList_Req &Req, CameraConfigManageService_GetCameraList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetCameraList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum EchoSomeCamera(CameraConfigManageService_EchoSomeCamera_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_EchoSomeCamera, CameraConfigManageService_MethodSignature_EchoSomeCamera, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum EchoSomeCamera(CameraConfigManageService_EchoSomeCamera_Req &Req, CameraConfigManageService_EchoSomeCamera_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = EchoSomeCamera(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum EchoSomeCamera(CameraConfigManageService_EchoSomeCamera_Req &Req, CameraConfigManageService_EchoSomeCamera_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = EchoSomeCamera(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum SaveCameraConfig(CameraConfigManageService_SaveCameraConfig_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_SaveCameraConfig, CameraConfigManageService_MethodSignature_SaveCameraConfig, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum SaveCameraConfig(CameraConfigManageService_SaveCameraConfig_Req &Req, CameraConfigManageService_SaveCameraConfig_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = SaveCameraConfig(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum SaveCameraConfig(CameraConfigManageService_SaveCameraConfig_Req &Req, CameraConfigManageService_SaveCameraConfig_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = SaveCameraConfig(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum StopEchoSomeCamera(CameraConfigManageService_StopEchoSomeCamera_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_StopEchoSomeCamera, CameraConfigManageService_MethodSignature_StopEchoSomeCamera, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum StopEchoSomeCamera(CameraConfigManageService_StopEchoSomeCamera_Req &Req, CameraConfigManageService_StopEchoSomeCamera_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = StopEchoSomeCamera(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum StopEchoSomeCamera(CameraConfigManageService_StopEchoSomeCamera_Req &Req, CameraConfigManageService_StopEchoSomeCamera_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = StopEchoSomeCamera(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QueryCallState(CameraConfigManageService_QueryCallState_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_QueryCallState, CameraConfigManageService_MethodSignature_QueryCallState, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryCallState(CameraConfigManageService_QueryCallState_Req &Req, CameraConfigManageService_QueryCallState_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryCallState(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryCallState(CameraConfigManageService_QueryCallState_Req &Req, CameraConfigManageService_QueryCallState_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryCallState(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum QueryUIState(CameraConfigManageService_QueryUIState_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_QueryUIState, CameraConfigManageService_MethodSignature_QueryUIState, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryUIState(CameraConfigManageService_QueryUIState_Req &Req, CameraConfigManageService_QueryUIState_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryUIState(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryUIState(CameraConfigManageService_QueryUIState_Req &Req, CameraConfigManageService_QueryUIState_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryUIState(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum AutoCorrectCameraConfig(CameraConfigManageService_AutoCorrectCameraConfig_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_AutoCorrectCameraConfig, CameraConfigManageService_MethodSignature_AutoCorrectCameraConfig, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum AutoCorrectCameraConfig(CameraConfigManageService_AutoCorrectCameraConfig_Req &Req, CameraConfigManageService_AutoCorrectCameraConfig_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = AutoCorrectCameraConfig(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum AutoCorrectCameraConfig(CameraConfigManageService_AutoCorrectCameraConfig_Req &Req, CameraConfigManageService_AutoCorrectCameraConfig_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = AutoCorrectCameraConfig(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum GetMediaAvailableList(CameraConfigManageService_GetMediaAvailableList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_GetMediaAvailableList, CameraConfigManageService_MethodSignature_GetMediaAvailableList, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetMediaAvailableList(CameraConfigManageService_GetMediaAvailableList_Req &Req, CameraConfigManageService_GetMediaAvailableList_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetMediaAvailableList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetMediaAvailableList(CameraConfigManageService_GetMediaAvailableList_Req &Req, CameraConfigManageService_GetMediaAvailableList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetMediaAvailableList(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum SetMediaDevice(CameraConfigManageService_SetMediaDevice_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_SetMediaDevice, CameraConfigManageService_MethodSignature_SetMediaDevice, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum SetMediaDevice(CameraConfigManageService_SetMediaDevice_Req &Req, CameraConfigManageService_SetMediaDevice_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = SetMediaDevice(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum SetMediaDevice(CameraConfigManageService_SetMediaDevice_Req &Req, CameraConfigManageService_SetMediaDevice_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = SetMediaDevice(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum TestAvailableMedieDev(CameraConfigManageService_TestAvailableMedieDev_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		auto ret = pFunc->AsyncRequest(CameraConfigManageService_Method_TestAvailableMedieDev, CameraConfigManageService_MethodSignature_TestAvailableMedieDev, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum TestAvailableMedieDev(CameraConfigManageService_TestAvailableMedieDev_Req &Req, CameraConfigManageService_TestAvailableMedieDev_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestAvailableMedieDev(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum TestAvailableMedieDev(CameraConfigManageService_TestAvailableMedieDev_Req &Req, CameraConfigManageService_TestAvailableMedieDev_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = TestAvailableMedieDev(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-
-	bool SafeDelete()
-	{
-		if (!m_bSysManaged) {
-			delete this;
-		}
-		return m_bSysManaged;
-	}
-
-protected:
-	bool m_bSysManaged;
-	CEntityBase *m_pEntityBase;
-	linkContext m_context;
-	bool bSessionClosed;
-};
-
-///////////////////////////
-
-} // namespace CameraConfigManage
-#endif // __CAMERACONFIGMANAGE_CLIENT_G_H

+ 0 - 310
Module/mod_CameraConfigManage/CameraConfigManage_def_g.h

@@ -1,310 +0,0 @@
-#ifndef __CAMERACONFIGMANAGE_DEF_G_H
-#define __CAMERACONFIGMANAGE_DEF_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "SpHelper.h"
-
-namespace CameraConfigManage {
-//
-// const goes here
-//
-#define MediaDev_OutSpeaker 1
-#define MediaDev_InSpeaker 2
-#define MediaDev_OutMicrophone 3
-#define MediaDev_InMicrophone 4
-
-#define CameraConfigManageService_Method_BeginCameraConfigManage 0
-#define CameraConfigManageService_Method_EndCameraConfigManage 1
-#define CameraConfigManageService_Method_GetCameraList 2
-#define CameraConfigManageService_Method_EchoSomeCamera 3
-#define CameraConfigManageService_Method_SaveCameraConfig 4
-#define CameraConfigManageService_Method_StopEchoSomeCamera 5
-#define CameraConfigManageService_Method_QueryCallState 6
-#define CameraConfigManageService_Method_QueryUIState 7
-#define CameraConfigManageService_Method_AutoCorrectCameraConfig 8
-#define CameraConfigManageService_Method_GetMediaAvailableList 9
-#define CameraConfigManageService_Method_SetMediaDevice 10
-#define CameraConfigManageService_Method_TestAvailableMedieDev 11
-
-#define CameraConfigManageService_MethodSignature_BeginCameraConfigManage 812873940
-#define CameraConfigManageService_MethodSignature_EndCameraConfigManage -1653101178
-#define CameraConfigManageService_MethodSignature_GetCameraList -43192618
-#define CameraConfigManageService_MethodSignature_EchoSomeCamera -586614596
-#define CameraConfigManageService_MethodSignature_SaveCameraConfig -977966900
-#define CameraConfigManageService_MethodSignature_StopEchoSomeCamera 1458170401
-#define CameraConfigManageService_MethodSignature_QueryCallState -1896503904
-#define CameraConfigManageService_MethodSignature_QueryUIState -1499631588
-#define CameraConfigManageService_MethodSignature_AutoCorrectCameraConfig 580882776
-#define CameraConfigManageService_MethodSignature_GetMediaAvailableList -1547834445
-#define CameraConfigManageService_MethodSignature_SetMediaDevice -865058557
-#define CameraConfigManageService_MethodSignature_TestAvailableMedieDev -2126935432
-
-struct CameraConfigManageService_BeginCameraConfigManage_Info
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_EndCameraConfigManage_Info
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_GetCameraList_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_GetCameraList_Ans
-{
-	CAutoArray<CSimpleStringA> AvailableList;
-	CSimpleStringA EnvCamera;
-	CSimpleStringA OptCamera;
-	CSimpleStringA EwsCamera;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & AvailableList & EnvCamera & OptCamera & EwsCamera;
-	}
-
-};
-
-struct CameraConfigManageService_EchoSomeCamera_Req
-{
-	CSimpleStringA CameraName;
-	CSimpleStringA WndParams;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CameraName & WndParams;
-	}
-
-};
-
-struct CameraConfigManageService_EchoSomeCamera_Ans
-{
-	unsigned int Error_Code;
-	CSimpleStringA Error_Msg;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & Error_Code & Error_Msg;
-	}
-
-};
-
-struct CameraConfigManageService_SaveCameraConfig_Req
-{
-	CSimpleStringA EnvCamera;
-	CSimpleStringA OptCamera;
-	CSimpleStringA EwsCamera;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & EnvCamera & OptCamera & EwsCamera;
-	}
-
-};
-
-struct CameraConfigManageService_SaveCameraConfig_Ans
-{
-	unsigned int Error_Code;
-	CSimpleStringA Error_Msg;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & Error_Code & Error_Msg;
-	}
-
-};
-
-struct CameraConfigManageService_StopEchoSomeCamera_Req
-{
-	CSimpleStringA CameraName;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CameraName;
-	}
-
-};
-
-struct CameraConfigManageService_StopEchoSomeCamera_Ans
-{
-	unsigned int Error_Code;
-	CSimpleStringA Error_Msg;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & Error_Code & Error_Msg;
-	}
-
-};
-
-struct CameraConfigManageService_QueryCallState_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_QueryCallState_Ans
-{
-	CSimpleStringA CallState;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CallState;
-	}
-
-};
-
-struct CameraConfigManageService_QueryUIState_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_QueryUIState_Ans
-{
-	CSimpleStringA UIState;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & UIState;
-	}
-
-};
-
-struct CameraConfigManageService_AutoCorrectCameraConfig_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct CameraConfigManageService_AutoCorrectCameraConfig_Ans
-{
-	CSimpleStringA EnvCamera;
-	CSimpleStringA OptCamera;
-	CSimpleStringA EwsCamera;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & EnvCamera & OptCamera & EwsCamera;
-	}
-
-};
-
-struct CameraConfigManageService_GetMediaAvailableList_Req
-{
-	unsigned int type;
-	unsigned int interest;
-	int reserverd1;
-	CSimpleStringA reserverd2;
-	CSimpleStringA reserverd3;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & interest & reserverd1 & reserverd2 & reserverd3;
-	}
-
-};
-
-struct CameraConfigManageService_GetMediaAvailableList_Ans
-{
-	int result;
-	CSimpleStringA message;
-	CAutoArray<CSimpleStringA> AvailableList;
-	CAutoArray<int> ListItemType;
-	CAutoArray<int> ListItemStatus;
-	int reserverd1;
-	CSimpleStringA reserverd2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & message & AvailableList & ListItemType & ListItemStatus & reserverd1 & reserverd2;
-	}
-
-};
-
-struct CameraConfigManageService_SetMediaDevice_Req
-{
-	unsigned int type;
-	CSimpleStringA name;
-	int reserverd1;
-	CSimpleStringA reserverd2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & name & reserverd1 & reserverd2;
-	}
-
-};
-
-struct CameraConfigManageService_SetMediaDevice_Ans
-{
-	int result;
-	CSimpleStringA message;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & message;
-	}
-
-};
-
-struct CameraConfigManageService_TestAvailableMedieDev_Req
-{
-	unsigned int type;
-	CSimpleStringA name;
-	int reserverd1;
-	int reserverd2;
-	CSimpleStringA reserverd3;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & type & name & reserverd1 & reserverd2 & reserverd3;
-	}
-
-};
-
-struct CameraConfigManageService_TestAvailableMedieDev_Ans
-{
-	int result;
-	CSimpleStringA message;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result & message;
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace CameraConfigManage
-
-#endif // __CAMERACONFIGMANAGE_DEF_G_H

+ 0 - 62
Module/mod_CameraConfigManage/CameraConfigManage_msg_g.h

@@ -1,62 +0,0 @@
-
-#ifndef __CAMERACONFIGMANAGE_MSG_G_H
-#define __CAMERACONFIGMANAGE_MSG_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "SpHelper.h"
-
-namespace CameraConfigManage {
-#define eMsg_CameraStateChanged 0
-#define eMsg_CameraInserted 1
-#define eMsg_CameraRemoved 2
-
-#define eMsgSig_CameraStateChanged 326095283
-#define eMsgSig_CameraInserted 436494558
-#define eMsgSig_CameraRemoved 688373157
-
-struct CameraStateChanged
-{
-	unsigned int StateCode;
-	CSimpleStringA StateMsg;
-	CSimpleStringA CameraName;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & StateCode & StateMsg & CameraName;
-	}
-
-};
-
-///////////////////////////
-
-struct CameraInserted
-{
-	CSimpleStringA CameraName;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CameraName;
-	}
-
-};
-
-///////////////////////////
-
-struct CameraRemoved
-{
-	CSimpleStringA CameraName;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & CameraName;
-	}
-
-};
-
-///////////////////////////
-
-} // namespace CameraConfigManage
-#endif // __CAMERACONFIGMANAGE_MSG_G_H

+ 0 - 395
Module/mod_CameraConfigManage/CameraConfigManage_server_g.h

@@ -1,395 +0,0 @@
-
-#ifndef __CAMERACONFIGMANAGE_SERVER_G_H
-#define __CAMERACONFIGMANAGE_SERVER_G_H
-
-#pragma once
-
-// This code is generated by spgen tool!
-
-#include "CameraConfigManage_def_g.h"
-
-namespace CameraConfigManage {
-class CameraConfigManageService_ServerSessionBase : public CServerSessionBase
-{
-public:
-	CameraConfigManageService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual ~CameraConfigManageService_ServerSessionBase()
-	{
-		/// override by user
-	}
-
-	virtual bool IsExclusive() { return false; }
-
-	virtual bool IsSessionOverlap() { return true; }
-
-	virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case CameraConfigManageService_Method_BeginCameraConfigManage:
-			if (dwSignature == CameraConfigManageService_MethodSignature_BeginCameraConfigManage) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_EndCameraConfigManage:
-			if (dwSignature == CameraConfigManageService_MethodSignature_EndCameraConfigManage) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_GetCameraList:
-			if (dwSignature == CameraConfigManageService_MethodSignature_GetCameraList) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_EchoSomeCamera:
-			if (dwSignature == CameraConfigManageService_MethodSignature_EchoSomeCamera) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_SaveCameraConfig:
-			if (dwSignature == CameraConfigManageService_MethodSignature_SaveCameraConfig) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_StopEchoSomeCamera:
-			if (dwSignature == CameraConfigManageService_MethodSignature_StopEchoSomeCamera) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_QueryCallState:
-			if (dwSignature == CameraConfigManageService_MethodSignature_QueryCallState) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_QueryUIState:
-			if (dwSignature == CameraConfigManageService_MethodSignature_QueryUIState) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_AutoCorrectCameraConfig:
-			if (dwSignature == CameraConfigManageService_MethodSignature_AutoCorrectCameraConfig) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_GetMediaAvailableList:
-			if (dwSignature == CameraConfigManageService_MethodSignature_GetMediaAvailableList) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_SetMediaDevice:
-			if (dwSignature == CameraConfigManageService_MethodSignature_SetMediaDevice) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_TestAvailableMedieDev:
-			if (dwSignature == CameraConfigManageService_MethodSignature_TestAvailableMedieDev) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-		switch (dwMessageID) {
-		case CameraConfigManageService_Method_BeginCameraConfigManage:
-			if (dwSignature != CameraConfigManageService_MethodSignature_BeginCameraConfigManage) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_EndCameraConfigManage:
-			if (dwSignature != CameraConfigManageService_MethodSignature_EndCameraConfigManage) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_GetCameraList:
-			if (dwSignature != CameraConfigManageService_MethodSignature_GetCameraList) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_EchoSomeCamera:
-			if (dwSignature != CameraConfigManageService_MethodSignature_EchoSomeCamera) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_SaveCameraConfig:
-			if (dwSignature != CameraConfigManageService_MethodSignature_SaveCameraConfig) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_StopEchoSomeCamera:
-			if (dwSignature != CameraConfigManageService_MethodSignature_StopEchoSomeCamera) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_QueryCallState:
-			if (dwSignature != CameraConfigManageService_MethodSignature_QueryCallState) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_QueryUIState:
-			if (dwSignature != CameraConfigManageService_MethodSignature_QueryUIState) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_AutoCorrectCameraConfig:
-			if (dwSignature != CameraConfigManageService_MethodSignature_AutoCorrectCameraConfig) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_GetMediaAvailableList:
-			if (dwSignature != CameraConfigManageService_MethodSignature_GetMediaAvailableList) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_SetMediaDevice:
-			if (dwSignature != CameraConfigManageService_MethodSignature_SetMediaDevice) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case CameraConfigManageService_Method_TestAvailableMedieDev:
-			if (dwSignature != CameraConfigManageService_MethodSignature_TestAvailableMedieDev) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		default:
-			Error = Error_MethodNotFound;
-			break;
-		}
-		return Error;
-	}
-
-	virtual void Handle_BeginCameraConfigManage(SpOnewayCallContext<CameraConfigManageService_BeginCameraConfigManage_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_EndCameraConfigManage(SpOnewayCallContext<CameraConfigManageService_EndCameraConfigManage_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetCameraList(SpReqAnsContext<CameraConfigManageService_GetCameraList_Req, CameraConfigManageService_GetCameraList_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_EchoSomeCamera(SpReqAnsContext<CameraConfigManageService_EchoSomeCamera_Req, CameraConfigManageService_EchoSomeCamera_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_SaveCameraConfig(SpReqAnsContext<CameraConfigManageService_SaveCameraConfig_Req, CameraConfigManageService_SaveCameraConfig_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_StopEchoSomeCamera(SpReqAnsContext<CameraConfigManageService_StopEchoSomeCamera_Req, CameraConfigManageService_StopEchoSomeCamera_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QueryCallState(SpReqAnsContext<CameraConfigManageService_QueryCallState_Req, CameraConfigManageService_QueryCallState_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QueryUIState(SpReqAnsContext<CameraConfigManageService_QueryUIState_Req, CameraConfigManageService_QueryUIState_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_AutoCorrectCameraConfig(SpReqAnsContext<CameraConfigManageService_AutoCorrectCameraConfig_Req, CameraConfigManageService_AutoCorrectCameraConfig_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetMediaAvailableList(SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req, CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_SetMediaDevice(SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req, CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_TestAvailableMedieDev(SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req, CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
-	{
-		CAutoBuffer Buf;
-		DWORD dwMessageID;
-		DWORD dwMessageSignature;
-		ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf);
-		if (Error == Error_Succeed) {
-#ifdef DEBUG
-			assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed);
-#else
-			if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) {
-				pTransactionContext->SendAnswer(Error_MethodSignatureFailed);
-				return;
-			}
-#endif
-			switch (dwMessageID) {
-				case CameraConfigManageService_Method_BeginCameraConfigManage:
-					{
-						SpOnewayCallContext<CameraConfigManageService_BeginCameraConfigManage_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<CameraConfigManageService_BeginCameraConfigManage_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_BeginCameraConfigManage(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_EndCameraConfigManage:
-					{
-						SpOnewayCallContext<CameraConfigManageService_EndCameraConfigManage_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<CameraConfigManageService_EndCameraConfigManage_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_EndCameraConfigManage(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_GetCameraList:
-					{
-						SpReqAnsContext<CameraConfigManageService_GetCameraList_Req,CameraConfigManageService_GetCameraList_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_GetCameraList_Req,CameraConfigManageService_GetCameraList_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_GetCameraList(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_EchoSomeCamera:
-					{
-						SpReqAnsContext<CameraConfigManageService_EchoSomeCamera_Req,CameraConfigManageService_EchoSomeCamera_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_EchoSomeCamera_Req,CameraConfigManageService_EchoSomeCamera_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_EchoSomeCamera(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_SaveCameraConfig:
-					{
-						SpReqAnsContext<CameraConfigManageService_SaveCameraConfig_Req,CameraConfigManageService_SaveCameraConfig_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_SaveCameraConfig_Req,CameraConfigManageService_SaveCameraConfig_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_SaveCameraConfig(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_StopEchoSomeCamera:
-					{
-						SpReqAnsContext<CameraConfigManageService_StopEchoSomeCamera_Req,CameraConfigManageService_StopEchoSomeCamera_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_StopEchoSomeCamera_Req,CameraConfigManageService_StopEchoSomeCamera_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_StopEchoSomeCamera(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_QueryCallState:
-					{
-						SpReqAnsContext<CameraConfigManageService_QueryCallState_Req,CameraConfigManageService_QueryCallState_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_QueryCallState_Req,CameraConfigManageService_QueryCallState_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_QueryCallState(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_QueryUIState:
-					{
-						SpReqAnsContext<CameraConfigManageService_QueryUIState_Req,CameraConfigManageService_QueryUIState_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_QueryUIState_Req,CameraConfigManageService_QueryUIState_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_QueryUIState(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_AutoCorrectCameraConfig:
-					{
-						SpReqAnsContext<CameraConfigManageService_AutoCorrectCameraConfig_Req,CameraConfigManageService_AutoCorrectCameraConfig_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_AutoCorrectCameraConfig_Req,CameraConfigManageService_AutoCorrectCameraConfig_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_AutoCorrectCameraConfig(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_GetMediaAvailableList:
-					{
-						SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req,CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req,CameraConfigManageService_GetMediaAvailableList_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_GetMediaAvailableList(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_SetMediaDevice:
-					{
-						SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req,CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req,CameraConfigManageService_SetMediaDevice_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_SetMediaDevice(ctx);
-					}
-					break;
-				case CameraConfigManageService_Method_TestAvailableMedieDev:
-					{
-						SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req,CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req,CameraConfigManageService_TestAvailableMedieDev_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						Handle_TestAvailableMedieDev(ctx);
-					}
-					break;
-				default:
-					assert(0);
-					break;
-			}
-			
-		} else {
-			pTransactionContext->SendAnswer(Error);
-		}
-	}
-
-};
-
-
-///////////////////////////
-
-} // namespace CameraConfigManage
-#endif // __CAMERACONFIGMANAGE_SERVER_G_H

+ 0 - 19
Module/mod_CameraConfigManage/Event.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#define SYSVAR_ACTIVETRACKINGCAMERA	"ActiveTrackingCamera"
-#define ACTIVETRACKINGCAMERA_ENV "E" // env
-#define ACTIVETRACKINGCAMERA_OPT "O" // opt
-
-#define SYSVAR_CAMERASTATE	"CameraState"
-
-#define LOG_EVT_BEGIN_CAMERA_CONFIG    0x21D00001
-#define LOG_EVT_END_CAMERA_CONFIG      0x21D00002
-
-#define EVENT_USB_CAMER_INPUT		0x21000019 //摄像头插入
-#define EVENT_USB_CAMER_OUTPUT		0x2100001A //摄像头拔出
-#define EVENT_USB_CAMERA_NOT_ONLY	0x2100001B //多于一个外接摄像头
-
-#define LOG_EVT_STARTACTIVECAPTURE			0x31400001				//开始主动活体
-#define LOG_EVT_STOPACTIVECAPTURE			0x31400002				//停止主动活体
-#define LOG_EVT_ECHOACTIVECAPTURECAM		0x31400004				//通知主动活体回显摄像头号
-#define LOG_EVT_ECHOACTIVECAPTUREIMG		0x31400005				//通知主动活体回显图片

+ 0 - 1624
Module/mod_CameraConfigManage/mod_CameraConfigManage.cpp

@@ -1,1624 +0,0 @@
-#include "stdafx.h"
-#include "mod_CameraConfigManage.h"
-#include "Event.h"
-#include "rec_common.h"
-#include "SpComm.hpp"
-#include "CommEntityUtil.hpp"
-#if defined(RVC_OS_WIN)
-#include <tchar.h>
-#include "SetupApi.h"
-#pragma comment(lib, "SetupAPI.lib")
-#endif //RVC_OS_WIN
-
-#include <algorithm>
-
-#include "ScannerSet_client_g.h"
-#include "ScannerSet_def_g.h"
-
-#include "fileutil.h"
-#include "iniutil.h"
-
-using namespace ScannerSet;
-
-using namespace CameraConfigManage;
-
-#if defined(RVC_OS_WIN)
-using namespace LibVideoEcho;
-
-static BOOL IsWow64()
-{
-    BOOL bIsWow64 = FALSE;
-
-    //IsWow64Process is not available on all supported versions of Windows.
-    //Use GetModuleHandle to get a handle to the DLL that contains the function
-    //and GetProcAddress to get a pointer to the function if available.
-
-    typedef BOOL(WINAPI* LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
-
-    LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(
-        GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
-
-    if (NULL != fnIsWow64Process) {
-        if (!fnIsWow64Process(GetCurrentProcess(), &bIsWow64)) {
-            //handle error
-        }
-    }
-    return bIsWow64;
-}
-
-
-static GUID* StrToGUID(const WCHAR* guid_string)
-{
-    char buffer[64];
-    GUID* guid = (GUID*)buffer;
-    WCHAR	upperGuid[40 + 1] = { 0 };
-    for (int i = 0; i < 40 + 1; i++) {
-        upperGuid[i] = guid_string[i];
-        if (upperGuid[i] >= L'a' && upperGuid[i] <= L'z') {
-            upperGuid[i] += L'A' - L'a';
-        }
-    }
-
-    swscanf_s(upperGuid, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
-              &guid->Data1,
-              &guid->Data2,
-              &guid->Data3,
-              &guid->Data4[0],
-              &guid->Data4[1],
-              &guid->Data4[2],
-              &guid->Data4[3],
-              &guid->Data4[4],
-              &guid->Data4[5],
-              &guid->Data4[6],
-              &guid->Data4[7]);
-
-    return guid;
-}
-
-#endif //RVC_OS_WIN
-
-
-
-void CCameraConfigManageEntity::OnPreStart( 
-	CAutoArray<CSimpleStringA> strArgs,
-	CSmartPointer<ITransactionContext> pTransactionContext )
-{
-	LOG_FUNCTION();
-    ErrorCodeEnum Error;
-
-	m_eDeviceType = eStand2sType;
-	g_eDeviceType = eStand2sType;
-
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-	CSystemStaticInfo stStaticinfo;
-	spFunction->GetSystemStaticInfo(stStaticinfo);
-	SP::Module::Comm::Site site = SP::Module::Comm::Str2Site(stStaticinfo.strSite);
-	SP::Module::Comm::What type = SP::Module::Comm::Str2Type(stStaticinfo.strSite);
-
-
-	if (type == SP::Module::Comm::RVC_PAD)
-	{
-		if (site == SP::Module::Comm::CMB_FLB)
-		{
-			LOG_TRACE("the type is mobile pad");
-			m_eDeviceType = eMobilePadType;
-		}
-		else
-		{
-			LOG_TRACE("the type is pad");
-			m_eDeviceType = ePadtype;
-		}
-	}
-	else if (type == SP::Module::Comm::RVC_Desk2S)
-	{
-		LOG_TRACE("the type is Desk2S");
-		m_eDeviceType = eDesk2SType;
-	}
-	else
-	{
-		LOG_TRACE("the type is standard");
-		m_eDeviceType = eStand2sType;
-	}
-	g_eDeviceType = m_eDeviceType;
-
-#if defined(RVC_OS_WIN)
-    memset(&m_conf, 0, sizeof(capture_config_t));
-    Error = (ErrorCodeEnum)capture_lib_init();
-
-    if (Error == Error_Succeed) {
-        LoadConfig(&m_conf);
-    } else {
-        LOG_TRACE("capture_lib_init failed!");
-    }
-#endif //RVC_OS_WIN
-
-    int i = 0;
-    m_arrListener.Init(2);
-    GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event,
-                                Severity_None, Error_IgnoreAll, EVENT_USB_CAMER_INPUT, NULL, false);
-    GetFunction()->SubscribeLog(m_arrListener[i++], this, Log_Event,
-                                Severity_None, Error_IgnoreAll, EVENT_USB_CAMER_OUTPUT, NULL, false);
-
-    GetFunction()->RegistSysVarEvent(SYSVAR_ACTIVETRACKINGCAMERA, this);
-    GetFunction()->RegistSysVarEvent(SYSVAR_CAMERASTATE, this);
-
-	CSimpleStringA strValue;
-	GetFunction()->GetSysVar(SYSVAR_CAMERASTATE, strValue);
-	m_iCameraState = strValue[0];
-	if (strValue[0] == 'E')
-	{
-		m_nActiveCamera = CAMERA_TYPE_OPT;
-	}
-	else if (strValue[0] == 'O')
-	{
-		m_nActiveCamera = CAMERA_TYPE_ENV;
-	}
-	else if(strValue[0] == 'B')   ///////显示贴图
-	{
-		m_nActiveCamera = CAMERA_TYPE_ERROR;
-	}
-	else if (strValue[0] == 'N')
-	{
-		m_nActiveCamera = CAMERA_TYPE_ENV;
-	}
-
-	m_camerasConfig.strEnvCamera = "$";
-	m_camerasConfig.envCamera.strFriendlyName = "$";
-	m_camerasConfig.envCamera.strDevPath = "$";
-	m_camerasConfig.envCamera.strMd5Val = "$";
-	m_camerasConfig.strOptCamera = "$";
-	m_camerasConfig.optCamera.strFriendlyName = "$";
-	m_camerasConfig.optCamera.strDevPath = "$";
-	m_camerasConfig.optCamera.strMd5Val = "$";
-	m_camerasConfig.strEwsCamera = "$";
-	m_camerasConfig.ewsCamera.strFriendlyName = "$";
-	m_camerasConfig.ewsCamera.strDevPath = "$";
-	m_camerasConfig.ewsCamera.strMd5Val = "$";
-
-	LoadConfig(&m_originConfig);
-	m_camerasConfig.strEnvCamera = m_originConfig.strEnvCamera;
-	m_camerasConfig.strOptCamera = m_originConfig.strOptCamera;
-	m_camerasConfig.strEwsCamera = m_originConfig.strEwsCamera;
-
-	SyncVideoConfig();
-
-	pTransactionContext->SendAnswer(Error_Succeed);
-}
-
-void CCameraConfigManageEntity::OnStarted()
-{
-	LOG_FUNCTION();
-    if (0 == mlibAudioMgr->audio_mgr_initialize()) {
-        Dbg("Audio Manager Initialize success!");
-    } else {
-        Dbg("Audio Manager Initialize failed!");
-    }
-	RefreshCameras();
-}
-
-void CCameraConfigManageEntity::OnPreClose( 
-	EntityCloseCauseEnum eCloseCause,
-	CSmartPointer<ITransactionContext> pTransactionContext )
-{
-	LOG_FUNCTION();
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-
-	for (int i = 0; i < m_arrListener.GetCount(); ++i)
-	{
-		spFunction->UnsubscribeLog(m_arrListener[i]);
-	}
-
-	spFunction->UnregistSysVarEvent(SYSVAR_ACTIVETRACKINGCAMERA);
-	spFunction->UnregistSysVarEvent(SYSVAR_CAMERASTATE);
-}
-
-void CCameraConfigManageEntity::OnSysVarEvent( 
-	const char *pszKey, 
-	const char *pszValue,
-	const char *pszOldValue,
-	const char *pszEntityName )
-{
-	if (_stricmp(pszKey, SYSVAR_CAMERASTATE) == 0)
-	{
-		Dbg("camera state from : %c to %c", pszOldValue[0], pszValue[0]);
-		m_iCameraState = pszValue[0]; 
-		if (pszValue[0] == 'E')
-		{
-			m_nActiveCamera = CAMERA_TYPE_OPT;
-		}
-		else if (pszValue[0] == 'O')
-		{
-			m_nActiveCamera = CAMERA_TYPE_ENV;
-		}
-		else if(pszValue[0] == 'B')   ///////显示贴图
-		{
-			m_nActiveCamera = CAMERA_TYPE_ERROR;
-		}
-		else if (pszValue[0] == 'N')
-		{
-			m_nActiveCamera = CAMERA_TYPE_AUTO;
-		}
-	}
-	else if (_stricmp(pszKey, SYSVAR_ACTIVETRACKINGCAMERA) == 0)
-	{
-		if (m_iCameraState == 'N')
-		{
-			if (pszValue[0] == 'E')
-			{
-				m_nActiveCamera = CAMERA_TYPE_ENV;
-			}
-			else if (pszValue[0] == 'O')
-			{
-				m_nActiveCamera = CAMERA_TYPE_OPT;
-			}
-		}
-	}
-}
-
-void CCameraConfigManageEntity::OnLog( 
-	const CAutoArray<CUUID> &SubIDs, 
-	const CUUID nLogID,
-	const LogTypeEnum eLogType, 
-	const SeverityLevelEnum eLevel, 
-	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)
-{
-	LOG_TRACE("user_code = %08x", dwUserCode);
-	if (dwUserCode == EVENT_USB_CAMER_INPUT)
-	{
-#if defined(RVC_OS_WIN)
-        ::Sleep(2000);
-        camera_names_t usbCam;
-        int id = capture_get_video_device_id(pszMessage, usbCam);
-        if (id != -1) {
-            Dbg("[dbg] %s inserted!", usbCam.strFriendlyName.GetData());
-            CameraInserted evt;
-            evt.CameraName = CSimpleStringA::Format("%s;%s",
-                                                    usbCam.strFriendlyName.GetData(), usbCam.strMd5Val.GetData());
-            SpSendBroadcast(GetFunction(), SP_MSG_OF(CameraInserted),
-                            SP_MSG_SIG_OF(CameraInserted), evt);
-            Dbg("[dbg] CameraInserted broadcast sent!");
-            m_cameras.push_back(usbCam);
-        }
-#endif //RVC_OS_WIN
-	}
-	else if (dwUserCode == EVENT_USB_CAMER_OUTPUT)
-	{
-		//::Sleep(1000);
-		std::vector<camera_names_t> cams;
-		GetAvailableCameras(cams);
-		auto i = m_cameras.begin();
-		for (; i != m_cameras.end(); ++i) {
-			auto it = std::find_if(cams.begin(), cams.end(), [i](camera_names_t &c)
-			{
-				return i->strFriendlyName == c.strFriendlyName && 
-					i->strDevPath == c.strDevPath && 
-					i->strMd5Val == c.strMd5Val;
-			});
-			if (it == cams.end())
-				break;
-		}
-		if (i != m_cameras.end()) {
-			Dbg("[dbg] %s removed!", i->strFriendlyName.GetData());
-			CameraRemoved evt;
-			evt.CameraName = CSimpleStringA::Format("%s;%s",
-				i->strFriendlyName.GetData(),i->strMd5Val.GetData());
-			SpSendBroadcast(GetFunction(), SP_MSG_OF(CameraRemoved), 
-				SP_MSG_SIG_OF(CameraRemoved), evt);
-			Dbg("[dbg] CameraRemoved broadcast sent!");
-			m_cameras.erase(i);
-		}
-	}
-}
-
-void CCameraConfigManageEntity::OnTimeout( DWORD dwTimerID )
-{
-
-}
-
-void CCameraConfigManageEntity::Debug( const char *fmt, ... )
-{
-	va_list arg;
-	va_start(arg, fmt);
-	vDbg(fmt, arg);
-	va_end(arg);
-}
-
-int CCameraConfigManageEntity::GetActiveCamera()
-{
-	return m_nActiveCamera;
-}
-
-HINSTANCE CCameraConfigManageEntity::GetEntityHinstance()
-{
-	return ModuleBase::GetModuleBase()->GetInstance();
-}
-
-ErrorCodeEnum CCameraConfigManageEntity::GetHSPCameras( 
-	CAutoArray<CSimpleStringA> &HSPCameras )
-{
-	auto rc = Error_Succeed;
-
-	auto pScannerSetClient = new ScannerService_ClientBase(this);
-
-	if (pScannerSetClient->Connect() != Error_Succeed)
-	{
-		Dbg("连接ScannerSet实体失败");
-		pScannerSetClient->SafeDelete();
-		pScannerSetClient = NULL;
-		rc = Error_DevConnFailed;
-	}
-	else
-	{
-		ScannerService_GetOnlineCameras_Req req = {};
-
-		ScannerService_GetOnlineCameras_Ans ans = {};
-
-		rc = (*pScannerSetClient)(EntityResource::getLink().upgradeLink())->GetOnlineCameras(req, ans, 10000);
-		if (rc != Error_Succeed)
-		{
-			Dbg("ScannerSet 调用 GetOnlineCameras 失败: 0x%x", rc);
-		}
-		else
-		{
-			Dbg("ScannerSet invokes GetOnlineCameras suc.");
-			Dbg("Count: %d", ans.devCount);
-			if (ans.devCount > 0) {
-				for (int i = 0; i < ans.devFriendlyNames.GetCount(); ++i) {
-					Dbg("[%d]%s(%d)", i, (LPCTSTR)ans.devFriendlyNames[i], 
-						ans.devType[i]);
-					CapTypeEnum devType = (CapTypeEnum)ans.devType[i];
-					if (devType == CAMTYPE_HSPS)
-					{
-						HSPCameras.Append(ans.devFriendlyNames, i, 1);
-					}
-				}
-			}
-		}
-
-		pScannerSetClient->GetFunction()->CloseSession();
-		pScannerSetClient = NULL;
-	}
-
-	return rc;
-}
-
-void CCameraConfigManageEntity::GetAvailableCameras(std::vector<camera_names_t> &cams)
-{
-	CAutoArray<CSimpleStringA> hspCams;
-#if defined(RVC_OS_WIN)
-    auto rc = GetHSPCameras(hspCams);
-    Dbg("[GetHSPCameras]: (0x%x,%d)", rc, hspCams.GetCount());
-    capture_enum_cameras(cams, hspCams);
-#else
-    capture_enum_cameras(hspCams);
-	for (int i = 0; i < hspCams.GetCount();++i) {
-		camera_names_t t;
-		t.strDevPath = t.strFriendlyName = hspCams[i];
-		t.strMd5Val = "";
-		Dbg("%d: %s", i, t.strDevPath.GetData());
-		cams.push_back(t);
-	}
-#endif //RVC_OS_WIN
-}
-
-ErrorCodeEnum CCameraConfigManageEntity::LoadConfig( capture_config_t *conf )
-{
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-	CSmartPointer<IConfigInfo> spConfig;
-	SpIniMappingTable table;
-	ErrorCodeEnum Error = spFunction->OpenConfig(Config_Root, spConfig);
-	if (Error == Error_Succeed)
-	{
-#if defined(RVC_OS_WIN)
-        table.AddEntryString("Audio", "handfree_in_dev", conf->strAudioIn, "$");
-        table.AddEntryString("Video", "EnvCamera", conf->strVideo, "$");
-        table.AddEntryInt("Video", "EnvRotate", conf->video_rotate, 0);
-#else
-        table.AddEntryString("Audio", "handfree_in_dev", conf->strAudioIn, "$");
-        table.AddEntryString("Video", "EnvCamera", conf->strVideoEnv, "$");
-        table.AddEntryInt("Video", "EnvRotate", conf->video_env_rotate, 0);
-#endif //RVC_OS_WIN
-		table.Load(spConfig);
-	}
-
-	return Error_Succeed;
-}
-
-ErrorCodeEnum CCameraConfigManageEntity::LoadConfig( VideoConfig *conf )
-{
-	CSmartPointer<IEntityFunction> spFunction = GetFunction();
-	CSmartPointer<IConfigInfo> spConfig;
-	SpIniMappingTable table;
-	ErrorCodeEnum Error = spFunction->OpenConfig(Config_Root, spConfig);
-	if (Error == Error_Succeed)
-	{
-		table.AddEntryString("Video", "EnvCamera", conf->strEnvCamera, "$");
-		table.AddEntryString("Video", "OptCamera", conf->strOptCamera, "$");
-		table.AddEntryString("Video", "EwsCamera", conf->strEwsCamera, "$");
-		table.Load(spConfig);
-	}
-
-	return Error_Succeed;
-}
-
-ErrorCodeEnum CCameraConfigManageEntity::HandleEditConfigReq( 
-	const CAutoArray<CEditConfigReq> &reqs )
-{
-	Dbg("entity edit config");
-
-	auto pFunc = this->GetFunction();
-
-	for (int i = 0; i < reqs.GetCount(); ++i)
-	{
-		auto req = reqs[i];
-		//if (!stricmp(req.Value, "$"))
-		//{
-		//	continue;
-		//}
-
-		CSimpleStringA strEntityName = req.EntityName;
-		CSimpleStringA strCfgPath;
-
-		if (stricmp(strEntityName, "Silverlight") == 0 || stricmp(strEntityName, "DualActive") == 0 || 
-			stricmp(strEntityName, "SpHost") == 0 || stricmp(strEntityName, "SysInit") == 0 || 
-			stricmp(strEntityName, "SpBase") == 0 || stricmp(strEntityName, "guardian") == 0)
-		{
-			Dbg("entity \"%s\" has no config", strEntityName);
-			return Error_NotExist;
-		}
-
-		if (stricmp(strEntityName, "Root") == 0)
-		{
-			auto rc = pFunc->GetPath("HardwareCfg", strCfgPath);
-			assert(rc == Error_Succeed);
-			strCfgPath += SPLIT_SLASH_STR;
-			strCfgPath += "root.ini";
-		}
-		else
-		{
-			auto rc = pFunc->GetPath("Cfg", strCfgPath);
-			assert(rc == Error_Succeed);
-
-			strCfgPath += CSimpleStringA::Format(SPLIT_SLASH_STR "%s.ini", (const char*)strEntityName);
-		}
-
-		char cEditType = req.EditType;
-		Dbg("edit config: entity = %s, type = %c, section = %s, key = %s, value = %s",
-			(const char*)strEntityName, cEditType, req.Section, req.Key, req.Value);
-
-		if (cEditType == 'A' || cEditType == 'U')
-		{
-#if defined(RVC_OS_WIN)
-			WritePrivateProfileStringA(req.Section, req.Key, req.Value, strCfgPath);
-#else
-			inifile_write_str(strCfgPath, req.Section, req.Key, req.Value);
-#endif //RVC_OS_WIN
-		}
-		else if (cEditType == 'D')
-		{
-#if defined(RVC_OS_WIN)
-			WritePrivateProfileStringA(req.Section, req.Key, NULL, strCfgPath);
-#else
-			inifile_write_str(strCfgPath, req.Section, req.Key, NULL);
-#endif //RVC_OS_WIN
-		}
-	}
-
-	return Error_Succeed;
-}
-
-void CCameraConfigManageEntity::SetCameraName( CSimpleStringA camName )
-{
-#if defined(RVC_OS_WIN)
-	m_conf.strVideo = camName;
-#else
-	m_conf.strVideoEnv = camName;
-#endif //RVC_OS_WIN
-}
-
-CSimpleStringA CCameraConfigManageEntity::GetCameraName()
-{
-#if defined(RVC_OS_WIN)
-    return m_conf.strVideo;
-#else
-    return m_conf.strVideoEnv;
-#endif //RVC_OS_WIN
-}
-
-BOOL CCameraConfigManageEntity::IsCameraStart()
-{
-	return m_bStartCamera;
-}
-
-ErrorCodeEnum CCameraConfigManageEntity::StartCamera()
-{
-	if (m_capture == NULL)
-	{
-		ErrorCodeEnum Error = Error_Succeed;
-#if defined(RVC_OS_WIN)
-		m_conf.ref_capture_count = &m_lCaptureCount;
-#else
-        m_conf.ref_env_capture_count = &m_lCaptureCount;
-#endif //RVC_OS_WIN
-		Error = (ErrorCodeEnum)capture_create(&m_conf, &m_capture);
-		if (Error == Error_Succeed)
-		{
-			Error = capture_start(m_capture);
-			Dbg("Error code=0x%x",Error);
-			if (Error != Error_Succeed)
-			{
-				m_bStartCamera = FALSE;
-				if (Error == Error_EnvCamera)
-				{
-					capture_destroy(m_capture);
-					m_capture = NULL;
-					return Error;
-				}
-				else // Error_AudioIN
-				{
-					return Error;
-				}
-			}
-			else
-			{
-				m_bStartCamera = TRUE;
-				return Error_Succeed;
-			}
-		} 
-		else 
-		{
-			m_bStartCamera = FALSE;
-			Dbg("create capture failed! %d", Error);
-			m_capture = NULL;
-			return Error_Unexpect;
-		}
-
-		return Error;
-	}
-	else
-	{
-		Dbg("m_capture == NULL");
-		return Error_Unexpect;
-	}
-}
-
-void CCameraConfigManageEntity::StopCamera()
-{
-	if ((ePadtype==m_eDeviceType||eDesk2SType==m_eDeviceType)&&m_bStartCamera)
-	{
-		Dbg("stop camera");
-		if (m_capture) 
-		{
-			capture_stop(m_capture);
-			capture_destroy(m_capture);
-			m_capture = NULL;
-		}
-		m_bStartCamera = FALSE;
-	}
-}
-
-#if defined(RVC_OS_WIN)
-void CCameraConfigManageEntity::StartEchoVideo(int x, int y, int w, int h)
-{
-    if (!m_bEchoVideo) {
-        videoplay_session_conf_t video_conf;
-        memset(&video_conf, 0, sizeof(video_conf));
-        video_conf.local_video_view_x = x;
-        video_conf.local_video_view_y = y;
-        video_conf.local_video_view_cx = w;
-        video_conf.local_video_view_cy = h;
-        video_conf.pHostApi = this;
-        strcpy(video_conf.local_video_preview_queue0, REC_COMMON_VIDEO_ENV_SHM_PREVIEW_QUEUE);
-        int rc = Local_videoplay_session_create(&video_conf, &m_pSession);
-        if (rc != 0) {
-            Dbg("create videoplay session failed! rc = %d", rc);
-        } else {
-            rc = Local_videoplay_session_start(m_pSession);
-            if (rc != 0) {
-                Dbg("start videoplay session failed! rc = %d", rc);
-                Local_videoplay_session_destroy(m_pSession);
-                m_pSession = NULL;
-            } else {
-                m_bEchoVideo = TRUE;
-                Dbg("start videoplay session succed! rc = %d", rc);
-            }
-        }
-    }
-}
-
-void CCameraConfigManageEntity::StopEchoVideo()
-{
-    if (m_bEchoVideo && m_pSession) {
-        m_bEchoVideo = FALSE;
-        Local_videoplay_session_stop(m_pSession);
-        Local_videoplay_session_destroy(m_pSession);
-        m_pSession = NULL;
-        Dbg("videoplay session stopped!");
-    }
-}
-
-#endif //RVC_OS_WIN
-
-bool CCameraConfigManageEntity::ConvertEwsCameraName( 
-	CSimpleStringA& strRetrievedName, 
-	const CSimpleStringA& strDirectShowName )
-{
-	bool bRet = false;
-
-#if defined(RVC_OS_WIN)
-    if (strDirectShowName.GetLength() <= 1) {
-        return false;
-    }
-
-    CSimpleStringA md5str = strDirectShowName;
-    int pos = md5str.IndexOf(";");
-    if (pos < 0 || pos + 1 >= md5str.GetLength()) {
-        return false;
-    }
-
-    md5str = md5str.SubString(pos + 1, md5str.GetLength() - pos - 1);
-
-    BOOL bFound = FALSE;
-    CSimpleStringA strDevPath;
-    for (int i = 0; i < m_cameras.size(); ++i) {
-        if (m_cameras[i].strMd5Val == md5str) {
-            strDevPath = m_cameras[i].strDevPath;
-            bFound = TRUE;
-            break;
-        }
-    }
-
-    if (!bFound) {
-        Dbg("md5str %s does not be found!", md5str.GetData());
-        return false;
-    }
-
-
-    GUID deviceGuid[2] = {
-        *StrToGUID(L"{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}"),  // Image
-        *StrToGUID(L"{CA3E7AB9-B4C3-4AE6-8251-579EF933890F}")   // Camera
-    };
-
-    Dbg("Current EwsCamera: %s", strDevPath.GetData());
-
-    for (int i = 0; i < 2; ++i) {
-        Dbg("Enumerate %s devices", (0 == i ? "Image" : "Camera"));
-        HDEVINFO hDev = SetupDiGetClassDevs(&deviceGuid[i], NULL, NULL, DIGCF_PRESENT);
-        if (INVALID_HANDLE_VALUE == hDev) {
-            return bRet;
-        }
-        SP_CLASSIMAGELIST_DATA _spImageData = { 0 };
-        _spImageData.cbSize = sizeof(SP_CLASSIMAGELIST_DATA);
-        SetupDiGetClassImageList(&_spImageData);
-
-        SP_DEVINFO_DATA DevInfo;
-        ZeroMemory(&DevInfo, sizeof(SP_DEVINFO_DATA));
-        DevInfo.cbSize = sizeof(SP_DEVINFO_DATA);
-        //if (IsWow64())
-        //	DevInfo.cbSize = 32;
-        //else
-        //	DevInfo.cbSize = 28;
-        DWORD DeviceIndex = 0;
-        while (SetupDiEnumDeviceInfo(hDev, DeviceIndex, &DevInfo)) {
-            int wImageIdx = 0;
-            if (SetupDiGetClassImageIndex(&_spImageData, &DevInfo.ClassGuid, &wImageIdx)) {
-                char szName[MAX_PATH] = { 0 };
-                //获取设备实例路径
-                if (SetupDiGetDeviceInstanceId(hDev, &DevInfo, szName, MAX_PATH - 1, NULL)) {
-                    Dbg("InstanceId: %s", szName);
-                    if (strstr(strDevPath.GetData(), szName)) {
-                        strRetrievedName = szName;
-                        bRet = strRetrievedName.GetLength() > 0;
-                        return bRet;
-                    }
-                } else {
-                    if (SetupDiGetDeviceRegistryProperty(
-                        hDev, &DevInfo, SPDRP_DEVICEDESC, NULL, (PBYTE)szName, MAX_PATH - 1, 0)) {
-                        Dbg("RegistryProperty: %s", szName);
-                        if (strstr(strDevPath.GetData(), szName)) {
-                            strRetrievedName = szName;
-                            bRet = strRetrievedName.GetLength() > 0;
-                            return bRet;
-                        }
-                    }
-                }
-            }
-            DeviceIndex++;
-        }
-        SetupDiDestroyClassImageList(&_spImageData);
-
-        if (hDev) {
-            SetupDiDestroyDeviceInfoList(hDev);
-        }
-    }
-#endif //RVC_OS_WIN
-
-	return bRet;
-}
-
-
-bool getConfigCameraFriendlyName(const CSimpleStringA& strDirectShowName, CSimpleStringA &friendlyName){
-	CSimpleStringA tmp = strDirectShowName;
-	int pos = tmp.IndexOf(";");
-	if (pos < 0 || pos+1 >= tmp.GetLength()) {
-		return false;
-	}
-	friendlyName = tmp.SubString(0, pos);
-	return true;
-}
-
-bool getConfigCameraMd5Str(const CSimpleStringA& strDirectShowName, CSimpleStringA &md5str){
-	CSimpleStringA tmp = strDirectShowName;
-	int pos = tmp.IndexOf(";");
-	if (pos < 0 || pos+1 >= tmp.GetLength()) {
-		return false;
-	}
-	md5str = tmp.SubString(pos+1, tmp.GetLength()-pos-1);
-	return true;
-}	
-
-
-bool CheckConfigCameraCanOpen(const CSimpleStringA strCam) {
-
-	camera_names_t cameraDetail;
-	//check Ews device
-	if (strCam.GetLength() > 1)
-	{   // is not "$"
-#if defined(RVC_OS_WIN)
-		const int camera_id = capture_get_video_device_id((LPCTSTR)strCam, cameraDetail);
-#else
-		const int camera_id = capture_get_video_device_id((LPCTSTR)strCam);
-#endif //RVC_OS_WIN
-		if (camera_id == -1)
-		{
-			Dbg("find strCam:%s(-1)", (LPCTSTR)strCam);
-			return false;
-		}
-	}
-	else
-	{
-		//摄像头未配置,此时也认为摄像头OK
-	}
-	return true;
-}
-
-//保证strEnvCamera与envCamera一致,都有配置信息
-void CCameraConfigManageEntity::SyncVideoConfig()
-{
-#if defined(RVC_OS_WIN)
-    if ((m_camerasConfig.strEnvCamera.GetLength() > 1) && (m_camerasConfig.envCamera.strFriendlyName.GetLength() <= 1)) {
-        if (capture_get_video_device_id(m_camerasConfig.strEnvCamera, m_camerasConfig.envCamera) < 0) {
-            getConfigCameraFriendlyName(m_camerasConfig.strEnvCamera, m_camerasConfig.envCamera.strFriendlyName);
-            getConfigCameraMd5Str(m_camerasConfig.strEnvCamera, m_camerasConfig.envCamera.strMd5Val);
-        }
-        Dbg("SyncVideoConfig, envCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-            (LPCTSTR)m_camerasConfig.envCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.envCamera.strMd5Val,
-            (LPCTSTR)m_camerasConfig.envCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEnvCamera);
-    }
-
-    if ((m_camerasConfig.strOptCamera.GetLength() > 1) && (m_camerasConfig.optCamera.strFriendlyName.GetLength() <= 1)) {
-        if (capture_get_video_device_id(m_camerasConfig.strOptCamera, m_camerasConfig.optCamera) < 0) {
-            getConfigCameraFriendlyName(m_camerasConfig.strOptCamera, m_camerasConfig.optCamera.strFriendlyName);
-            getConfigCameraMd5Str(m_camerasConfig.strOptCamera, m_camerasConfig.optCamera.strMd5Val);
-        }
-        Dbg("SyncVideoConfig, optCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-            (LPCTSTR)m_camerasConfig.optCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.optCamera.strMd5Val,
-            (LPCTSTR)m_camerasConfig.optCamera.strDevPath, (LPCTSTR)m_camerasConfig.strOptCamera);
-    }
-
-    if ((m_camerasConfig.strEwsCamera.GetLength() > 1) && (m_camerasConfig.ewsCamera.strFriendlyName.GetLength() <= 1)) {
-        capture_get_video_device_id(m_camerasConfig.strEwsCamera, m_camerasConfig.ewsCamera);
-        Dbg("SyncVideoConfig, ewsCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-            (LPCTSTR)m_camerasConfig.ewsCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.ewsCamera.strMd5Val,
-            (LPCTSTR)m_camerasConfig.ewsCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEwsCamera);
-    }
-#endif //RVC_OS_WIN
-}
-
-void CCameraConfigManageEntity::RefreshCameras(){
-#if defined(RVC_OS_WIN)
-    m_cameras.clear();
-    CAutoArray<CSimpleStringA> hspCams;
-    auto rc = GetHSPCameras(hspCams);
-    Dbg("[GetHSPCameras]: (0x%x,%d)", rc, hspCams.GetCount());
-    capture_enum_cameras(m_cameras, hspCams);
-    for (int i = 0; i < m_cameras.size(); ++i) {
-        Dbg("m_cameras[%d]:%s", i, m_cameras[i].strFriendlyName.GetData());
-    }
-#endif //RVC_OS_WIN
-}
-
-
-//打开前检查配置摄像头配置名是否正确,不正确尝试自纠正(插拔摄像头会导致其名字变更,需要我们打开前纠正其名字)
-//注意配置的摄像头名由摄像头名+摄像头路径MD5两部分组成
-bool CCameraConfigManageEntity::AutoCorrectCameraConfig(VideoConfig *config) {
-	int errorCameraCnt = 0;
-	bool convertResult = true;
-	bool envCanOpen = true;
-	bool optCanOpen = true;
-	bool ewsCanOpen = true;
-
-	envCanOpen = CheckConfigCameraCanOpen(m_camerasConfig.strEnvCamera);
-	if (!envCanOpen) {
-		errorCameraCnt++;
-	}
-	optCanOpen = CheckConfigCameraCanOpen(m_camerasConfig.strOptCamera);
-	if (!optCanOpen) {
-		errorCameraCnt++;
-	}
-	ewsCanOpen = CheckConfigCameraCanOpen(m_camerasConfig.strEwsCamera);
-	if (!ewsCanOpen) {
-		errorCameraCnt++;
-	}
-	Dbg("AutoCorrectCameraConfig, before update check result envCanOpen:%d, optCanOpen:%d, ewsCanOpen:%d", envCanOpen, optCanOpen, ewsCanOpen);
-	Dbg("AutoCorrectCameraConfig, before update originConfig Env:%s, Opt:%s, Ews:%s", 
-		(LPCSTR)m_originConfig.strEnvCamera, (LPCSTR)m_originConfig.strOptCamera, (LPCSTR)m_originConfig.strEwsCamera);
-	Dbg("AutoCorrectCameraConfig, before update config Env:%s, Opt:%s, Ews:%s", 
-		(LPCSTR)m_camerasConfig.strEnvCamera, (LPCSTR)m_camerasConfig.strOptCamera, (LPCSTR)m_camerasConfig.strEwsCamera);
-
-	SyncVideoConfig();
-
-	if (errorCameraCnt > 0) {		
-		bool envCanCorrect = true;
-		bool optCanCorrect = true;
-		bool ewsCanCorrect = true;
-		bool envCorrected = false;
-		bool optCorrected = false;
-		bool ewsCorrected = false;
-		CAutoArray<CSimpleStringA> hspCams;
-		CSimpleStringA old_ews_str = m_camerasConfig.strEwsCamera;
-		camera_names_t old_ews;
-		old_ews.strFriendlyName = m_camerasConfig.ewsCamera.strFriendlyName;
-		old_ews.strMd5Val = m_camerasConfig.ewsCamera.strMd5Val;
-		old_ews.strDevPath = m_camerasConfig.ewsCamera.strDevPath;
-		GetHSPCameras(hspCams);
-		
-		//1.首先采用找到与配置中Friendly摄像头名相同的唯一设备来纠正
-		if (!envCanOpen) {
-			envCanOpen = AutoCorrectCameraByOnlyFriendlyName(m_camerasConfig.envCamera, 
-				optCanOpen, ewsCanOpen, m_camerasConfig.optCamera, m_camerasConfig.ewsCamera, hspCams);
-			if (envCanOpen) {
-				envCorrected = true;
-				errorCameraCnt--;
-				m_camerasConfig.strEnvCamera = CSimpleStringA::Format("%s;%s",
-					m_camerasConfig.envCamera.strFriendlyName.GetData(), m_camerasConfig.envCamera.strMd5Val.GetData());
-				Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName success, envCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s", 
-					(LPCTSTR)m_camerasConfig.envCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.envCamera.strMd5Val,
-					(LPCTSTR)m_camerasConfig.envCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEnvCamera);
-			}else{
-				Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName, strEnvCamera:%s failed!", 
-					(LPCTSTR)m_camerasConfig.strEnvCamera);
-			}
-		}
-		if (!optCanOpen) {
-			optCanOpen = AutoCorrectCameraByOnlyFriendlyName(m_camerasConfig.optCamera, 
-				envCanOpen, ewsCanOpen, m_camerasConfig.envCamera, m_camerasConfig.ewsCamera, hspCams);
-			if (optCanOpen) {
-				optCorrected = true;
-				errorCameraCnt--;
-				m_camerasConfig.strOptCamera = CSimpleStringA::Format("%s;%s",
-					m_camerasConfig.optCamera.strFriendlyName.GetData(), m_camerasConfig.optCamera.strMd5Val.GetData());
-				Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName success, optCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-					(LPCTSTR)m_camerasConfig.optCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.optCamera.strMd5Val,
-					(LPCTSTR)m_camerasConfig.optCamera.strDevPath, (LPCTSTR)m_camerasConfig.strOptCamera);
-			}else{
-				Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName, strOptCamera:%s failed!", 
-					(LPCTSTR)m_camerasConfig.strOptCamera);
-			}
-		}
-		if (!ewsCanOpen) {
-			ewsCanOpen = AutoCorrectCameraByOnlyFriendlyName(m_camerasConfig.ewsCamera, 
-				envCanOpen, optCanOpen, m_camerasConfig.envCamera, m_camerasConfig.optCamera, hspCams);
-			if (ewsCanOpen) {
-				CSimpleStringA tmp = CSimpleStringA::Format("%s;%s",
-					m_camerasConfig.ewsCamera.strFriendlyName.GetData(), m_camerasConfig.ewsCamera.strMd5Val.GetData());
-				RefreshCameras();//m_cameras maybe don't refresh
-				convertResult = ConvertEwsCameraName(m_camerasConfig.strEwsCamera, tmp);
-				//防止strEwsCamera与ewsCamera.strFriendlyName、ewsCamera.strMd5Val值不一致,回退
-				if (!convertResult){
-					m_camerasConfig.strEwsCamera = old_ews_str;
-					m_camerasConfig.ewsCamera.strFriendlyName = old_ews.strFriendlyName;
-					m_camerasConfig.ewsCamera.strMd5Val = old_ews.strMd5Val;
-					m_camerasConfig.ewsCamera.strDevPath = old_ews.strDevPath;
-					ewsCanOpen = false;
-					Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName, ConvertEwsCameraName failed, return Ews:%s",
-							(LPCSTR)m_camerasConfig.strEwsCamera);
-				}else{
-					errorCameraCnt--;
-					ewsCorrected = true;
-					Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName success, ewsCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-						(LPCTSTR)m_camerasConfig.ewsCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.ewsCamera.strMd5Val,
-						(LPCTSTR)m_camerasConfig.ewsCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEwsCamera);
-				}
-			}else {
-				Dbg("AutoCorrectCameraConfig ByOnlyFriendlyName, strEwsCamera:%s failed!", 
-						(LPCTSTR)m_camerasConfig.strEwsCamera);
-			}
-		}
-
-		//2.采用排除法纠正(排除法用于只有唯一一个摄像头配置失败的场景,需要前面纠正后再来排除)
-		if (errorCameraCnt == 1) {
-			if (!envCanOpen) {
-				envCanOpen = AutoCorrectCameraByOnlyOne(m_camerasConfig.envCamera, 
-					m_camerasConfig.optCamera, m_camerasConfig.ewsCamera, hspCams);
-				if (envCanOpen) {
-					envCorrected = true;
-					errorCameraCnt--;
-					m_camerasConfig.strEnvCamera = CSimpleStringA::Format("%s;%s",
-						m_camerasConfig.envCamera.strFriendlyName.GetData(), m_camerasConfig.envCamera.strMd5Val.GetData());
-					Dbg("AutoCorrectCameraConfig ByOnlyOne success, envCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-						(LPCTSTR)m_camerasConfig.envCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.envCamera.strMd5Val,
-						(LPCTSTR)m_camerasConfig.envCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEnvCamera);
-				} else {
-					Dbg("AutoCorrectCameraConfig ByOnlyOne, strEnvCamera:%s failed!", 
-						(LPCTSTR)m_camerasConfig.strEnvCamera);
-				}
-			}
-			else if (!optCanOpen) {
-				optCanOpen = AutoCorrectCameraByOnlyOne(m_camerasConfig.optCamera, 
-					m_camerasConfig.envCamera, m_camerasConfig.ewsCamera, hspCams);
-				if (optCanOpen) {
-					optCorrected = true;
-					errorCameraCnt--;
-					m_camerasConfig.strOptCamera = CSimpleStringA::Format("%s;%s",
-						m_camerasConfig.optCamera.strFriendlyName.GetData(), m_camerasConfig.optCamera.strMd5Val.GetData());
-					Dbg("AutoCorrectCameraConfig ByOnlyOne success, optCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-						(LPCTSTR)m_camerasConfig.optCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.optCamera.strMd5Val,
-						(LPCTSTR)m_camerasConfig.optCamera.strDevPath, (LPCTSTR)m_camerasConfig.strOptCamera);
-				} else {
-					Dbg("AutoCorrectCameraConfig ByOnlyOne, strOptCamera:%s failed!", 
-						(LPCTSTR)m_camerasConfig.strOptCamera);
-				}
-			}
-			else if (!ewsCanOpen) {
-				ewsCanOpen = AutoCorrectCameraByOnlyOne(m_camerasConfig.ewsCamera, 
-					m_camerasConfig.envCamera, m_camerasConfig.optCamera, hspCams);
-				if(ewsCanOpen){
-					CSimpleStringA tmp = CSimpleStringA::Format("%s;%s",
-						m_camerasConfig.ewsCamera.strFriendlyName.GetData(), m_camerasConfig.ewsCamera.strMd5Val.GetData());
-					RefreshCameras();//m_cameras maybe don't refresh
-					convertResult = ConvertEwsCameraName(m_camerasConfig.strEwsCamera, tmp);
-					//防止strEwsCamera与ewsCamera.strFriendlyName、ewsCamera.strMd5Val值不一致,回退
-					if (!convertResult){
-						m_camerasConfig.strEwsCamera = old_ews_str;
-						m_camerasConfig.ewsCamera.strFriendlyName = old_ews.strFriendlyName;
-						m_camerasConfig.ewsCamera.strMd5Val = old_ews.strMd5Val;
-						m_camerasConfig.ewsCamera.strDevPath = old_ews.strDevPath;
-						ewsCanOpen = false;
-						Dbg("AutoCorrectCameraConfig ByOnlyOne, ConvertEwsCameraName failed, return Ews:%s",
-							(LPCSTR)m_camerasConfig.strEwsCamera);
-					}else{
-						errorCameraCnt--;
-						ewsCorrected = true;
-						Dbg("AutoCorrectCameraConfig ByOnlyOne success, ewsCamera:FriendlyName:%s Md5Val:%s DevPath:%s Name:%s",
-							(LPCTSTR)m_camerasConfig.ewsCamera.strFriendlyName, (LPCTSTR)m_camerasConfig.ewsCamera.strMd5Val,
-							(LPCTSTR)m_camerasConfig.ewsCamera.strDevPath, (LPCTSTR)m_camerasConfig.strEwsCamera);
-					}
-				} else {
-					Dbg("AutoCorrectCameraConfig ByOnlyOne, strEwsCamera:%s failed!", 
-						(LPCTSTR)m_camerasConfig.strEwsCamera);
-				}
-			}
-		}
-
-		//注意:strEwsCamera记录的广角设备路径ID无法唯一标识设备(),导致出现纠正后strEwsCamera与env/opt设备路径ID一致而无法打开的情况
-		//而strDevPath能唯一标识设备
-		//这里对此种场景做特殊处理,对于纠正后广角与env/opt设备路径ID一致的回退不纠正
-		if (ewsCorrected){
-			CSimpleStringA tmpEnv = "$";
-			CSimpleStringA tmpOpt = "$";
-			ConvertEwsCameraName(tmpEnv, m_camerasConfig.strEnvCamera);
-			ConvertEwsCameraName(tmpOpt, m_camerasConfig.strOptCamera);
-			if((strcmp((LPCTSTR)m_camerasConfig.strEwsCamera, (LPCTSTR)tmpEnv) == 0) || 
-				(strcmp((LPCTSTR)m_camerasConfig.strEwsCamera, (LPCTSTR)tmpOpt) == 0)){
-				m_camerasConfig.strEwsCamera = old_ews_str;
-				m_camerasConfig.ewsCamera.strFriendlyName = old_ews.strFriendlyName;
-				m_camerasConfig.ewsCamera.strMd5Val = old_ews.strMd5Val;
-				m_camerasConfig.ewsCamera.strDevPath = old_ews.strDevPath;
-				ewsCanOpen = false;
-				ewsCorrected = false;
-				Dbg("AutoCorrectCameraConfig, Corrected Ews Same With Env or Opt, return Ews:%s",
-					(LPCSTR)m_camerasConfig.strEwsCamera);
-			}
-		}
-		Dbg("AutoCorrectCameraConfig, after update config Env:%s, Opt:%s, Ews:%s",
-			(LPCSTR)m_camerasConfig.strEnvCamera, (LPCSTR)m_camerasConfig.strOptCamera, (LPCSTR)m_camerasConfig.strEwsCamera);
-
-		//update to root.ini
-		if (envCorrected || optCorrected || ewsCorrected){
-			CAutoArray<CEditConfigReq> reqs(3);
-			for (int i = 0; i < 3; ++i) {
-				reqs[i].EditType = 'U';
-				strcpy(reqs[i].EntityName, "Root");
-				strcpy(reqs[i].Section, "Video");
-			}
-			if (m_camerasConfig.strEnvCamera.GetLength() <= 1) {
-				m_camerasConfig.strEnvCamera = "$";
-			}
-			if (m_camerasConfig.strOptCamera.GetLength() <= 1) {
-				m_camerasConfig.strOptCamera = "$";
-			}
-			if (m_camerasConfig.strEwsCamera.GetLength() <= 1) {
-				m_camerasConfig.strEwsCamera = "$";
-			}
-			strcpy(reqs[0].Key, "EnvCamera");
-			strcpy(reqs[0].Value, (LPCTSTR)m_camerasConfig.strEnvCamera);
-			strcpy(reqs[1].Key, "OptCamera");
-			strcpy(reqs[1].Value, (LPCTSTR)m_camerasConfig.strOptCamera);
-			strcpy(reqs[2].Key, "EwsCamera");
-			strcpy(reqs[2].Value, (LPCTSTR)m_camerasConfig.strEwsCamera);
-			HandleEditConfigReq(reqs);
-		}
-	}
-
-	config->strEnvCamera = m_camerasConfig.strEnvCamera;
-	config->strOptCamera = m_camerasConfig.strOptCamera;
-	config->strEwsCamera = m_camerasConfig.strEwsCamera;
-	return errorCameraCnt == 0;
-}
-
-//尝试自纠正一个摄像头配置名,采用配置名中设备名(FriendlyName)纠正
-bool CCameraConfigManageEntity::AutoCorrectCameraByOnlyFriendlyName(camera_names_t &correct_camera,
-	bool camera1_can_open, bool camera2_can_open,
-	const camera_names_t &exclude_camera1, const camera_names_t &exclude_camera2,
-	const CAutoArray<CSimpleStringA> &hspCams) {
-
-	bool result = false;
-
-#if defined(RVC_OS_WIN)
-    do {
-        camera_names_t tmp;
-        CAutoArray<CSimpleStringA> excludeCams;
-        //opt
-        if (strcmp((LPCTSTR)correct_camera.strFriendlyName, (LPCTSTR)exclude_camera1.strFriendlyName) == 0) {
-            if (!camera1_can_open) {
-                //两设备同名都无法打开,无法矫正
-                Dbg("AutoCorrectCameraByOnlyFriendlyName, strFriendlyName:%s can't correct for exclude_camera1 sameName",
-                    (LPCSTR)correct_camera.strFriendlyName);
-                break;
-            } else {
-                //去掉同名能正确打开设备
-                excludeCams.Append(&exclude_camera1.strMd5Val, 0, 1);
-                Dbg("AutoCorrectCameraByOnlyFriendlyName, correctCameraFriendlyName:%s add exclude camera1:%s",
-                    (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)exclude_camera1.strFriendlyName);
-            }
-        } else {
-            //两设备不同名,可以矫正
-        }
-        //ews
-        if (strcmp((LPCTSTR)correct_camera.strFriendlyName, (LPCTSTR)exclude_camera2.strFriendlyName) == 0) {
-            if (!camera2_can_open) {
-                //两设备同名都无法打开,无法矫正
-                Dbg("AutoCorrectCameraByOnlyFriendlyName, strFriendlyName:%s can't correct for exclude_camera2 sameName",
-                    (LPCSTR)correct_camera.strFriendlyName);
-                break;
-            } else {
-                excludeCams.Append(&exclude_camera2.strMd5Val, 0, 1);
-                Dbg("AutoCorrectCameraByOnlyFriendlyName, correctCameraFriendlyName:%s add exclude camera2:%s",
-                    (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)exclude_camera2.strFriendlyName);
-            }
-        } else {
-            //env与ews不同名,可以矫正
-        }
-        //矫正env
-        result = capture_get_only_video_device_by_friendlyname(correct_camera.strFriendlyName,
-                                                               excludeCams, hspCams, tmp);
-        if (result) {
-            correct_camera.strFriendlyName = tmp.strFriendlyName;
-            correct_camera.strDevPath = tmp.strDevPath;
-            correct_camera.strMd5Val = tmp.strMd5Val;
-            Dbg("AutoCorrectCameraByOnlyFriendlyName, find correct_camera strFriendlyName:%s strDevPath:%s strMd5Val:%s",
-                (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)correct_camera.strDevPath, (LPCSTR)correct_camera.strMd5Val);
-        }
-
-    } while (0);
-
-#endif //RVC_OS_WIN
-
-	return result;
-}
-
-//尝试自纠正一个摄像头配置名,采用唯一性纠正
-bool CCameraConfigManageEntity::AutoCorrectCameraByOnlyOne(camera_names_t &correct_camera, 
-	const camera_names_t &exclude_camera1, const camera_names_t &exclude_camera2,
-	const CAutoArray<CSimpleStringA> &hspCams) {
-	bool result = false;
-
-#if defined(RVC_OS_WIN)
-    camera_names_t tmp;
-    CAutoArray<CSimpleStringA> excludeCams;
-    //opt
-    excludeCams.Append(&exclude_camera1.strMd5Val, 0, 1);
-    //ews
-    excludeCams.Append(&exclude_camera2.strMd5Val, 0, 1);
-    Dbg("AutoCorrectCameraByOnlyOne, correctCameraFriendlyName:%s exclude camera1:%s",
-        (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)exclude_camera1.strFriendlyName);
-    Dbg("AutoCorrectCameraByOnlyOne, correctCameraFriendlyName:%s exclude camera2:%s",
-        (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)exclude_camera2.strFriendlyName);
-
-    //矫正env
-    result = capture_get_only_video_device(excludeCams, hspCams, tmp);
-    if (result) {
-        correct_camera.strFriendlyName = tmp.strFriendlyName;
-        correct_camera.strDevPath = tmp.strDevPath;
-        correct_camera.strMd5Val = tmp.strMd5Val;
-        Dbg("AutoCorrectCameraByOnlyOne, find correct_camera strFriendlyName:%s strDevPath:%s strMd5Val:%s",
-            (LPCSTR)correct_camera.strFriendlyName, (LPCSTR)correct_camera.strDevPath, (LPCSTR)correct_camera.strMd5Val);
-    }
-#endif //RVC_OS_WIN
-
-	return result;
-}
-
-void CCameraConfigManageEntity::GetMediaAvailableList(
-	SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req,
-	CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx)
-{
-	int count = 0;
-	const int maxCnt = 15;
-
-    CAutoArray<CSimpleStringA> cameras;
-	int icountmic(0);
-	int icountspeaker(0);
-
-	if (ctx->Req.type == 0 || (ctx->Req.type & 1)) {
-        capture_enum_cameras(cameras);
-		count += cameras.GetCount();
-	}
-    if (ctx->Req.type == 0 || (ctx->Req.type & 2)) {
-		icountmic = mlibAudioMgr->audio_get_device_count(true);
-		Dbg("audio input device(%d)", icountmic);
-		count += icountmic;
-    }
-    if (ctx->Req.type == 0 || (ctx->Req.type & 4)) {
-		icountspeaker = mlibAudioMgr->audio_get_device_count(false);
-        Dbg("audio output device(%d)", icountspeaker);
-		count += icountspeaker;
-    }
-
-    ctx->Ans.AvailableList.Init(count);
-    ctx->Ans.ListItemType.Init(count);
-    ctx->Ans.ListItemStatus.Init(count);
-	int curCnt(0);
-
-    if (ctx->Req.type == 0 || (ctx->Req.type & 1)) {
-        for (int i = 0; i < cameras.GetCount(); ++i) {
-			ctx->Ans.AvailableList[curCnt] = cameras[i];
-			ctx->Ans.ListItemType[curCnt] = 1;
-			ctx->Ans.ListItemStatus[curCnt] = 0;
-            Dbg("%d: %s", i, ctx->Ans.AvailableList[curCnt].GetData());
-			curCnt++;
-        }
-    }
-    if (ctx->Req.type == 0 || (ctx->Req.type & 2)) {
-        for (int i=0; i < icountmic; i++) {
-            char strname[MAX_PATH] = { 0 };
-            mlibAudioMgr->audio_get_device_name(strname, MAX_PATH, true, i);
-            ctx->Ans.AvailableList[curCnt] = strname;
-            ctx->Ans.ListItemType[curCnt] = 2;
-			ctx->Ans.ListItemStatus[curCnt] = 0;
-            Dbg("%d: %s", i, ctx->Ans.AvailableList[curCnt].GetData());
-			curCnt++;
-        }
-    }
-    if (ctx->Req.type == 0 || (ctx->Req.type & 4)) {
-        for (int i = 0; i < icountspeaker; i++) {
-            char strname[MAX_PATH] = { 0 };
-            mlibAudioMgr->audio_get_device_name(strname, MAX_PATH, false, i);
-            ctx->Ans.AvailableList[curCnt] = strname;
-            ctx->Ans.ListItemType[curCnt] = 4;
-			ctx->Ans.ListItemStatus[curCnt] = 0;
-            Dbg("%d: %s", i, ctx->Ans.AvailableList[curCnt].GetData());
-			curCnt++;
-        }
-    }
-	
-	ctx->Ans.result = curCnt;
-	ctx->Answer(Error_Succeed);
-}
-
-void CCameraConfigManageEntity::SetMediaDevice(SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req, CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx)
-{
-	ctx->Answer(Error_NotImpl);
-}
-
-void CCameraConfigManageEntity::TestAvailableMedieDev(SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req, CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx)
-{
-	ctx->Answer(Error_NotImpl);
-}
-
-void CameraConfigManageServiceSession::Handle_BeginCameraConfigManage( 
-	SpOnewayCallContext<CameraConfigManageService_BeginCameraConfigManage_Info>::Pointer ctx )
-{
-#if defined(RVC_OS_WIN)
-    m_pEntity->StopEchoVideo();
-    m_pEntity->StopCamera();
-    LogEvent(Severity_Middle, LOG_EVT_BEGIN_CAMERA_CONFIG, NULL);
-#endif //RVC_OS_WIN
-}
-
-void CameraConfigManageServiceSession::Handle_EndCameraConfigManage( 
-	SpOnewayCallContext<CameraConfigManageService_EndCameraConfigManage_Info>::Pointer ctx )
-{
-#if defined(RVC_OS_WIN)
-    m_pEntity->StopEchoVideo();
-    m_pEntity->StopCamera();
-    LogEvent(Severity_Middle, LOG_EVT_END_CAMERA_CONFIG, NULL);
-#endif //RVC_OS_WIN
-}
-
-void CameraConfigManageServiceSession::Handle_GetCameraList( 
-	SpReqAnsContext<CameraConfigManageService_GetCameraList_Req, 
-	CameraConfigManageService_GetCameraList_Ans>::Pointer ctx )
-{
-	std::vector<camera_names_t> cams;
-	m_pEntity->GetAvailableCameras(cams);
-
-	if (!cams.empty()) {
-		int nCount = cams.size();
-		ctx->Ans.AvailableList.Init(nCount);
-		for (int i = 0; i < nCount; ++i) {
-#if defined(RVC_OS_WIN)
-            ctx->Ans.AvailableList[i] = CSimpleStringA::Format("%s;%s",
-															   cams[i].strFriendlyName.GetData(), cams[i].strMd5Val.GetData());
-#else
-			ctx->Ans.AvailableList[i] = cams[i].strDevPath;
-#endif //RVC_OS_WIN
-		}
-	}
-
-	VideoConfig m_videoConfig;
-	m_pEntity->LoadConfig(&m_videoConfig);
-
-	bool bNull = m_videoConfig.strEnvCamera.IsNullOrEmpty();
-	ctx->Ans.EnvCamera = bNull?"$":m_videoConfig.strEnvCamera;
-
-	bNull = m_videoConfig.strOptCamera.IsNullOrEmpty();
-	ctx->Ans.OptCamera = bNull?"$":m_videoConfig.strOptCamera;
-
-	bNull = m_videoConfig.strEwsCamera.IsNullOrEmpty();
-	ctx->Ans.EwsCamera = bNull?"$":m_videoConfig.strEwsCamera;
-
-	if (eDesk2SType == m_pEntity->GetDeviceType()){
-		if ('$' == ctx->Ans.EwsCamera[0]){
-			ctx->Ans.EwsCamera = ctx->Ans.EnvCamera;
-		}
-	}
-	
-
-	if (ctx->Ans.EwsCamera != CSimpleStringA("$")) {
-		BOOL bFound = FALSE;
-		for (int i = 0; i < cams.size(); ++i) {
-			if (strstr(cams[i].strDevPath.GetData(),m_videoConfig.strEwsCamera.GetData())) {
-				bFound = TRUE;
-#if defined(RVC_OS_WIN)
-                ctx->Ans.EwsCamera = CSimpleStringA::Format("%s;%s",
-                                                            cams[i].strFriendlyName.GetData(), cams[i].strMd5Val.GetData());
-#else
-				ctx->Ans.EwsCamera = cams[i].strDevPath;
-#endif //RVC_OS_WIN
-				break;
-			}
-		}
-
-		if (!bFound) {
-			Dbg("[dbg] failed to find ewscam");
-		}
-		else {
-			Dbg("[dbg] ewscamera:%s-->%s",m_videoConfig.strEwsCamera.GetData(),ctx->Ans.EwsCamera.GetData());
-		}
-	}
-
-	ctx->Answer(Error_Succeed);
-}
-
-void CameraConfigManageServiceSession::Handle_EchoSomeCamera( 
-	SpReqAnsContext<CameraConfigManageService_EchoSomeCamera_Req, 
-	CameraConfigManageService_EchoSomeCamera_Ans>::Pointer ctx )
-{
-#if defined(RVC_OS_WIN)
-    if (ctx->Req.CameraName.GetLength() <= 1 ||
-        ctx->Req.WndParams.GetLength() <= 1) {
-        ctx->Ans.Error_Code = 0x21D81001;
-        ctx->Ans.Error_Msg = "params cannot be omitted";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    const char* wndParams = (LPCTSTR)(ctx->Req.WndParams);
-    Dbg("start to echo video, get pos = %s", wndParams);
-    int xPos, yPos, width, height;
-    int nsuc = sscanf(wndParams, "%d@%d@%d@%d", &xPos, &yPos, &width, &height);
-    if (nsuc != 4) {
-        ctx->Ans.Error_Code = 0x21D81002;
-        ctx->Ans.Error_Msg = "WndParams is illegal";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    Dbg("x=%d,y=%d,width=%d,height=%d", xPos, yPos, width, height);
-    int ScreenWidth = GetSystemMetrics(SM_CXSCREEN);  //主屏幕宽度
-    int ScreenHeight = GetSystemMetrics(SM_CYSCREEN); //主屏幕高度
-
-    DeviceTypeEnum devType = m_pEntity->GetDeviceType();
-    if (eDesk2SType == devType) // 低柜双屏在客户经理屏操作
-    {
-        if (xPos < 0 || yPos < 0 || width<0 || height < 0 ||
-            xPos + width>2 * ScreenWidth || yPos + height>ScreenHeight) // 
-        {
-            // 弹出模态窗口提示回显参数不正确
-            ctx->Ans.Error_Code = 0x21D81003;
-            ctx->Ans.Error_Msg = "WndParams is illegal";
-            ctx->Answer(Error_Succeed);
-            MessageBoxA(NULL, (LPCSTR)("窗口参数不正确,无法进行视频回显!"), NULL, MB_SYSTEMMODAL);
-            return;
-        }
-    } else {
-        if (xPos < 0 || yPos < 0 || width<0 || height<0 ||
-            xPos + width>ScreenWidth || yPos + height>ScreenHeight) // 
-        {
-            // 弹出模态窗口提示回显参数不正确
-            ctx->Ans.Error_Code = 0x21D81003;
-            ctx->Ans.Error_Msg = "WndParams is illegal";
-            ctx->Answer(Error_Succeed);
-            MessageBoxA(NULL, (LPCSTR)("窗口参数不正确,无法进行视频回显!"), NULL, MB_SYSTEMMODAL);
-            return;
-        }
-    }
-
-
-    CSimpleStringA currentCamName = m_pEntity->GetCameraName();
-    if (currentCamName != ctx->Req.CameraName) {
-        // 停止回显
-        m_pEntity->StopEchoVideo();
-        // 停止摄像头
-        m_pEntity->StopCamera();
-        // 摄像头赋值
-        m_pEntity->SetCameraName(ctx->Req.CameraName);
-    }
-
-    Dbg("ctx->Req.CameraName:%s", ctx->Req.CameraName.GetData());
-
-    if (!m_pEntity->IsCameraStart()) {
-        // 启动摄像头
-        ErrorCodeEnum error = m_pEntity->StartCamera();
-        if (error != Error_Succeed) {
-            ctx->Ans.Error_Code = 0x21D81004;
-            ctx->Ans.Error_Msg = "failed to start camera";
-            ctx->Answer(Error_Succeed);
-            return;
-        }
-    }
-
-    // 开始回显画面
-    m_pEntity->StartEchoVideo(xPos, yPos, width, height);
-
-    ctx->Ans.Error_Code = 0;
-    ctx->Ans.Error_Msg = "";
-    ctx->Answer(Error_Succeed);
-#else
-    ctx->Answer(Error_NotImpl);
-#endif //RVC_OS_WIN
-}
-
-void CameraConfigManageServiceSession::Handle_SaveCameraConfig( 
-	SpReqAnsContext<CameraConfigManageService_SaveCameraConfig_Req, 
-	CameraConfigManageService_SaveCameraConfig_Ans>::Pointer ctx )
-{
-
-#if defined(RVC_OS_WIN)
-    camera_names_t camera;
-
-    if (ctx->Req.EnvCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.EnvCamera.GetData(), camera) < 0) {
-        ctx->Ans.Error_Code = 0x21D82001;
-        ctx->Ans.Error_Msg = "EnvCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    if (ctx->Req.OptCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.OptCamera.GetData(), camera) < 0) {
-        ctx->Ans.Error_Code = 0x21D82002;
-        ctx->Ans.Error_Msg = "OptCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    if (ctx->Req.EwsCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.EwsCamera.GetData(), camera) < 0) {
-        ctx->Ans.Error_Code = 0x21D82003;
-        ctx->Ans.Error_Msg = "EwsCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-#else
-    if (ctx->Req.EnvCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.EnvCamera.GetData()) < 0) {
-        ctx->Ans.Error_Code = 0x21D82001;
-        ctx->Ans.Error_Msg = "EnvCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    if (ctx->Req.OptCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.OptCamera.GetData()) < 0) {
-        ctx->Ans.Error_Code = 0x21D82002;
-        ctx->Ans.Error_Msg = "OptCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    if (ctx->Req.EwsCamera.GetLength() > 1 &&
-        capture_get_video_device_id(ctx->Req.EwsCamera.GetData()) < 0) {
-        ctx->Ans.Error_Code = 0x21D82003;
-        ctx->Ans.Error_Msg = "EwsCamera does not exist";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-#endif //RVC_OS_WIN
-
-	CAutoArray<CEditConfigReq> reqs(3);
-
-	for (int i = 0; i < 3; ++i) {
-		reqs[i].EditType = 'U';
-		strcpy(reqs[i].EntityName,"Root");
-		strcpy(reqs[i].Section,"Video");
-	}
-
-	if (ctx->Req.EnvCamera.GetLength() <= 1) {
-		ctx->Req.EnvCamera = "$";
-	}
-	if (ctx->Req.OptCamera.GetLength() <= 1) {
-		ctx->Req.OptCamera = "$";
-	}
-	if (ctx->Req.EwsCamera.GetLength() <= 1) {
-		ctx->Req.EwsCamera = "$";
-	}
-
-	strcpy(reqs[0].Key,"EnvCamera");
-	strcpy(reqs[0].Value,(LPCTSTR)ctx->Req.EnvCamera);
-
-	strcpy(reqs[1].Key,"OptCamera");
-	strcpy(reqs[1].Value,(LPCTSTR)ctx->Req.OptCamera);
-
-	strcpy(reqs[2].Key,"EwsCamera");
-	if (ctx->Req.EwsCamera.GetLength() > 1)
-	{
-		if (ctx->Req.EwsCamera != ctx->Req.EnvCamera)
-		{
-			CSimpleStringA ewsCamName;
-			bool bRet = m_pEntity->ConvertEwsCameraName(ewsCamName,ctx->Req.EwsCamera);
-			Dbg("%s to ConvertEwsCameraName", (bRet ? "succeeded" : "failed"));
-			if (!bRet)
-			{
-				ctx->Ans.Error_Code = 0x21D82003;
-				ctx->Ans.Error_Msg = "EwsCamera does not exist";
-				ctx->Answer(Error_Succeed);
-				return;
-			}
-			strcpy(reqs[2].Value, ewsCamName.GetData());
-		}
-		else
-		{
-			Dbg("env camera is eqeul to ews camera, set ews camera to empty");
-			strcpy(reqs[2].Value, "$");
-		}
-
-	}
-	else
-	{
-		strcpy(reqs[2].Value, ctx->Req.EwsCamera.GetData());
-	}
-
-	m_pEntity->HandleEditConfigReq(reqs);
-
-	ctx->Ans.Error_Code = 0;
-	ctx->Ans.Error_Msg = "";
-	ctx->Answer(Error_Succeed);
-}
-
-void CameraConfigManageServiceSession::Handle_StopEchoSomeCamera( 
-	SpReqAnsContext<CameraConfigManageService_StopEchoSomeCamera_Req, 
-	CameraConfigManageService_StopEchoSomeCamera_Ans>::Pointer ctx )
-{
-#if defined(RVC_OS_WIN)
-    CSimpleStringA currentCamName = m_pEntity->GetCameraName();
-    if (currentCamName != ctx->Req.CameraName) {
-        ctx->Ans.Error_Code = 0x21D83001;
-        ctx->Ans.Error_Msg = "input camera name is incorrect";
-        ctx->Answer(Error_Succeed);
-        return;
-    }
-
-    m_pEntity->StopEchoVideo();
-    m_pEntity->StopCamera();
-
-    ctx->Ans.Error_Code = 0;
-    ctx->Ans.Error_Msg = "";
-    ctx->Answer(Error_Succeed);
-#else
-	ctx->Answer(Error_NotSupport);
-#endif //RVC_OS_WIN
-}
-
-void CameraConfigManageServiceSession::Handle_QueryCallState( 
-	SpReqAnsContext<CameraConfigManageService_QueryCallState_Req, 
-	CameraConfigManageService_QueryCallState_Ans>::Pointer ctx )
-{
-	CSimpleStringA strValue;
-	ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("CallState", strValue);
-	Dbg("QueryCallState: %s", strValue.GetData());
-	if (Error != Error_Succeed)
-	{
-		strValue = "";
-	}
-
-	ctx->Ans.CallState = strValue;
-	ctx->Answer(Error_Succeed);
-}
-
-void CameraConfigManageServiceSession::Handle_QueryUIState( 
-	SpReqAnsContext<CameraConfigManageService_QueryUIState_Req, 
-	CameraConfigManageService_QueryUIState_Ans>::Pointer ctx )
-{
-	CSimpleStringA strValue;
-	ErrorCodeEnum Error = m_pEntity->GetFunction()->GetSysVar("UIState", strValue);
-	Dbg("QueryUIState: %s", strValue.GetData());
-	if (Error != Error_Succeed)
-	{
-		strValue = "";
-	}
-
-	ctx->Ans.UIState = strValue;
-	ctx->Answer(Error_Succeed);
-}
-
-void CameraConfigManageServiceSession::Handle_AutoCorrectCameraConfig(
-	SpReqAnsContext<CameraConfigManageService_AutoCorrectCameraConfig_Req,
-	CameraConfigManageService_AutoCorrectCameraConfig_Ans>::Pointer ctx) {
-
-	VideoConfig m_videoConfig;
-	m_pEntity->AutoCorrectCameraConfig(&m_videoConfig);
-
-	bool bNull = m_videoConfig.strEnvCamera.IsNullOrEmpty();
-	ctx->Ans.EnvCamera = bNull ? "$" : m_videoConfig.strEnvCamera;
-
-	bNull = m_videoConfig.strOptCamera.IsNullOrEmpty();
-	ctx->Ans.OptCamera = bNull ? "$" : m_videoConfig.strOptCamera;
-
-	bNull = m_videoConfig.strEwsCamera.IsNullOrEmpty();
-	ctx->Ans.EwsCamera = bNull ? "$" : m_videoConfig.strEwsCamera;
-
-	ctx->Answer(Error_Succeed);
-}
-
-void CameraConfigManageServiceSession::Handle_GetMediaAvailableList(SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req, CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx)
-{
-	LOG_FUNCTION();
-	m_pEntity->GetMediaAvailableList(ctx);
-}
-
-void CameraConfigManageServiceSession::Handle_SetMediaDevice(SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req, CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx)
-{
-    LOG_FUNCTION();
-    m_pEntity->SetMediaDevice(ctx);
-}
-
-void CameraConfigManageServiceSession::Handle_TestAvailableMedieDev(SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req, CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx)
-{
-    LOG_FUNCTION();
-    m_pEntity->TestAvailableMedieDev(ctx);
-}
-
-SP_BEGIN_ENTITY_MAP()
-SP_ENTITY(CCameraConfigManageEntity)
-SP_END_ENTITY_MAP()
-

+ 0 - 271
Module/mod_CameraConfigManage/mod_CameraConfigManage.h

@@ -1,271 +0,0 @@
-#ifndef RVC_MOD_CAMERACONFIG_MANAGER_H__
-#define RVC_MOD_CAMERACONFIG_MANAGER_H__
-
-#pragma once
-
-#include "SpBase.h"
-#include "SpIni.h"
-#include "modVer.h"
-#include "EventCode.h"
-#include "ModuleMix.h"
-
-#include "CameraConfigManage_server_g.h"
-#include "CameraConfigManage_msg_g.h"
-
-#if defined(_MSC_VER)
-#include "Capture.h"
-#include "libvideoecho.h"
-#else
-#include <vector>
-#include <libtoolkit/config.h>
-#include "capture.h"
-#endif //_MSC_VER
-
-#include "iaudiomgrinterface.h"
-
-using namespace MediaController;
-
-static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
-{
-	vDbg(fmt, arg);
-}
-
-namespace CameraConfigManage {
-
-	typedef struct
-	{
-		CSimpleStringA strEnvCamera;
-		CSimpleStringA strOptCamera;
-		CSimpleStringA strEwsCamera;
-
-	} VideoConfig;
-
-	typedef struct
-	{
-		CSimpleStringA strEnvCamera;
-		CSimpleStringA strOptCamera;
-		CSimpleStringA strEwsCamera;
-		//detail 
-		camera_names_t envCamera;
-		camera_names_t optCamera;
-		camera_names_t ewsCamera;
-
-	} VideoConfigDetail;
-
-	// 修改实体配置文件
-	typedef struct
-	{
-		char EditType;			    // "A"增加;"U"修改;“D" 删除
-		char EntityName[32];	// 配置文件名
-		char Section[32];		    // 配置节
-		char Key[32];			    // 配置项
-		char Value[256];		    // 值
-	} CEditConfigReq;
-
-	class CCameraConfigManageEntity;
-
-	class CameraConfigManageServiceSession : public CameraConfigManageService_ServerSessionBase
-	{
-	public:
-		explicit CameraConfigManageServiceSession(CCameraConfigManageEntity *pEntity) : m_pEntity(pEntity){}
-		void Handle_BeginCameraConfigManage(
-			SpOnewayCallContext<CameraConfigManageService_BeginCameraConfigManage_Info>::Pointer ctx);
-		void Handle_EndCameraConfigManage(
-			SpOnewayCallContext<CameraConfigManageService_EndCameraConfigManage_Info>::Pointer ctx);
-		void Handle_GetCameraList(
-			SpReqAnsContext<CameraConfigManageService_GetCameraList_Req, 
-			CameraConfigManageService_GetCameraList_Ans>::Pointer ctx);
-		void Handle_EchoSomeCamera(
-			SpReqAnsContext<CameraConfigManageService_EchoSomeCamera_Req, 
-			CameraConfigManageService_EchoSomeCamera_Ans>::Pointer ctx);
-		void Handle_SaveCameraConfig(
-			SpReqAnsContext<CameraConfigManageService_SaveCameraConfig_Req, 
-			CameraConfigManageService_SaveCameraConfig_Ans>::Pointer ctx);
-		void Handle_StopEchoSomeCamera(
-			SpReqAnsContext<CameraConfigManageService_StopEchoSomeCamera_Req, 
-			CameraConfigManageService_StopEchoSomeCamera_Ans>::Pointer ctx);
-		void Handle_QueryCallState(
-			SpReqAnsContext<CameraConfigManageService_QueryCallState_Req, 
-			CameraConfigManageService_QueryCallState_Ans>::Pointer ctx);
-		void Handle_QueryUIState(
-			SpReqAnsContext<CameraConfigManageService_QueryUIState_Req, 
-			CameraConfigManageService_QueryUIState_Ans>::Pointer ctx);
-		void Handle_AutoCorrectCameraConfig(
-			SpReqAnsContext<CameraConfigManageService_AutoCorrectCameraConfig_Req, 
-			CameraConfigManageService_AutoCorrectCameraConfig_Ans>::Pointer ctx);
-
-		void Handle_GetMediaAvailableList(SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req, CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx);
-		void Handle_SetMediaDevice(SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req, CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx);
-		void Handle_TestAvailableMedieDev(SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req, CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx);
-
-
-	private:
-		CCameraConfigManageEntity *m_pEntity;
-	};
-
-	class CCameraConfigManageEntity: public CEntityBase, public ISysVarListener, 
-		public ILogListener, public ITimerListener
-#if defined(RVC_OS_WIN)
-		, public LibVideoEcho::CVideoEchoHostApi
-#endif //RVC_OS_WIN
-	{
-	public:
-		CCameraConfigManageEntity(): m_capture(NULL), m_iCameraState('N'), 
-			m_nActiveCamera(0)
-#if defined(RVC_OS_WIN)
-            , m_pSession(NULL)
-#endif //RVC_OS_WIN
-			, m_bStartCamera(FALSE), 
-			m_bEchoVideo(FALSE), m_lCaptureCount(0),mlibAudioMgr(NULL)
-		{
-			audiomgr_callback_t t_callback = { 0 };
-			t_callback.debug = &__audiomgrlog;
-			mlibAudioMgr = CreateAudioMgrObj(&t_callback);
-		}
-
-		virtual ~CCameraConfigManageEntity() { 
-			LOG_FUNCTION();
-            if (NULL != mlibAudioMgr) {
-				mlibAudioMgr->audio_mgr_terminate();
-                DestroyIAudioMgrObj(mlibAudioMgr);
-            }
-		}
-
-		virtual const char *GetEntityName() const { return "CameraConfigManage"; }
-
-        const char* GetEntityVersion() const { return MODULE_VERSION_FULL; }
-
-		virtual bool IsService() const{ return true; }
-
-		virtual CServerSessionBase *OnNewSession(const char* pszRemoteEntityName, const char * pszClass)
-		{
-			LOG_TRACE("%s connected class = %s!", pszRemoteEntityName, pszClass);
-			return new CameraConfigManageServiceSession(this);
-		}
-
-		virtual void OnPreStart(
-			CAutoArray<CSimpleStringA> strArgs,
-			CSmartPointer<ITransactionContext> pTransactionContext);
-
-		virtual void OnStarted();
-
-		virtual void OnPreClose(
-			EntityCloseCauseEnum eCloseCause,
-			CSmartPointer<ITransactionContext> pTransactionContext);
-
-		void OnExam(CSmartPointer<ITransactionContext> pTransactionContext) 
-		{
-           // SpReqAnsContext<CameraConfigManageService_GetCameraList_Req, CameraConfigManageService_GetCameraList_Ans>::Pointer ctx;
-            //ctx.Attach(new SpReqAnsContext<CameraConfigManageService_GetCameraList_Req, CameraConfigManageService_GetCameraList_Ans>(pTransactionContext));
-			pTransactionContext->SendAnswer(Error_NotImpl);
-		}
-
-		virtual void OnSysVarEvent(
-			const char *pszKey, 
-			const char *pszValue,
-			const char *pszOldValue,
-			const char *pszEntityName);
-
-		virtual void OnLog(
-			const CAutoArray<CUUID> &SubIDs, 
-			const CUUID nLogID,
-			const LogTypeEnum eLogType, 
-			const SeverityLevelEnum eLevel, 
-			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);
-
-		virtual void OnTimeout(DWORD dwTimerID);
-
-        void GetMediaAvailableList(SpReqAnsContext<CameraConfigManageService_GetMediaAvailableList_Req, CameraConfigManageService_GetMediaAvailableList_Ans>::Pointer ctx);
-        void SetMediaDevice(SpReqAnsContext<CameraConfigManageService_SetMediaDevice_Req, CameraConfigManageService_SetMediaDevice_Ans>::Pointer ctx);
-        void TestAvailableMedieDev(SpReqAnsContext<CameraConfigManageService_TestAvailableMedieDev_Req, CameraConfigManageService_TestAvailableMedieDev_Ans>::Pointer ctx);
-
-		virtual void Debug(const char *fmt, ...);
-
-		virtual int GetActiveCamera();
-
-		virtual HINSTANCE GetEntityHinstance();
-
-		ErrorCodeEnum GetHSPCameras(CAutoArray<CSimpleStringA> &HSPCameras);
-
-		void GetAvailableCameras(std::vector<camera_names_t> &cams);
-
-		ErrorCodeEnum LoadConfig(capture_config_t *conf);
-
-		ErrorCodeEnum LoadConfig(VideoConfig *conf);
-
-		// 编辑配置文件 add by ly@2019/03/18
-		ErrorCodeEnum HandleEditConfigReq(const CAutoArray<CEditConfigReq> &reqs);
-
-		void SetCameraName(CSimpleStringA camName);
-
-		CSimpleStringA GetCameraName();
-
-		BOOL IsCameraStart();
-
-		ErrorCodeEnum StartCamera();
-
-		void StopCamera();
-
-#if defined(RVC_OS_WIN)
-        void StartEchoVideo(int x, int y, int w, int h);
-        void StopEchoVideo();
-#endif //RVC_OS_WIN
-
-		// direct show name -> device instance path
-		bool ConvertEwsCameraName(CSimpleStringA& strRetrievedName, const CSimpleStringA& strDirectShowName);
-
-		// get dev type
-		DeviceTypeEnum GetDeviceType() const { return m_eDeviceType; }
-
-		bool AutoCorrectCameraConfig(VideoConfig *config);
-
-	private: 
-
-		void SyncVideoConfig();
-
-		void RefreshCameras();
-
-		bool AutoCorrectCameraByOnlyFriendlyName(camera_names_t &correct_camera,
-			bool camera1_can_open, bool camera2_can_open,
-			const camera_names_t &exclude_camera1, const camera_names_t &exclude_camera2,
-			const CAutoArray<CSimpleStringA> &hspCams);
-
-		bool AutoCorrectCameraByOnlyOne(camera_names_t &correct_camera,
-			const camera_names_t &exclude_camera1, const camera_names_t &exclude_camera2,
-			const CAutoArray<CSimpleStringA> &hspCams);
-
-	private:
-
-		capture_t *m_capture;
-		std::vector<camera_names_t> m_cameras;
-		int m_iCameraState;
-		int m_nActiveCamera;
-		DeviceTypeEnum m_eDeviceType;
-		BOOL m_bStartCamera;
-		BOOL m_bEchoVideo;
-		//huchen add for autocorrect
-		VideoConfig m_originConfig;
-		VideoConfigDetail m_camerasConfig;
-
-		capture_config_t m_conf;
-
-#if defined(RVC_OS_WIN)
-        LibVideoEcho::videoplay_session_t* m_pSession;
-#endif //RVC_OS_WIN
-
-	private:
-
-		LONG m_lCaptureCount;
-		CAutoArray<CUUID> m_arrListener;
-		IAudioMgr* mlibAudioMgr;
-	};
-}
-
-#endif //RVC_MOD_CAMERACONFIG_MANAGER_H__

+ 0 - 1070
Module/mod_CameraConfigManage/win/Capture.cpp

@@ -1,1070 +0,0 @@
-#include "stdafx.h"
-
-#include <locale.h>
-#include <memutil.h>
-#include <md5.h>
-#include <ipp.h>
-#include <intrin.h>
-#include "y2k_time.h"
-#include "rec_common.h"
-#include "videohorflip.h"
-#include "Event.h"
-#include "capture.h"
-using namespace CameraConfigManage;
-
-#define av_always_inline __inline
-#define inline __inline
-
-static int Bin2Str(unsigned char *x, int xlen, char *str, int str_size)
-{
-	static const char *hex2char = "0123456789ABCDEF";
-	int i, k = 0;
-	if (str_size <= xlen * 2)
-		return -1;
-	for (i = 0; i < xlen; ++i) {
-		int h = x[i] >> 4;
-		int l = x[i] & 0xf;
-		str[k++] = hex2char[h];
-		str[k++] = hex2char[l];
-	}
-	str[k] = 0;
-	return k;
-}
-
-static int translate_id(int in_direction, int idx)
-{
-	int i, n, ii;
-	n = Pa_GetDeviceCount();
-	for (i = 0, ii = 0; i < n; ++i) {
-		const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
-		if (in_direction) {
-			if (info->maxInputChannels) {
-				if (ii == idx) {
-					return i;
-				}
-				ii++;
-			}
-		} else {
-			if (info->maxOutputChannels) {
-				if (ii == idx) {
-					return i;
-				}
-				ii++;
-			}
-		}
-	}
-	return -1;
-}
-
-static int StreamCallback(const void *input, 
-	void *output, 
-	unsigned long frameCount, 
-	const PaStreamCallbackTimeInfo* timeInfo, 
-	PaStreamCallbackFlags statusFlags, 
-	void *userData)
-{
-	audio_capture_t *audio_cap = (audio_capture_t*)userData;
-
-	if (input) {
-		audio_frame frm;
-
-		frm.bitspersample = 16;
-		frm.format = 1;
-		frm.data = (char*)const_cast<void*>(input);
-		frm.framesize = frameCount << 1;
-		frm.nchannels = 1;
-		frm.samplespersec = CAPTURE_CLOCK;
-
-		if (!audio_cap->shm_queue->InsertAudio(&frm)) {
-			Dbg("Insert audio for video echo failed! frameCount:%d", frameCount);
-		}
-	}
-
-	if (output) {
-		memset(output, 0, frameCount<<1);
-	}
-
-
-	return paContinue;
-}
-
-static audio_capture_t *audio_capture_create(capture_t *cap)
-{
-	audio_capture_t *audio_cap = ZALLOC_T(audio_capture_t);
-	if (audio_cap) {
-		audio_cap->parent = cap;
-		audio_cap->shm_queue = new Clibaudioqueue(REC_COMMON_AUDIO_SHM_QUEUE);
-	}
-	return audio_cap;
-}
-
-static void audio_capture_destroy(audio_capture_t *audio_cap)
-{
-	delete audio_cap->shm_queue;
-	free(audio_cap);
-}
-
-static int audio_capture_start(audio_capture_t *audio_cap)
-{
-	capture_t *cap = audio_cap->parent;
-	PaStreamParameters inParam = {0};
-	PaStreamParameters outParam = {0};
-	PaError paError;
-	const PaDeviceInfo *info;
-	int nId = capture_get_audio_device_id(true, cap->config.strAudioIn);
-	if (nId == -1) 
-	{
-		//需要立即处理的告警使用Severity_High
-		//LogWarn(Severity_High,Error_DevMedia,ERROR_MOD_MEDIACONTROLLER_HANDFREEIN_INITFAIL,"handfree in device config error,please check");
-		return Error_AudioIN;
-	}
-	int in_dev_id = translate_id(TRUE, nId);
-	if (in_dev_id < 0) {
-		Dbg("audio in dev translate failed!");
-		return Error_AudioIN;
-	}
-	info = Pa_GetDeviceInfo(in_dev_id);
-	if (!info) {
-		Dbg("get device info failed!");
-		return Error_AudioIN;
-	}
-	inParam.channelCount = 1;
-	inParam.device = in_dev_id;
-	inParam.suggestedLatency = info->defaultLowInputLatency;
-	inParam.sampleFormat = paInt16;
-	inParam.hostApiSpecificStreamInfo = NULL;
-	if (Pa_IsFormatSupported(&inParam, NULL, CAPTURE_CLOCK) != paNoError) {
-		Dbg("audio capture create error, cannot open audio input device");
-		return Error_AudioIN;
-	}
-	
-	//打开流设备,可以用以下代码替换paError = Pa_OpenStream(&audio_cap->stream, &inParam, &outParam, CAPTURE_CLOCK, 
-	//CAPTURE_FRAME_TIME * CAPTURE_CLOCK/1000, paClipOff|paDitherOff, &StreamCallback, audio_cap);
-	paError = Pa_OpenStream(&audio_cap->stream, &inParam, NULL, CAPTURE_CLOCK, 
-		CAPTURE_FRAME_TIME * CAPTURE_CLOCK/1000, paClipOff|paDitherOff, &StreamCallback, audio_cap);
-
-	if (paError != paNoError) {
-		Dbg("portaudio open stream failed! paError = %d", paError);
-		return Error_AudioIN;
-	}
-
-	paError = Pa_StartStream(audio_cap->stream);
-	if (paError != paNoError) {
-		Dbg("portaudio start stream failed! paError = %d", paError);
-		return Error_AudioIN;
-	}
-
-	return Error_Succeed;
-}
-
-static void audio_capture_stop(audio_capture_t *audio_cap)
-{
-	if (audio_cap->stream) {
-		Pa_AbortStream(audio_cap->stream);
-		Pa_CloseStream(audio_cap->stream);
-		audio_cap->stream = NULL;
-	}
-}
-
-static int calc_capture_mode(int width, int height, int *mode)
-{
-	const struct {
-		int mode;
-		int width;
-		int height;
-	} modes [] = {
-		{VIDEOCAP_FRAME_SQCIF, VIDEOCAP_SQCIF_WIDTH, VIDEOCAP_SQCIF_HEIGHT},
-		{VIDEOCAP_FRAME_QQVGA, VIDEOCAP_QQVGA_WIDTH, VIDEOCAP_QQVGA_HEIGHT},
-		{VIDEOCAP_FRAME_QCIF, VIDEOCAP_QCIF_WIDTH, VIDEOCAP_QCIF_HEIGHT},
-		{VIDEOCAP_FRAME_QVGA, VIDEOCAP_QVGA_WIDTH, VIDEOCAP_QVGA_HEIGHT},
-		{VIDEOCAP_FRAME_CIF, VIDEOCAP_CIF_WIDTH, VIDEOCAP_CIF_HEIGHT},
-		{VIDEOCAP_FRAME_VGA, VIDEOCAP_VGA_WIDTH, VIDEOCAP_VGA_HEIGHT},
-		{VIDEOCAP_FRAME_4CIF, VIDEOCAP_4CIF_WIDTH, VIDEOCAP_4CIF_HEIGHT},
-		{VIDEOCAP_FRAME_SVGA, VIDEOCAP_SVGA_WIDTH, VIDEOCAP_SVGA_HEIGHT},
-		{VIDEOCAP_FRAME_NHD, VIDEOCAP_NHD_WIDTH, VIDEOCAP_NHD_HEIGHT},
-		{VIDEOCAP_FRAME_SXGA, VIDEOCAP_SXGA_WIDTH, VIDEOCAP_SXGA_HEIGHT},
-		{VIDEOCAP_FRAME_720P, VIDEOCAP_720P_WIDTH, VIDEOCAP_720P_HEIGHT},
-		{VIDEOCAP_FRAME_1080P, VIDEOCAP_1080P_WIDTH, VIDEOCAP_1080P_HEIGHT},
-	};
-	int i;
-	for (i = 0; i < array_size(modes); ++i) {
-		if (modes[i].width == width && modes[i].height == height) {
-			*mode = modes[i].mode;
-			return 0;
-		}
-	}
-	return Error_NotExist;
-}
-
-static int video_shm_enqueue(Clibvideoqueue *shm_queue, video_frame *frame, int flags)
-{
-	videoq_frame tmp_frm;
-	tmp_frm.data = frame->data[0];
-	tmp_frm.framesize = frame->width * frame->height * 3;
-	tmp_frm.format = VIDEOQ_FORMAT_RGB24;
-	tmp_frm.width = frame->width;
-	tmp_frm.height = frame->height;
-	unsigned int nowtime = y2k_time_now();
-	if (!shm_queue->InsertVideo(&tmp_frm, flags,nowtime)) {
-		Dbg("caution: insert shm video failed!");
-		return Error_Unexpect;
-	} else {
-		//Dbg("insert shm video ok!");
-		return Error_Succeed;
-	}
-}
-
-static void cap_on_frame(void *user_data, video_frame *frame)
-{
-	video_capture_t *video_cap = (video_capture_t *)user_data;
-	capture_t *cap = video_cap->parent;
-	int rc;
-
-	int flip = -1;
-	if (cap->config.video_rotate == 0){
-		flip = 0;
-	}
-	else if (cap->config.video_rotate == 180){
-		flip = (VIDEOQUEUE_FLAG_VERTICAL_FLIP|VIDEOQUEUE_FLAG_HORIZONTAL_FLIP);
-	}
-	else {
-		return;
-	}
-
-	video_cap->frame_id++;
-
-	//Dbg("start echo on frame, id=%d, tick=%d", video_cap->frame_id, GetTickCount());
-	/*IplImage*img = NULL;
-	img = cvCreateImage(cvSize(frame->width,frame->height),IPL_DEPTH_8U,3);
-	img->imageData = (char*)frame->data[0];
-	cvSaveImage("c:\\echo.jpg", img,0);
-	cvReleaseImageHeader(&img);*/
-
-	//// snapshot
-	//if (rc==Error_Succeed)
-	//{
-	//	if (*cap->config.ref_capture_count) 
-	//	{
-	//		Dbg("echo camera ref_env_capture_count=%d",*cap->config.ref_capture_count);
-	//		InterlockedDecrement(cap->config.ref_capture_count);
-	//		LogEvent(Severity_Middle, MOD_EVENT_MEDIACONTROLLER_FINISHED_CAPTURE_ENV, "agent capture env ok, and capture env finished!");
-	//	}
-	//}
-	// preview 320x240
-	{
-		video_frame preview_frame;
-		video_frame_alloc(REC_COMMON_VIDEO_PREVIEW_WIDTH, REC_COMMON_VIDEO_PREVIEW_HEIGHT, VIDEO_FORMAT_RGB24, &preview_frame);
-		memset(preview_frame.data[0], 0, preview_frame.height*preview_frame.linesize[0]);
-		uint8_t *dst_data[4] = {preview_frame.data[0] + 30 * preview_frame.linesize[0], 0, 0, 0}; // 320x180 paste to 320x240
-		sws_scale(video_cap->preview_sws_ctx, frame->data, frame->linesize, 0, frame->height, dst_data, preview_frame.linesize);
-		video_shm_enqueue(video_cap->preview_shm_queue, &preview_frame, flip);
-		video_frame_free(&preview_frame);
-	}
-
-	//Dbg("end echo on frame, id=%d, tick=%d", video_cap->frame_id, GetTickCount());;
-}
-
-static video_capture_t *video_capture_create(capture_t *cap, int camera_type)
-{
-	video_capture_t *video_cap = ZALLOC_T(video_capture_t);
-	if (video_cap) {
-		video_cap->parent = cap;
-		video_cap->camera_type = camera_type;
-		video_cap->frame_id = 0;
-		if (camera_type == CAMERA_TYPE_ENV) { // need to be edited
-			video_cap->preview_shm_queue = new Clibvideoqueue(REC_COMMON_VIDEO_ENV_SHM_PREVIEW_QUEUE);
-			video_cap->preview_sws_ctx = sws_getContext(REC_COMMON_VIDEO_SNAPSHOT_WIDTH,
-				REC_COMMON_VIDEO_SNAPSHOT_HEIGHT, 
-				PIX_FMT_BGR24,
-				REC_COMMON_VIDEO_RTP_ENV_WIDTH,
-				REC_COMMON_VIDEO_RTP_ENV_HEIGHT,
-				PIX_FMT_BGR24,
-				SWS_FAST_BILINEAR, NULL, NULL, NULL);
-		}
-	}
-	return video_cap;
-}
-
-static void video_capture_destroy(video_capture_t *video_cap)
-{
-	if (video_cap) {
-		if (video_cap->preview_sws_ctx) {
-			sws_freeContext(video_cap->preview_sws_ctx);
-			video_cap->preview_sws_ctx = NULL;
-		}
-		if (video_cap->preview_shm_queue) {
-			delete video_cap->preview_shm_queue;
-			video_cap->preview_shm_queue = NULL;
-		}
-		free(video_cap);
-	}
-}
-
-static int video_capture_start(video_capture_t *video_cap)
-{
-	capture_config_t *conf = &video_cap->parent->config;
-	int dev_id;
-	if (video_cap->camera_type == CAMERA_TYPE_ENV)
-	{
-		camera_names_t tmp;
-		dev_id = capture_get_video_device_id(conf->strVideo,tmp);
-		if (dev_id == -1) 
-		{
-			Dbg("No echo camera,please check config file or device!");
-			return -1;
-		}
-	}
-
-	videocap_param param = {0};
-	int cap_mode;
-	int rc = -1;
-	rc = calc_capture_mode(REC_COMMON_VIDEO_SNAPSHOT_WIDTH, REC_COMMON_VIDEO_SNAPSHOT_HEIGHT, &cap_mode);
-	if (rc != 0) 
-	{
-		Dbg("calc cap_mode failed!");
-		return rc;
-	}
-
-	param.cap_mode = cap_mode;
-	param.dev_id = dev_id;
-	param.frame_fmt = VIDEO_FORMAT_RGB24;
-	if ((ePadtype == g_eDeviceType)||(eDesk2SType == g_eDeviceType))
-	{
-		param.fps = REC_COMMON_VIDEO_FPS_MOBILE;
-	} 
-	else
-	{
-		param.fps = REC_COMMON_VIDEO_RAW_FPS;
-	}
-	param.on_frame = &cap_on_frame;
-	param.user_data = video_cap;
-	param.option = 0;
-
-	rc = videocap_create(&video_cap->cap, &param);
-	if (rc != 0) 
-	{
-		Dbg("videocap create failed!");
-		return rc;
-	}
-
-	rc = videocap_start(video_cap->cap);
-	if (rc != 0) 
-	{
-		Dbg("videocap start failed!");
-		videocap_destroy(video_cap->cap);
-		video_cap->cap = NULL;
-		return rc;
-	}
-
-	return 0;
-}
-
-static void video_capture_stop(video_capture_t *video_cap)
-{
-	if (video_cap->cap) {
-		videocap_stop(video_cap->cap);
-		videocap_destroy(video_cap->cap);
-		video_cap->cap = NULL;
-	}
-}
-
-static int audio_get_dev_count(int *in_cnt, int *out_cnt)
-{
-	int icnt = 0, ocnt = 0;
-	int cnt = Pa_GetDeviceCount();
-	for (int i = 0; i < cnt; ++i) {
-		const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
-		if (info->maxInputChannels)
-			icnt ++;
-		if (info->maxOutputChannels)
-			ocnt ++;
-	}
-	if (in_cnt)
-		*in_cnt = icnt;
-	if (out_cnt)
-		*out_cnt = ocnt;
-	return 0;
-}
-
-static CSimpleStringA audio_get_dev_name(bool in_direction, int idx)
-{
-	int cnt = Pa_GetDeviceCount();
-	int ii, i;
-	for (i = 0, ii = 0; i < cnt; ++i) {
-		const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
-		if (in_direction) {
-			if (info->maxInputChannels) {
-				if (idx == ii) {
-					return CSimpleStringA(info->name);
-				}
-				ii++;
-			}
-		} else {
-			if (info->maxOutputChannels) {
-				if (idx == ii) {
-					return CSimpleStringA(info->name);
-				}
-				ii++;
-			}
-		}
-	}
-	return CSimpleStringA();
-}
-
-namespace CameraConfigManage {
-
-	DeviceTypeEnum g_eDeviceType;
-
-	int capture_create( const capture_config_t *config, capture_t **p_cap )
-	{
-		capture_t *cap = ZALLOC_T(capture_t);
-		cap->audio = NULL;
-		cap->video = NULL;
-		memcpy(&cap->config, config, sizeof(capture_config_t));
-		cap->audio = audio_capture_create(cap);
-		if (!cap->audio) {
-			Dbg("create audio capture object failed!");
-			return Error_Unexpect;
-		}
-		camera_names_t tmp;
-		int dev_id = capture_get_video_device_id(config->strVideo,tmp);
-		if (dev_id != -1) 
-		{
-			cap->video = video_capture_create(cap, CAMERA_TYPE_ENV);
-			if (!cap->video) {
-				Dbg("create echo video object failed!");
-				return Error_Unexpect;
-			}
-		}
-
-		if(dev_id == -1)
-		{
-			Dbg("echo camera deviceid error!");
-			capture_destroy(cap);
-			return Error_Unexpect;
-		}
-		else
-		{
-			*p_cap = cap;
-			return 0;
-		}
-	}
-
-	// 重启摄像头用到
-	ErrorCodeEnum capture_create( const capture_config_t *config,capture_t *cap )
-	{
-		camera_names_t tmp;
-		int dev_id = capture_get_video_device_id(config->strVideo,tmp);
-		if((dev_id != -1)&&(cap->video == NULL))
-		{
-			cap->video = video_capture_create(cap, CAMERA_TYPE_ENV);
-			if (!cap->video)
-			{
-				Dbg("create echo video object failed!");
-				return Error_Unexpect;
-			}
-		}
-		else
-		{
-			return Error_Unexpect;
-		}
-		return Error_Succeed;
-	}
-
-	void capture_destroy( capture_t *cap )
-	{
-		if (cap) {
-			if (cap->video) {
-				video_capture_destroy(cap->video);
-				cap->video = NULL;
-			}
-			if (cap->audio) {
-				audio_capture_destroy(cap->audio);
-				cap->audio = NULL;
-			}
-			free(cap);
-		}
-	}
-
-	ErrorCodeEnum capture_start( capture_t *cap )
-	{
-		int rc = 0;
-
-		if (cap->audio) 
-		{
-			rc = audio_capture_start(cap->audio);
-			if (rc != Error_Succeed) 
-			{
-				ErrorCodeEnum rslt = (ErrorCodeEnum)rc;
-				if (rslt == Error_AudioIN)
-				{
-					Dbg("start audio In object failed! rc:%d", rc);
-					//LogWarn(Severity_High,Error_NotInit,ERROR_MOD_MEDIACONTROLLER_HANDFREE_OPENFAIL,"open audio device fail,please check device");	
-				}
-				return rslt;
-			}
-		}
-		else
-		{
-			Dbg("start echo audio Error_Unexpect");
-			return Error_Unexpect;
-		}
-
-		if (cap->video)
-		{
-			rc = video_capture_start(cap->video);
-			if (rc != Error_Succeed)
-			{
-				Dbg("start echo video capture object failed! rc:%d", rc);
-				//LogError(Severity_Middle,Error_NotInit,ERROR_MOD_MEDIACONTROLLER_ENVCAM_OPEN,"open echo camera fail,please check device");
-				return Error_EnvCamera;
-			}
-		}
-		else
-		{
-			Dbg("start echo video Error_Unexpect");
-			return Error_Unexpect;
-		}
-
-		return (ErrorCodeEnum)rc;
-	}
-
-	void capture_stop( capture_t *cap )
-	{
-		if (cap->audio) {
-			audio_capture_stop(cap->audio);
-		}
-		if (cap->video) {
-			video_capture_stop(cap->video);
-		}
-	}
-
-	int capture_detect_camera_bug( capture_t *cap, int *n )
-	{
-		*n = 0;
-		if (cap->video)
-		{
-			if (cap->video->preview_shm_queue) 
-			{
-				*n  = cap->video->preview_shm_queue->GetVideoLens();
-			}
-		} 
-		else 
-		{
-			*n = -1;
-		}
-
-		return 0;
-	}
-
-	int capture_get_last_frametime( capture_t *cap, DWORD *n )
-	{
-		*n = 0;
-		if (cap->video) 
-		{
-			if (cap->video->preview_shm_queue) 
-			{
-				*n  = cap->video->preview_shm_queue->GetLastFrameTime();
-			}
-		} 
-		else 
-		{
-			*n = 0;
-		}
-
-		return 0;
-	}
-
-	int capture_lib_init()
-	{
-		HRESULT hr = CoInitialize(NULL);
-		int rc;
-
-		{
-			HMODULE hModule = GetModuleHandleA("MSVCR100.dll");
-			if (hModule) {
-				typedef char *(*f_setlocale)(int, const char*);
-				f_setlocale f = (f_setlocale)GetProcAddress(hModule, "setlocale");
-				(*f)(LC_ALL, "chs");
-			}
-		}
-
-		if (SUCCEEDED(hr)) {
-			PaError Error;
-			Error = Pa_Initialize();
-			if (Error == paNoError) {
-				rc = videoframework_init();
-				if (rc != 0) {
-					Dbg("videoframework_init failed, rc=%d", rc);
-					return Error_Resource;
-				}
-			} else {
-				Dbg("PaInitialize failed, rc=%d", Error);
-				return Error_Resource;
-			}
-		} else {
-			Dbg("coinitialze failed! hr:%d", hr);
-			return Error_Resource;
-		}
-
-		{
-			int i, n;
-			n = videocap_get_device_count();
-			for (i = 0; i < n; ++i) {
-				WCHAR tmp[256];
-				char t[256];
-				WCHAR tmp1[256];
-				char t1[256];
-				videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-				WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-				videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-				WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-				capture_md5(t1);
-				Dbg("%d = %s;%s", i, t, t1);
-			}
-		}
-
-		{
-			int icnt, ocnt;
-			rc = audio_get_dev_count(&icnt, &ocnt);
-			if (rc == 0) {
-				int i;
-				Dbg("audio input devices(%d):", icnt);
-				for (i = 0; i < icnt; ++i) {
-					CSimpleStringA str = audio_get_dev_name(true, i);
-					Dbg("%d = %s", i, (LPCSTR)str);
-				}
-				Dbg("audio output devices(%d):", ocnt);
-				for (i = 0; i < ocnt; ++i) {
-					CSimpleStringA str = audio_get_dev_name(false, i);
-					Dbg("%d = %s", i, (LPCSTR)str);
-				}
-			}
-		}
-
-		return Error_Succeed;
-	}
-
-	void capture_lib_term()
-	{
-		videoframework_term();
-		Pa_Terminate();
-		CoUninitialize();
-	}
-
-	int capture_get_audio_device_id( bool in_direction, const char *dev_name )
-	{
-		int cnt = Pa_GetDeviceCount();
-		int ii, i;
-		for (i = 0, ii = 0; i < cnt; ++i) {
-			const PaDeviceInfo *info = Pa_GetDeviceInfo(i);
-			if (in_direction) {
-				if (info->maxInputChannels) {
-					if (strstr(info->name, dev_name) != NULL) {
-						return ii;
-					}
-					ii++;
-				}
-			} else {
-				if (info->maxOutputChannels) {
-					if (strstr(info->name, dev_name) != NULL) {
-						return ii;
-					}
-					ii++;
-				}
-			}
-		}
-		return -1;
-	}
-
-	//int capture_get_video_device_id( const char *dev_name )
-	//{
-	//	int i, n;
-	//
-	//	n = videocap_get_device_count();
-	//	for (i = 0; i < n; ++i) {
-	//		WCHAR tmp[256];
-	//		char t[256];
-	//		WCHAR tmp1[256];
-	//		char t1[256];
-	//		videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-	//		WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-	//		videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-	//		WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-	//		capture_md5(t1);
-	//		strcat(t, ";");
-	//		strcat(t, t1);
-	//		if (strcmp(dev_name, t) == 0)
-	//			return i;
-	//	}
-	//	return -1; // not found
-	//}
-
-	int capture_get_video_device_id(const char *dev_name, camera_names_t &camera)
-	{
-		int i, n;
-
-		n = videocap_get_device_count();
-		for (i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256];
-			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-			// save DevicePath (add by ly at 20160725)
-			char t2[256];
-			strcpy(t2,t1);
-			for (int j = 0; j < strlen(t2); ++j)
-			{
-				t2[j] = toupper(t2[j]);
-				if (t2[j] == '#') t2[j] = '\\';
-			}
-			capture_md5(t1);
-
-			if (dev_name != NULL && strlen(dev_name) > 1 
-				&& strstr(dev_name, ";") == NULL) // 外接摄像头 add by ly at 20160531
-			{
-				if (strstr(t2,dev_name) != NULL) // 判断外接摄像头DeviceLocationPaths是否是DevicePath的子串
-				{
-					camera.strFriendlyName = t;
-					camera.strDevPath = t2;
-					camera.strMd5Val = t1;
-					return i;
-				}
-				if (strcmp(dev_name, t) == 0) // 如果是直接用友好名称查询(适用于高拍仪) add by ly 2017/11/08
-					return i;
-			}
-			else
-			{
-				char t3[256];
-				strcpy(t3,t);
-				strcat(t3, ";");
-				strcat(t3, t1);
-				if (strcmp(dev_name, t3) == 0){
-					camera.strFriendlyName = t;
-					camera.strDevPath = t2;
-					camera.strMd5Val = t1;
-					return i;
-				}
-			}
-		}
-		return -1; // not found
-	}
-
-	bool capture_check_video_device_match( const char *dev_name, const char*dev_inst_path )
-	{
-		int i, n;
-
-		n = videocap_get_device_count();
-		for (i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256];
-			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-			// save DevicePath (add by ly at 20160725)
-			char t2[256];
-			strcpy(t2,t1);
-			for (int j = 0; j < strlen(t2); ++j)
-			{
-				t2[j] = toupper(t2[j]);
-				if (t2[j] == '#') t2[j] = '\\';
-			}
-			capture_md5(t1);
-			strcat(t, ";");
-			strcat(t, t1);
-			if (strstr(t2,dev_inst_path) != NULL)
-			{
-				Dbg("[dbg] %s founded in %d cameras.", dev_inst_path, n);
-				if (strcmp(dev_name, t) == 0)
-					return true;
-			}
-		}
-		return false; // not match
-	}
-
-	bool capture_adj_brightness( capture_t *cap,int nvalue,ErrorCodeEnum nCode )
-	{
-		HRESULT rst = S_OK;
-		if (cap->video&&(nCode!=Error_EnvCamera)&&(nCode!=Error_AllCamera))
-		{
-			rst = videocap_adj_brightness(cap->video->cap,nvalue);
-		}
-		if (SUCCEEDED(rst))
-			return true;
-		return false;
-	}
-
-	bool capture_set_autobrightness( capture_t *cap,ErrorCodeEnum nCode )
-	{
-		HRESULT rst = S_OK;
-		if (cap->video&&(nCode!=Error_EnvCamera)&&(nCode!=Error_AllCamera))
-		{
-			rst = videocap_set_autobrightness(cap->video->cap);
-		}
-		if (SUCCEEDED(rst))
-			return true;
-		return false;
-	}
-
-	int capture_get_brightness( capture_t *cap,ErrorCodeEnum nCode )
-	{
-		int nValue=0;
-		HRESULT rst = S_OK;
-		if (cap->video&&(nCode!=Error_EnvCamera)&&(nCode!=Error_AllCamera))
-		{
-			HRESULT rst = videocap_get_brightness(cap->video->cap,&nValue);
-		}
-		else
-		{
-			return -1;
-		}
-
-		if (SUCCEEDED(rst))
-		{
-			return nValue;
-		} 
-		else
-		{
-			return -1;
-		}
-	}
-
-	int stop_camera( capture_t *cap )
-	{
-		if (cap->video)
-		{
-			video_capture_stop(cap->video);
-			video_capture_destroy(cap->video);
-			cap->video = NULL;
-			return 0;
-		} 
-		else
-		{
-			return -1;
-		}
-	}
-
-	void capture_enum_cameras( std::vector<camera_names_t> &cams, CAutoArray<CSimpleStringA> &hspcams)
-	{
-		int i, n;
-		cams.clear();
-		n = videocap_get_device_count();
-		if (n <= 0) return;
-
-		int m = hspcams.GetCount();  // 高拍仪的个数
-		for (i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256],t2[256];
-			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-
-			// 检查是否为高拍仪摄像头,若是则直接枚举下一个摄像头
-			bool isHspCam = false;
-			for (int k = 0; k < m; ++k) {
-				if (!stricmp((LPCTSTR)hspcams[k],t)) {
-					isHspCam = true;
-					break;
-				}
-			}
-			if (isHspCam) {
-				continue;
-			}
-
-			camera_names_t camera;
-
-			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-
-			// save DevicePath
-			strcpy(t2,t1);
-			for (int j = 0; j < strlen(t2); ++j)
-			{
-				t2[j] = toupper(t2[j]);
-				if (t2[j] == '#') t2[j] = '\\';
-			}
-
-			capture_md5(t1);
-			camera.strFriendlyName = t;
-			camera.strDevPath = t2;
-			camera.strMd5Val = t1;
-			cams.push_back(camera);
-		}
-	}
-
-	void capture_md5( char *dev_path )
-	{
-		if (dev_path&&strlen(dev_path)>0)
-		{
-			unsigned char x[MD5_DIGESTSIZE];
-			md5_ctx_t ctx;
-			md5_init(&ctx);
-			md5(x, dev_path, strlen(dev_path));
-			Bin2Str(x, sizeof(x), dev_path, strlen(dev_path));
-		}
-	}
-
-	bool capture_get_only_video_device_by_friendlyname(const CSimpleStringA friendlyname, 
-		CAutoArray<CSimpleStringA> &excludecams, const CAutoArray<CSimpleStringA> &hspcams, camera_names_t &camera)
-	{
-		int i, n;
-		n = videocap_get_device_count();
-		if (n <= 0) return false;
-
-		int cnt = 0;
-		int m = hspcams.GetCount();  // 高拍仪的个数
-		for (i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256], t2[256];
-			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-
-			Dbg("[capture_get_only_video_device_by_friendlyname]%d, %s excludecams:%d.", i, t, excludecams.GetCount());
-			
-			// 检查是否为高拍仪摄像头,若是则直接枚举下一个摄像头
-			bool isHspCam = false;
-			for (int k = 0; k < m; ++k) {
-				if (!stricmp((LPCTSTR)hspcams[k], t)) {
-					isHspCam = true;
-					break;
-				}
-			}
-			if (isHspCam) {
-				Dbg("[get_only_video_device_by_friendlyname]%d, %s isHspCam.", i, t);
-				continue;
-			}
-
-			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-
-			// save DevicePath
-			strcpy(t2, t1);
-			for (int j = 0; j < strlen(t2); ++j)
-			{
-				t2[j] = toupper(t2[j]);
-				if (t2[j] == '#') t2[j] = '\\';
-			}
-			capture_md5(t1);
-
-			// 检查是否为排除摄像头,若是则直接枚举下一个摄像头
-			bool isExcludeCam = false;
-			for (int k = 0; k < excludecams.GetCount(); ++k) {
-				if (!strcmp((LPCTSTR)excludecams[k], t1)) {
-					isExcludeCam = true;
-					break;
-				}
-			}
-			if (isExcludeCam) {
-				Dbg("[get_only_video_device_by_friendlyname]%d, %s Md5:%s isExcludeCam.", i, t, t1);
-				continue;
-			}
-			
-			if (strcmp((LPCTSTR)friendlyname, t) == 0)
-			{
-				if (0 == cnt)
-				{
-					camera.strFriendlyName = t;
-					camera.strDevPath = t2;
-					camera.strMd5Val = t1;
-				}
-				cnt++;
-				Dbg("[get_only_video_device_by_friendlyname]%d, %s Md5:%s DevPath:%s isFoundCam.", i, t, t1, t2);
-			}
-		}
-		if (1 != cnt) // 未找到唯一摄像头
-		{
-			camera.strFriendlyName = "$";
-			camera.strDevPath = "$";
-			camera.strMd5Val = "$";
-			return false; // not found
-		}
-		return true;
-	}
-
-	bool capture_get_only_video_device(CAutoArray<CSimpleStringA> &excludecams, const CAutoArray<CSimpleStringA> &hspcams, camera_names_t &camera)
-	{
-		int i, n;
-		n = videocap_get_device_count();
-		if (n <= 0) return false;
-
-		int cnt = 0;
-		int m = hspcams.GetCount();  // 高拍仪的个数
-		for (i = 0; i < n; ++i) {
-			WCHAR tmp[256];
-			char t[256];
-			WCHAR tmp1[256];
-			char t1[256], t2[256];
-			videocap_get_device_name(i, tmp, ARRAYSIZE(tmp));
-			WideCharToMultiByte(CP_ACP, 0, tmp, -1, t, sizeof(t), 0, NULL);
-
-			Dbg("[capture_get_only_video_device]%d, %s excludecams:%d.", i, t, excludecams.GetCount());
-			
-			// 检查是否为高拍仪摄像头,若是则直接枚举下一个摄像头
-			bool isHspCam = false;
-			for (int k = 0; k < m; ++k) {
-				if (!stricmp((LPCTSTR)hspcams[k], t)) {
-					isHspCam = true;
-					break;
-				}
-			}
-			if (isHspCam) {
-				Dbg("[capture_get_only_video_device]%d, %s isHspCam.", i, t);
-				continue;
-			}
-
-			videocap_get_device_path(i, tmp1, ARRAYSIZE(tmp1));
-			WideCharToMultiByte(CP_ACP, 0, tmp1, -1, t1, sizeof(t1), 0, NULL);
-
-			// save DevicePath
-			strcpy(t2, t1);
-			for (int j = 0; j < strlen(t2); ++j)
-			{
-				t2[j] = toupper(t2[j]);
-				if (t2[j] == '#') t2[j] = '\\';
-			}
-			capture_md5(t1);
-
-			// 检查是否为排除摄像头,若是则直接枚举下一个摄像头
-			bool isExcludeCam = false;
-			for (int k = 0; k < excludecams.GetCount(); ++k) {
-				if (!strcmp((LPCTSTR)excludecams[k], t1)) {
-					isExcludeCam = true;
-					break;
-				}
-			}
-			if (isExcludeCam) {
-				Dbg("[capture_get_only_video_device]%d, %s Md5:%s isExcludeCam.", i, t, t1);
-				continue;
-			}
-
-			if (0 == cnt)
-			{
-				camera.strFriendlyName = t;
-				camera.strDevPath = t2;
-				camera.strMd5Val = t1;
-			}
-			cnt++;	
-			Dbg("[capture_get_only_video_device]%d, %s Md5:%s DevPath:%s isFoundCam.", i, t, t1, t2);
-		}
-		if (1 != cnt) // 未找到唯一摄像头
-		{
-			camera.strFriendlyName = "$";
-			camera.strDevPath = "$";
-			camera.strMd5Val = "$";
-			return false; // not found
-		}
-		return true;
-	}
-
-
-}

+ 0 - 99
Module/mod_CameraConfigManage/win/Capture.h

@@ -1,99 +0,0 @@
-#pragma once
-
-#include "SpBase.h"
-#include <portaudio.h>
-#include "EventCode.h"
-#include "videoframework.h"
-#include "libaudioqueue.h"
-#include "libvideoqueue.h"
-#include <vector>
-
-#ifndef INT64_C
-#define INT64_C(c) (c##LL) 
-#define UINT64_C(c) (c##UL) 
-#endif
-
-#include <stdint.h>
-extern "C"
-{
-#include <libavutil\avutil.h>
-#include <libavcodec\avcodec.h>
-#include <libswscale\swscale.h>
-}
-#include "video_common/ffmpeg_api_cpp_adapter.h"
-
-// define struct and method for echo camera
-
-
-namespace CameraConfigManage {
-	typedef struct capture_t capture_t;
-
-	typedef struct {
-		int video_dev; // -1 means invalid
-		int video_rotate; // counter-clockwise degree, ignore currently
-		CSimpleStringA strAudioIn; // input audio
-		CSimpleStringA strVideo;
-		volatile LONG *ref_capture_count;
-	}capture_config_t;
-
-
-	typedef struct
-	{
-		CSimpleStringA strFriendlyName;
-		CSimpleStringA strDevPath;
-		CSimpleStringA strMd5Val;
-	}camera_names_t;
-
-#define CAPTURE_FRAME_TIME	20 // 20ms per frame
-#define CAPTURE_CLOCK		8000
-
-	extern DeviceTypeEnum g_eDeviceType;
-
-	typedef struct audio_capture_t {
-		PaStream *stream;
-		Clibaudioqueue *shm_queue;
-		capture_t *parent;
-	}audio_capture_t;
-
-	typedef struct video_capture_t {
-		videocap_t cap;
-		Clibvideoqueue *preview_shm_queue;
-		capture_t *parent;
-		int camera_type; // CAMERA_TYPE_xxx
-		int frame_id;
-		struct SwsContext *preview_sws_ctx;
-	}video_capture_t;
-
-	struct capture_t
-	{
-		capture_config_t config;
-		audio_capture_t *audio;
-		video_capture_t *video;
-	};
-
-
-	int capture_create(const capture_config_t *config, capture_t **p_cap);
-	ErrorCodeEnum capture_create(const capture_config_t *config,capture_t *cap);
-	void capture_destroy(capture_t *cap);
-	ErrorCodeEnum capture_start(capture_t *cap);
-	void capture_stop(capture_t *cap);
-	int capture_detect_camera_bug(capture_t *cap, int *n);
-	int capture_get_last_frametime(capture_t *cap, DWORD *n);
-
-	int capture_lib_init();
-	void capture_lib_term();
-	int capture_get_audio_device_id(bool in_direction, const char *dev_name);
-	//int capture_get_video_device_id(const char *dev_name);
-	int capture_get_video_device_id(const char *dev_name, camera_names_t &camera);
-	// 检查摄像头插入事件通知的摄像头deviceinstpath是否与广角摄像头的匹配,若匹配返回true,否则返回false
-	bool capture_check_video_device_match(const char *dev_name, const char*dev_inst_path);
-	bool capture_adj_brightness(capture_t *cap,int nvalue,ErrorCodeEnum nCode);
-	bool capture_set_autobrightness(capture_t *cap,ErrorCodeEnum nCode);
-	int capture_get_brightness(capture_t *cap,ErrorCodeEnum nCode);
-	int stop_camera(capture_t *cap);
-	void capture_enum_cameras(std::vector<camera_names_t> &cams, CAutoArray<CSimpleStringA> &hspcams);
-	void capture_md5(char *dev_path);
-	bool capture_get_only_video_device_by_friendlyname(const CSimpleStringA friendlyname,
-		CAutoArray<CSimpleStringA> &excludecams, const CAutoArray<CSimpleStringA> &hspcams, camera_names_t &camera);
-	bool capture_get_only_video_device(CAutoArray<CSimpleStringA> &excludecams, const CAutoArray<CSimpleStringA> &hspcams, camera_names_t &camera);
-}

+ 0 - 1
Module/mod_DeviceControl/CMakeLists.txt

@@ -24,7 +24,6 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
 target_include_directories(${MODULE_NAME} PRIVATE 
 ${CMAKE_CURRENT_SOURCE_DIR}
 ${MODULE_BASE_DIR}/mod_CenterSetting
-${MODULE_BASE_DIR}/mod_CameraConfigManage
 )
 
 deploy_module(${MODULE_PREFIX} ${MODULE_NAME})

+ 0 - 1
Module/mod_chromium/mod_chromium.cpp

@@ -31,7 +31,6 @@
 #include <gperftools/profiler.h>
 #endif // OPEN_PERF
 #include <boost/date_time/posix_time/posix_time.hpp>
-//#include "../mod_CameraConfigManage/Event.h"
 #include "../mod_ResourceWatcher/ResourceWatcher_msg_g.h"
 #include "CommEntityUtil.hpp"
 

+ 0 - 1
Module/mod_healthmanager/CMakeLists.txt

@@ -40,7 +40,6 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${MODULE_BASE_DIR}/mod_Initializer
 	${MODULE_BASE_DIR}/mod_accessauth
 	${MODULE_BASE_DIR}/mod_pinpad
-	${MODULE_BASE_DIR}/mod_CameraConfigManage #for header file
 	${MODULE_BASE_DIR}/mod_chromium
 	${MODULE_BASE_DIR}/mod_ResourceWatcher
 	${OTHER_LIB_BASE_DIR}/libRestfulFunc

+ 1 - 1
addin/cfg/shell.ini.in

@@ -43,7 +43,7 @@ ScannerSet=0,@LIB_PREFIX@mod_ScannerSet@LIB_SUFFIX@,0x218
 SurveillanceRecorder=0,@LIB_PREFIX@mod_SurveillanceRecorder@LIB_SUFFIX@,0x21A
 CardReadAdapter=0,@LIB_PREFIX@mod_CardReadAdapter@LIB_SUFFIX@,0x21B
 PortableScanner=0,@LIB_PREFIX@mod_PortableScanner@LIB_SUFFIX@,0x21C
-CameraConfigManage=0,@LIB_PREFIX@mod_CameraConfigManage@LIB_SUFFIX@,0x21D
+;CameraConfigManage=0,@LIB_PREFIX@mod_CameraConfigManage@LIB_SUFFIX@,0x21D
 ;Sensors=0,@LIB_PREFIX@mod_sensors@LIB_SUFFIX@,0x21E
 
 SIPPhone=0,@LIB_PREFIX@mod_sipphone@LIB_SUFFIX@,0x301