|
|
@@ -1070,18 +1070,16 @@ ErrorCodeEnum CMediaControllerEntity::LoadRunConfig(CSimpleStringA& frontcam, CS
|
|
|
}
|
|
|
|
|
|
|
|
|
-ErrorCodeEnum CMediaControllerEntity::CheckConfigCameraName(capture_config_t *conf)
|
|
|
+ErrorCodeEnum CMediaControllerEntity::CheckConfigCameraName(capture_config_t *conf, DeviceTypeEnum eType)
|
|
|
{
|
|
|
ErrorCodeEnum Error = Error_Succeed;
|
|
|
int EnvConfigNameError = 0; //0:环境摄像头配置名能成功打开 -1:环境摄像头配置名不能打开 1:未配置环境摄像头名字
|
|
|
int OptConfigNameError = 0; //0:操作摄像头配置名能成功打开 -1:操作摄像头配置名不能打开 1:未配置操作摄像头名字
|
|
|
|
|
|
//check env device
|
|
|
- if (conf->strVideoEnv.GetLength() > 1)
|
|
|
- { // is not "$"
|
|
|
+ if (conf->strVideoEnv.GetLength() > 1){ // is not "$"
|
|
|
conf->video_env_dev = capture_get_video_device_id(conf->strVideoEnv.GetData());
|
|
|
- if (conf->video_env_dev == -1)
|
|
|
- {
|
|
|
+ if (conf->video_env_dev == -1) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("find strVideoEnv:%s(-1)",(LPCTSTR)conf->strVideoEnv);
|
|
|
EnvConfigNameError = -1;
|
|
|
}
|
|
|
@@ -1090,52 +1088,39 @@ ErrorCodeEnum CMediaControllerEntity::CheckConfigCameraName(capture_config_t *co
|
|
|
conf->video_env_dev = -1;
|
|
|
EnvConfigNameError = 1;
|
|
|
}
|
|
|
+
|
|
|
//check opt device
|
|
|
- if (conf->strVideoOpt.GetLength() > 1)
|
|
|
- { // is not "$"
|
|
|
+ if (conf->strVideoOpt.GetLength() > 1) { // is not "$"
|
|
|
conf->video_opt_dev = capture_get_video_device_id(conf->strVideoOpt.GetData());
|
|
|
- if (conf->video_opt_dev == -1)
|
|
|
- {
|
|
|
+ if (conf->video_opt_dev == -1) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("find strVideoOpt:%s(-1)",(LPCTSTR)conf->strVideoOpt);
|
|
|
OptConfigNameError = -1;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
conf->video_opt_dev = -1;
|
|
|
OptConfigNameError = 1;
|
|
|
}
|
|
|
|
|
|
- //环境摄像头配置名不能打开
|
|
|
- if (EnvConfigNameError == -1){
|
|
|
- //操作摄像头配置名不能打开,此时表明摄像头都不可用
|
|
|
- if(OptConfigNameError == -1){
|
|
|
- Error = Error_AllCamera;
|
|
|
- }
|
|
|
- //未配置操作摄像头名字or操作摄像头配置名能打开,此时表明只有操作摄像头OK
|
|
|
- else{
|
|
|
- Error = Error_EnvCamera;
|
|
|
- }
|
|
|
- }
|
|
|
- //环境摄像头配置名能打开
|
|
|
- else if (EnvConfigNameError == 0){
|
|
|
- //操作摄像头配置名不能打开,此时表明只有环境摄像头OK
|
|
|
- if (OptConfigNameError == -1){
|
|
|
- Error = Error_OptCamera;
|
|
|
- }
|
|
|
- //环境摄像头配置名能打开,未配置操作摄像头名字,此时也认为摄像头都OK(无操作摄像头场景)
|
|
|
- }
|
|
|
- //环境摄像头未配置
|
|
|
- else {
|
|
|
- //操作摄像头配置名不能打开,此时表明只有操作摄像头OK
|
|
|
- if(OptConfigNameError == -1){
|
|
|
- Error = Error_OptCamera;
|
|
|
+ if (eStand2sType == eType) {
|
|
|
+ //配置的环境摄像头能识别到
|
|
|
+ if (0 == EnvConfigNameError) {
|
|
|
+ //配置的操作摄像头识别不到or未配置操作摄像头,此时表明只有环境摄像头OK
|
|
|
+ if (0 != OptConfigNameError) {
|
|
|
+ Error = Error_OptCamera;
|
|
|
+ }
|
|
|
}
|
|
|
- //操作摄像头未配置,此时表明摄像头都不可用
|
|
|
- else if (OptConfigNameError == 1){
|
|
|
- Error = Error_AllCamera;
|
|
|
+ //配置的环境摄像头识别不到or未配置环境摄像头
|
|
|
+ else {
|
|
|
+ //配置的操作摄像头识别不到or未配置操作摄像头,此时表明摄像头都不可用
|
|
|
+ if (0 != OptConfigNameError) {
|
|
|
+ Error = Error_AllCamera;
|
|
|
+ }
|
|
|
+ //操作摄像头配置名能打开,此时表明只有操作摄像头OK
|
|
|
+ else {
|
|
|
+ Error = Error_EnvCamera;
|
|
|
+ }
|
|
|
}
|
|
|
- //操作摄像头名字能打开,此时也认为摄像头都OK(无环境摄像头场景)
|
|
|
}
|
|
|
|
|
|
return Error;
|
|
|
@@ -1255,7 +1240,7 @@ ErrorCodeEnum CMediaControllerEntity::LoadConfig(capture_config_t *conf)
|
|
|
else {
|
|
|
LogWarn(Severity_Low, Error_Debug, ERROR_MOD_MEDIACONTROLLER_VIDEO_AUTO_MATHED_FAILED, strInfo);
|
|
|
}
|
|
|
- Error = CheckConfigCameraName(conf);
|
|
|
+ Error = CheckConfigCameraName(conf, m_eDeviceType);
|
|
|
if (Error == Error_EnvCamera || Error == Error_AllCamera){
|
|
|
char strMessage[MAX_PATH*2] = {0};
|
|
|
get_camera_exception_message(strMessage, MAX_PATH*2, conf->strVideoEnv ,"env camera start error,please check config file or device.");
|