|
@@ -65,7 +65,9 @@ void CMediaControllerEntity::OnSysVarEvent(const char *pszKey, const char *pszVa
|
|
|
}
|
|
|
else if (_stricmp(pszKey, SYSVAR_CALLSTATE) == 0)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sys call state from: %c to %c", pszOldValue[0], pszValue[0]);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sys call state from: %c to %c", pszOldValue[0], pszValue[0]);\
|
|
|
+ CSimpleStringA strState;
|
|
|
+ auto err = GetFunction()->GetSysVar("UIState", strState);
|
|
|
if ('C' == pszValue[0]) {
|
|
|
if (1 == m_iCamOnMode) {
|
|
|
if (!m_bStartCamera) {
|
|
@@ -75,18 +77,29 @@ void CMediaControllerEntity::OnSysVarEvent(const char *pszKey, const char *pszVa
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- GetFunction()->KillTimer(3);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("KillTimer.");
|
|
|
+ if ("M" == strState) {
|
|
|
+ if (Error_Succeed == GetFunction()->KillTimer(3)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("KillTimer 3 success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_MEDIACONTROLLER_KILLTIMER_ERROR, "Call State is Connecting, and UIState is M, KillTimer 3 failed.");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else if ('O' == pszValue[0]){
|
|
|
if (1 == m_iCamOnMode) {
|
|
|
- GetFunction()->SetTimer(3, this, m_iDelayTime * 1000);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetTimer.");
|
|
|
+ if ("M" == strState) {
|
|
|
+ if (Error_Succeed == GetFunction()->SetTimer(3, this, m_iDelayTime * 1000)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("SetTimer 3 success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_MEDIACONTROLLER_SETTIMER_ERROR, "Call State is OffLine, and UIState is M, SetTimer 3 failed.");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -613,8 +626,12 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
|
|
|
m_capture = NULL;
|
|
|
}
|
|
|
m_bStartCamera = FALSE;
|
|
|
- GetFunction()->KillTimer(3);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("KillTimer.");
|
|
|
+ if (Error_Succeed == GetFunction()->KillTimer(3)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Stop Camera, KillTimer 3 success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_MEDIACONTROLLER_KILLTIMER_ERROR, "Stop Camera, KillTimer 3 failed.");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1380,8 +1397,12 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- GetFunction()->KillTimer(3);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("KillTimer.");
|
|
|
+ if (Error_Succeed == GetFunction()->KillTimer(3)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("begin handle business, and camera is already on, KillTimer 3 success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_MEDIACONTROLLER_KILLTIMER_ERROR, "begin handle business, and camera is already on, KillTimer 3 failed.");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
@@ -1389,8 +1410,12 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
|
|
|
case LOG_EVT_END_HANDLE_BUSINESS:
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("end handle business.");
|
|
|
if (1 == m_iCamOnMode) {
|
|
|
- GetFunction()->SetTimer(3, this, m_iDelayTime*1000);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("SetTimer.");
|
|
|
+ if (Error_Succeed == GetFunction()->SetTimer(3, this, m_iDelayTime * 1000)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("end handle business, SetTimer 3 success.");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_EVT_MEDIACONTROLLER_SETTIMER_ERROR, "end handle business, SetTimer 3 failed.");
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
|