|
@@ -31,7 +31,7 @@ static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
|
|
|
CMediaControllerEntity::CMediaControllerEntity(): m_capture(NULL), m_salesaudio_capture(NULL), m_lCaptureEnvCount(0), m_nCameraErrorCode(Error_Succeed),
|
|
|
m_lCaptureEnvOptCount(0), m_lCaptureOptCount(0), m_iEnvEmptyTimes(0), m_iOptEmptyTimes(0), m_bSendCameraError(false),
|
|
|
m_nEnvCameraRestartNum(0), m_nOptCameraRestartNum(0), m_nCameraCount(2), m_pSelfcheckClient(NULL),
|
|
|
-strFrontCam("$"), strRearCam("$"), strEnvCam("$"), strUSBCam("$"), strEwsCam("$"), m_bCustomerwareBegin(false),
|
|
|
+strFrontCam("$"), strRearCam("$"), strEnvCam("$"), strUSBCam("$"), m_bCustomerwareBegin(false),
|
|
|
m_bRecordPCM(false), m_bIsRemoteRecord(false), m_bHasStartSpeakerRender(false), m_bConnectedAssist(FALSE){
|
|
|
|
|
|
#ifdef RVC_OS_LINUX
|
|
@@ -645,8 +645,8 @@ void CMediaControllerEntity::OnTimeout(DWORD dwTimerID)
|
|
|
|
|
|
void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
{
|
|
|
- int env_n, opt_n;
|
|
|
- DWORD nLastEnvTime, nLastOptTime;
|
|
|
+ int env_n = -1, opt_n = -1;
|
|
|
+ unsigned int nLastEnvTime = 0, nLastOptTime = 0;
|
|
|
bool bEnvTimeout = false;
|
|
|
bool bOptTimeout = false;
|
|
|
|
|
@@ -691,15 +691,21 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change env camera from bEnvTimeout to OK");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//env是否30S没有图像或者图像20秒没有更新
|
|
|
if(((m_iEnvEmptyTimes == CAMERA_BUG_THRESHOLD)||bEnvTimeout)&&(m_nCameraErrorCode!=Error_EnvCamera)&&(m_nCameraErrorCode!=Error_AllCamera))
|
|
|
{
|
|
|
char strMessage[MAX_PATH*2] = {0};
|
|
|
get_camera_exception_message(strMessage, MAX_PATH*2, conf.strVideoEnv, "Env camera bug detected!");
|
|
|
char strInfo[MAX_PATH*2] = {0};
|
|
|
- snprintf(strInfo, MAX_PATH*2, "%s and current time = %u, env last capture time = %u, video queue LastEnvTime = %u.",strMessage, y2k_time_now(), m_capture->env_video->ulastcaptime, nLastEnvTime);
|
|
|
+ if ((NULL != m_capture) && (NULL != m_capture->env_video)) {
|
|
|
+ snprintf(strInfo, MAX_PATH * 2, "%s and current time = %u, env last capture time = %u, video queue LastEnvTime = %u.", strMessage, y2k_time_now(), m_capture->env_video->ulastcaptime, nLastEnvTime);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ snprintf(strInfo, MAX_PATH * 2, "%s", strMessage);
|
|
|
+ }
|
|
|
+
|
|
|
LogWarn(Severity_Middle, Error_Hardware, ERROR_MOD_MEDIACONTROLLER_ENVCAMERA_BUG, strInfo);
|
|
|
-
|
|
|
if ((ePadtype == m_eDeviceType)||(eMobilePadType == m_eDeviceType)||(eDesk2SType == m_eDeviceType)||(eDesk1SType == m_eDeviceType)||(eDesk2SIntegratedType == m_eDeviceType))
|
|
|
{
|
|
|
m_nCameraErrorCode = Error_AllCamera;
|
|
@@ -786,13 +792,20 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("change opt camera from bOptTimeout to OK");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
//opt是否100S没有图像或者图像20秒没有更新
|
|
|
if(((m_iOptEmptyTimes == CAMERA_BUG_THRESHOLD)||bOptTimeout)&&(m_nCameraErrorCode!=Error_OptCamera)&&(m_nCameraErrorCode!=Error_AllCamera)&&(eStand2sType == m_eDeviceType))
|
|
|
{
|
|
|
char strMessage[MAX_PATH*2] = {0};
|
|
|
get_camera_exception_message(strMessage, MAX_PATH*2, conf.strVideoOpt, "Opt camera bug detected!");
|
|
|
char strInfo[MAX_PATH*2] = {0};
|
|
|
- _snprintf(strInfo, MAX_PATH*2, "%s and current time = %u, opt last capture time = %u, video queue LastOptTime = %u.",strMessage, y2k_time_now(), m_capture->opt_video->ulastcaptime, nLastOptTime);
|
|
|
+ if (NULL != m_capture && NULL != m_capture->opt_video) {
|
|
|
+ snprintf(strInfo, MAX_PATH * 2, "%s and current time = %u, opt last capture time = %u, video queue LastOptTime = %u.", strMessage, y2k_time_now(), m_capture->opt_video->ulastcaptime, nLastOptTime);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ snprintf(strInfo, MAX_PATH * 2, "%s.", strMessage);
|
|
|
+ }
|
|
|
+
|
|
|
LogWarn(Severity_Middle, Error_Hardware, ERROR_MOD_MEDIACONTROLLER_OPECAMERA_BUG, strInfo);
|
|
|
if (m_nCameraErrorCode == Error_Succeed)
|
|
|
{
|
|
@@ -1214,7 +1227,6 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
|
|
|
CSmartPointer<IEntityFunction> spFunction = GetFunction();
|
|
|
CSmartPointer<IConfigInfo> spConfig;
|
|
|
SpIniMappingTable table;
|
|
|
- strEwsCam = "$";
|
|
|
ErrorCodeEnum Error = spFunction->OpenConfig(Config_Root, spConfig);
|
|
|
if (Error == Error_Succeed) {
|
|
|
int imtu = 0;
|
|
@@ -1222,7 +1234,6 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
|
|
|
table.AddEntryString("Audio", "handfree_out_dev", conf->strAudioOut, "$");
|
|
|
table.AddEntryString("Video", "EnvCamera", conf->strVideoEnv, "$");
|
|
|
table.AddEntryString("Video", "OptCamera", conf->strVideoOpt, "$");
|
|
|
- table.AddEntryString("Video", "EwsCamera", strEwsCam, "$");
|
|
|
table.AddEntryInt("Video", "EnvRotate", conf->video_env_rotate, 0);
|
|
|
table.AddEntryInt("Video", "OptRotate", conf->video_opt_rotate, 0);
|
|
|
table.AddEntryInt("Video", "EnvFps", conf->video_env_fps, 0);
|