Explorar el Código

Z991239-5559 #comment 优化摄像头状态设置逻辑

80274480 hace 1 año
padre
commit
59bce73595

+ 1 - 6
Module/mod_mediacontroller/Event.h

@@ -82,17 +82,12 @@
 
 //sysvar
 #define SYSVAR_CAMERASTATE	"CameraState"
+#define CAMERA_STATE_INIT	"X"
 #define CAMERA_NO_ERROR		"N"
 #define CAMERA_ENV_ERROR	"E"
 #define CAMERA_OPT_ERROR	"O"
 #define CAMERA_BOTH_ERROR	"B"
 
-//sysvar
-#define SYSVAR_CAMERACONFIG	"CameraConfigRet"
-#define CAMERACONFIG_INIT	"X"
-#define CAMERACONFIG_TRUE	"T"
-#define CAMERACONFIG_FALSE	"F"
-
 
 #define EVENT_MOD_CUSTOMERAWARE_BEGIN						0x30830001	//客户感知进入
 #define EVENT_MOD_CUSTOMERAWARE_END							0x30830002	//客户感知退出

+ 2 - 12
Module/mod_mediacontroller/mod_mediacontroller.cpp

@@ -186,7 +186,7 @@ void CMediaControllerEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmar
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("register sysvar %s failed!", SYSVAR_CALLSTATE);
 	}
 
-	SetCameraConfigSysVar(CAMERACONFIG_INIT);
+	SetCameraSysVar(CAMERA_STATE_INIT);
 
 	int i = 0;
 
@@ -273,7 +273,6 @@ void CMediaControllerEntity::OnStarted()
 					DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Camera State to CAMERA_OPT_ERROR");
 					m_nCameraErrorCode = Error_OptCamera;
 				}
-				SetCameraConfigSysVar(CAMERACONFIG_FALSE);
 			}
 			else
 			{
@@ -285,11 +284,10 @@ void CMediaControllerEntity::OnStarted()
 					m_nCameraErrorCode = Error_AllCamera;
 				}
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Load Config failed!");
-				SetCameraConfigSysVar(CAMERACONFIG_FALSE);
 			}
 		}
 		else {
-			SetCameraConfigSysVar(CAMERACONFIG_TRUE);
+			SetCameraSysVar(CAMERA_NO_ERROR);
 		}
 	}
 	else{
@@ -470,14 +468,6 @@ ErrorCodeEnum CMediaControllerEntity::SetCameraSysVar(const CSimpleStringA &newV
 	return spFunction->SetSysVar(SYSVAR_CAMERASTATE, newVal.GetData());
 }
 
-
-ErrorCodeEnum CMediaControllerEntity::SetCameraConfigSysVar(const CSimpleStringA& newVal)
-{
-	CSmartPointer<IEntityFunction> spFunction = this->GetFunction();
-
-	return spFunction->SetSysVar(SYSVAR_CAMERACONFIG, newVal.GetData());
-}
-
 void CMediaControllerEntity::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext) 
 { 
 	CSmartPointer<IEntityFunction> spFunction = GetFunction();

+ 0 - 1
Module/mod_mediacontroller/mod_mediacontroller.h

@@ -122,7 +122,6 @@ public:
 	void OnTimeCameraStatusCheck();
 	ErrorCodeEnum ConnectAssistChannel();
 	void LogTransactionRecordCtrEvt(int iEvtType);
-	ErrorCodeEnum SetCameraConfigSysVar(const CSimpleStringA& newVal);
 
 public:
 	DeviceTypeEnum m_eDeviceType;