|
@@ -616,11 +616,30 @@ void CMediaControllerEntity::OnTimeHandfreeMicroStatusCheck()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ int audioin_n = -1;
|
|
|
unsigned int nHandfreeinAudioTime = 0;
|
|
|
+ static int iAudioInEmptyTimes = 0;
|
|
|
|
|
|
+ capture_detect_audioin_bug(m_capture, &audioin_n);
|
|
|
capture_get_last_audio_frametime(m_capture, &nHandfreeinAudioTime);
|
|
|
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("======last audio time is %d.======", nHandfreeinAudioTime);
|
|
|
+
|
|
|
+ if (audioin_n == 0) {
|
|
|
+ if (iAudioInEmptyTimes < AUDIO_BUG_THRESHOLD) {
|
|
|
+ iAudioInEmptyTimes++;
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get handfree in audio fail, times=%d.", iAudioInEmptyTimes);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (audioin_n == -1) {
|
|
|
+ iAudioInEmptyTimes = AUDIO_BUG_THRESHOLD;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (iAudioInEmptyTimes == AUDIO_BUG_THRESHOLD) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("handfree in get audio success again.");
|
|
|
+ }
|
|
|
+ iAudioInEmptyTimes = 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
@@ -642,7 +661,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
if (env_n == 0) {
|
|
|
if (iEnvEmptyTimes < CAMERA_BUG_THRESHOLD){
|
|
|
iEnvEmptyTimes++;
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get env camera picture fail, times=%d.",iEnvEmptyTimes);
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get env camera picture fail, times=%d.", iEnvEmptyTimes);
|
|
|
}
|
|
|
}
|
|
|
else if (env_n == -1){
|
|
@@ -671,7 +690,7 @@ void CMediaControllerEntity::OnTimeCameraStatusCheck()
|
|
|
}
|
|
|
|
|
|
//env是否30S没有图像或者图像15秒没有更新
|
|
|
- if(((iEnvEmptyTimes == CAMERA_BUG_THRESHOLD)||bEnvTimeout)&&(m_nCameraErrorCode!=Error_EnvCamera)&&(m_nCameraErrorCode!=Error_AllCamera))
|
|
|
+ if(((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!");
|
|
@@ -1365,12 +1384,12 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
|
|
|
Error = CheckConfigCameraName(conf, m_eDeviceType);
|
|
|
if (Error == Error_EnvCamera){
|
|
|
char strMessage[MAX_PATH*2] = {0};
|
|
|
- get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoEnv ,"env camera config error,please check config file or device.");
|
|
|
+ get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoEnv ,"env camera config error, please check config file or device.");
|
|
|
LogWarn(Severity_Middle,Error_DevMedia,ERROR_MOD_MEDIACONTROLLER_ENVCAM_INITFAIL,strMessage);
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2801")("上摄像头配置错误,请检查摄像头配置");
|
|
|
} else if (Error == Error_OptCamera){
|
|
|
char strMessage[MAX_PATH*2] = {0};
|
|
|
- get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoOpt, "operation camera config error,please check config file or device.");
|
|
|
+ get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoOpt, "operation camera config error, please check config file or device.");
|
|
|
LogWarn(Severity_Middle,Error_DevMedia,ERROR_MOD_MEDIACONTROLLER_OPTCAM_INITFAIL, strMessage);
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402208V2").setResultCode("RTA2802")("下摄像头配置错误,请检查摄像头配置");
|
|
|
}
|
|
@@ -1394,21 +1413,6 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
|
|
|
}
|
|
|
|
|
|
|
|
|
-void CMediaControllerEntity::OnExternalCameraSwitchFailed(const char* pszFailedMsg)
|
|
|
-{
|
|
|
- CSmartPointer<IEntityFunction> Func = GetFunction();
|
|
|
- CSimpleStringA strValue;
|
|
|
- Func->GetSysVar("DesktopType", strValue);
|
|
|
- if (strValue == CSimpleStringA("U")) {
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- MessageBoxA(NULL, pszFailedMsg, NULL, MB_SYSTEMMODAL);
|
|
|
-#else
|
|
|
-
|
|
|
-#endif // RVC_OS_WIN
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
#ifdef DEVOPS_ON_PRD
|
|
|
#else
|
|
|
#ifdef RVC_OS_WIN
|
|
@@ -1596,8 +1600,6 @@ void CMediaControllerEntity::OnLog( const CAutoArray<CUUID> &SubIDs, const CUUID
|
|
|
|
|
|
case LOG_EVT_UI_RECORDFAILED:
|
|
|
{
|
|
|
- OnExternalCameraSwitchFailed(pszMessage);
|
|
|
-
|
|
|
GetFunction()->KillTimer(RVC_MEDIADEV_STATUS_CHECK_TIMER);
|
|
|
if (m_bIsRemoteRecord){
|
|
|
LogEvent(Severity_Middle, LOG_EVT_UI_STOPREMOTERECORD, NULL);
|
|
@@ -2268,11 +2270,9 @@ void CMediaControllerEntity::GetCameraBrightness(SpReqAnsContext<MediaService_Ge
|
|
|
else {
|
|
|
ctx->Ans.result = -1;
|
|
|
if (0 == ctx->Req.icameraid) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280D").setAPI(__FUNCTION__)("上摄像头故障,请联系厂商排查");
|
|
|
ctx->Answer(Error_EnvCamera, LOG_WARN_ENVCAMERA_ERROR);
|
|
|
}
|
|
|
else if (1 == ctx->Req.icameraid) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280E").setAPI(__FUNCTION__)("下摄像头故障,请联系厂商排查");
|
|
|
ctx->Answer(Error_OptCamera, LOG_WARN_OPTCAMERA_ERROR);
|
|
|
}
|
|
|
}
|
|
@@ -2288,11 +2288,9 @@ void CMediaControllerEntity::SetCameraBrightness(SpReqAnsContext<MediaService_Se
|
|
|
else {
|
|
|
ctx->Ans.result = -1;
|
|
|
if (0 == ctx->Req.icameraid) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280D").setAPI(__FUNCTION__)("上摄像头故障,请联系厂商排查");
|
|
|
ctx->Answer(Error_EnvCamera, LOG_WARN_ENVCAMERA_ERROR);
|
|
|
}
|
|
|
else if (1 == ctx->Req.icameraid) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA280E").setAPI(__FUNCTION__)("下摄像头故障,请联系厂商排查");
|
|
|
ctx->Answer(Error_OptCamera, LOG_WARN_OPTCAMERA_ERROR);
|
|
|
}
|
|
|
}
|
|
@@ -2633,10 +2631,8 @@ void MediaServiceSession::Handle_TurnOnCamera(SpReqAnsContext<MediaService_TurnO
|
|
|
}
|
|
|
else {
|
|
|
ctx->Ans.result = -3;
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2808").setAPI(__FUNCTION__)("摄像头故障,请联系厂商排查");
|
|
|
ctx->Answer(Error_AllCamera, LOG_WARN_ALLCAMERA_ERRORS);
|
|
|
}
|
|
|
- //DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Error = %d, CameraErrorCode = %d, result = %d.", Error, CameraErrorCode, ctx->Ans.result);
|
|
|
}
|
|
|
|
|
|
void MediaServiceSession::Handle_TurnOffCamera(SpReqAnsContext<MediaService_TurnOffCamera_Req, MediaService_TurnOffCamera_Ans>::Pointer ctx)
|