|
|
|
@ -5,50 +5,9 @@ basicCamera::basicCamera(config_setting_t *Settings) : basicObject(), basicPosit |
|
|
|
m_eCaps = (objectCaps)(OC_EVENT_HANDLER); |
|
|
|
m_pSettings = Settings; |
|
|
|
m_iStatus = PS_BORN; |
|
|
|
m_sCameraInfo.m_pName = NULL; |
|
|
|
m_sCameraInfo.m_pSourcePath = NULL; |
|
|
|
m_sCameraInfo.m_bAutoExposure = false; |
|
|
|
m_sCameraInfo.m_bAutoFocus = false; |
|
|
|
m_sCameraInfo.m_bAutoIris = false; |
|
|
|
m_sCameraInfo.m_bAutoWB = false; |
|
|
|
m_sCameraInfo.m_bDigitalZoom = false; |
|
|
|
m_sCameraInfo.m_bExpoEna = false; |
|
|
|
m_sCameraInfo.m_bFocusEna = false; |
|
|
|
m_sCameraInfo.m_bIrisEna = false; |
|
|
|
m_sCameraInfo.m_bMirrored = false; |
|
|
|
m_sCameraInfo.m_bOpticEna = false; |
|
|
|
m_sCameraInfo.m_bOpticZoom = false; |
|
|
|
m_sCameraInfo.m_bShuterEna = false; |
|
|
|
m_sCameraInfo.m_bUpsideDown = false; |
|
|
|
m_sCameraInfo.m_bWBEna = false; |
|
|
|
m_sCameraInfo.m_bWDR = false; |
|
|
|
m_sCameraInfo.m_bWDREna = false; |
|
|
|
m_sCameraInfo.m_bZoomEna = false; |
|
|
|
m_sCameraInfo.m_bZoomSpeedDynamic = false; |
|
|
|
m_sCameraInfo.m_fDigitalZoomMax = -1.f; |
|
|
|
m_sCameraInfo.m_fFLCurrent = -1.f; |
|
|
|
m_sCameraInfo.m_fFLMax = -1.f; |
|
|
|
m_sCameraInfo.m_fFLMin = -1.f; |
|
|
|
m_sCameraInfo.m_fFOV = -1.f; |
|
|
|
m_sCameraInfo.m_fManualExposure = -1.f; |
|
|
|
m_sCameraInfo.m_fManualFocus = -1.f; |
|
|
|
m_sCameraInfo.m_fManualIris = -1.f; |
|
|
|
m_sCameraInfo.m_fManualShutter = -1.f; |
|
|
|
m_sCameraInfo.m_fSensorSize = ( 1.f / 2.8f ) * .0254f; // in meters
|
|
|
|
m_sCameraInfo.m_fZoomSpeedMax = -1.f; |
|
|
|
m_sCameraInfo.m_fZoomSpeedMin = -1.f; |
|
|
|
m_sCameraInfo.m_iHeight = -1; |
|
|
|
m_sCameraInfo.m_iWidth = -1; |
|
|
|
m_sCameraInfo.m_bScaledOutput = false; |
|
|
|
m_sCameraInfo.m_iOutputWidth = -1; |
|
|
|
m_sCameraInfo.m_iOutputHeight = -1; |
|
|
|
m_sCameraInfo.m_iSourcePort = -1; |
|
|
|
m_sCameraInfo.m_iSourceType = -1; |
|
|
|
m_sCameraInfo.m_iCameraType = -1; |
|
|
|
m_sCameraInfo.m_iZoomMax = -1; |
|
|
|
m_sCameraInfo.m_iZoomMin = -1; |
|
|
|
m_sCameraInfo.m_fMaxRange = -1; |
|
|
|
m_pVideoSource = NULL; |
|
|
|
memset(&m_sSourceInfo, 0 , sizeof(SOURCE_INFO)); |
|
|
|
//m_sSourceInfo.fSensorSize = ( 1.f / 2.8f ) * .0254f; // in meters
|
|
|
|
m_pVideoSource = NULL; |
|
|
|
m_pVideoNode = new videoNode(m_pSettings); |
|
|
|
}; |
|
|
|
|
|
|
|
@ -60,8 +19,6 @@ basicCamera::~basicCamera(){ |
|
|
|
m_pVideoNode->setStatus(TH_EXIT); |
|
|
|
delete(m_pVideoNode); |
|
|
|
}; |
|
|
|
if (m_sCameraInfo.m_pName != NULL)free(m_sCameraInfo.m_pName); |
|
|
|
if (m_sCameraInfo.m_pSourcePath != NULL)free(m_sCameraInfo.m_pSourcePath); |
|
|
|
}; |
|
|
|
|
|
|
|
bool basicCamera::create(void){ |
|
|
|
@ -69,164 +26,180 @@ bool basicCamera::create(void){ |
|
|
|
if (m_pSettings == NULL) return false; |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_CAMERA_TYPE); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sCameraInfo.m_iCameraType = config_setting_get_int(pSetting); |
|
|
|
m_sSourceInfo.type = config_setting_get_int(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_TYPE); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sCameraInfo.m_iSourceType = config_setting_get_int(pSetting); |
|
|
|
m_sSourceInfo.subtype = config_setting_get_int(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_IMAGE_WIDTH); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sCameraInfo.m_iWidth = config_setting_get_int(pSetting); |
|
|
|
m_sSourceInfo.width = config_setting_get_int(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_IMAGE_HEIGHT); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sCameraInfo.m_iHeight = config_setting_get_int(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sCameraInfo.m_iSourcePort = config_setting_get_int(pSetting); |
|
|
|
m_sSourceInfo.height = config_setting_get_int(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_CAMERA_NAME); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
if (m_sCameraInfo.m_pName == NULL) m_sCameraInfo.m_pName = (CSTR)malloc(255); |
|
|
|
sprintf(m_sCameraInfo.m_pName, "%s", config_setting_get_string(pSetting)); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
if (m_sCameraInfo.m_pSourcePath == NULL) m_sCameraInfo.m_pSourcePath = (CSTR)malloc(255); |
|
|
|
sprintf(m_sCameraInfo.m_pSourcePath, "%s", config_setting_get_string(pSetting)); |
|
|
|
sprintf( m_sSourceInfo.deviceName, "%s", config_setting_get_string(pSetting)); |
|
|
|
if( m_sSourceInfo.subtype != 1){ |
|
|
|
if( m_sSourceInfo.subtype == 0){ |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
m_sSourceInfo.capturePin = config_setting_get_int(pSetting); |
|
|
|
}; |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
sprintf( m_sSourceInfo.devicePath, "%s", config_setting_get_string(pSetting)); |
|
|
|
} else { |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_VIDEO_MRL); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
sprintf( m_sSourceInfo.onvifVideoMRL, "%s", config_setting_get_string(pSetting)); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_PICTURE_MRL); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
sprintf( m_sSourceInfo.onvifPictureMRL, "%s", config_setting_get_string(pSetting)); |
|
|
|
}; |
|
|
|
/*Location*/ |
|
|
|
float tLat, tLon, tAlt, tRoll, tPitch, tYaw; |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_LAT); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tLat = config_setting_get_float(pSetting); |
|
|
|
m_sSourceInfo.lat = config_setting_get_float(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_LON); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tLon = config_setting_get_float(pSetting); |
|
|
|
m_sSourceInfo.lon = config_setting_get_float(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_ALT); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tAlt = config_setting_get_float(pSetting); |
|
|
|
m_sSourceInfo.alt = config_setting_get_float(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_ROLL); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tRoll = config_setting_get_float(pSetting); |
|
|
|
m_sSourceInfo.h_lat = config_setting_get_float(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_PITCH); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tPitch = config_setting_get_float(pSetting); |
|
|
|
m_sSourceInfo.h_lon = config_setting_get_float(pSetting); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_YAW); |
|
|
|
if (pSetting == NULL) return false; |
|
|
|
tYaw = config_setting_get_float(pSetting); |
|
|
|
setPositionDeg(tLat, tLon, tAlt, tPitch, tRoll, tYaw); |
|
|
|
m_sSourceInfo.h_alt = config_setting_get_float(pSetting); |
|
|
|
setPositionDeg(m_sSourceInfo.lat, m_sSourceInfo.lon, m_sSourceInfo.alt, m_sSourceInfo.h_lat, m_sSourceInfo.h_lon, m_sSourceInfo.h_alt); |
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
bool basicCamera::create(mediaSourceInfo *SI){ |
|
|
|
config_setting_t *pSetting; |
|
|
|
|
|
|
|
bool basicCamera::create(SOURCE_INFO *SI){ |
|
|
|
config_setting_t *pSetting; |
|
|
|
if (m_pSettings == NULL) return false; |
|
|
|
if (SI == NULL) return false; |
|
|
|
|
|
|
|
memcpy( &m_sSourceInfo, SI, sizeof(SOURCE_INFO) ); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_CAMERA_TYPE); |
|
|
|
m_sCameraInfo.m_iCameraType = SI->type; |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_CAMERA_TYPE, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iCameraType); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.type); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_TYPE); |
|
|
|
m_sCameraInfo.m_iSourceType = SI->subtype; |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_SOURCE_TYPE, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iSourceType); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.subtype); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_CAMERA_NAME); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_CAMERA_NAME, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.deviceName); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_IMAGE_WIDTH); |
|
|
|
if (SI->frameIsWide){ |
|
|
|
m_sCameraInfo.m_iWidth = g_aFrameWidthStandard_16_9[SI->sizeId]; |
|
|
|
} else { |
|
|
|
m_sCameraInfo.m_iWidth = g_aFrameWidthStandard_4_3[SI->sizeId]; |
|
|
|
}; |
|
|
|
//if (SI->frameIsWide){
|
|
|
|
// m_sCameraInfo.m_iWidth = g_aFrameWidthStandard_16_9[SI->sizeId];
|
|
|
|
//} else {
|
|
|
|
// m_sCameraInfo.m_iWidth = g_aFrameWidthStandard_4_3[SI->sizeId];
|
|
|
|
//};
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_IMAGE_WIDTH, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iWidth); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.width); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_IMAGE_HEIGHT); |
|
|
|
if (SI->frameIsWide){ |
|
|
|
m_sCameraInfo.m_iHeight = g_aFrameHeightStandard_16_9[SI->sizeId]; |
|
|
|
} else { |
|
|
|
m_sCameraInfo.m_iHeight = g_aFrameHeightStandard_4_3[SI->sizeId]; |
|
|
|
}; |
|
|
|
//if (SI->frameIsWide){
|
|
|
|
// m_sCameraInfo.m_iHeight = g_aFrameHeightStandard_16_9[SI->sizeId];
|
|
|
|
//} else {
|
|
|
|
// m_sCameraInfo.m_iHeight = g_aFrameHeightStandard_4_3[SI->sizeId];
|
|
|
|
//};
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_IMAGE_HEIGHT, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iWidth); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.height); |
|
|
|
|
|
|
|
/*Location*/ |
|
|
|
float tLat, tLon, tAlt, tRoll, tPitch, tYaw; |
|
|
|
//float tLat, tLon, tAlt, tRoll, tPitch, tYaw;
|
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_LAT); |
|
|
|
tLat = systemAnchor::getInstance()->getLat(); |
|
|
|
//tLat = systemAnchor::getInstance()->getLat();
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_LAT, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tLat ); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.lat ); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_LON); |
|
|
|
tLon = systemAnchor::getInstance()->getLon(); |
|
|
|
//tLon = systemAnchor::getInstance()->getLon();
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_LON, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tLon); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.lon); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_ALT); |
|
|
|
tAlt = systemAnchor::getInstance()->getAlt(); |
|
|
|
//tAlt = systemAnchor::getInstance()->getAlt();
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_ALT, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tAlt); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.alt); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_PITCH); |
|
|
|
tPitch = 0.f; |
|
|
|
//tPitch = 0.f;
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_PITCH, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tPitch); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.h_lon); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_ROLL); |
|
|
|
tRoll = 0.f; |
|
|
|
//tRoll = 0.f;
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_ROLL, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tRoll); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.h_lat); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, TAG_POSITION_YAW); |
|
|
|
tYaw = 0.f; |
|
|
|
//tYaw = 0.f;
|
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, TAG_POSITION_YAW, CONFIG_TYPE_FLOAT); |
|
|
|
}; |
|
|
|
config_setting_set_float(pSetting, tYaw); |
|
|
|
config_setting_set_float(pSetting, m_sSourceInfo.h_alt); |
|
|
|
|
|
|
|
setPositionDeg(tLat, tLon, tAlt, tPitch, tRoll, tYaw); |
|
|
|
setPositionDeg(SI->lat, SI->lon, SI->alt, SI->h_lon, SI->h_lat, SI->h_alt); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
m_sCameraInfo.m_iSourcePort = SI->capturePin; |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_SOURCE_PORT, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iSourcePort); |
|
|
|
if( m_sSourceInfo.subtype != 1 ){ // File or Local Source
|
|
|
|
if( m_sSourceInfo.subtype == 0 ){ // Local Source
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_SOURCE_PORT, CONFIG_TYPE_INT); |
|
|
|
}; |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.capturePin); |
|
|
|
}; |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_SOURCE_PATH, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.devicePath); |
|
|
|
} else { |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_VIDEO_MRL); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_VIDEO_MRL, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.onvifVideoMRL); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_CAMERA_NAME); |
|
|
|
if (m_sCameraInfo.m_pName == NULL) m_sCameraInfo.m_pName = (CSTR)malloc(255); |
|
|
|
sprintf(m_sCameraInfo.m_pName, "%s", SI->deviceName); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_CAMERA_NAME, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sCameraInfo.m_pName); |
|
|
|
|
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
if (m_sCameraInfo.m_pSourcePath == NULL) m_sCameraInfo.m_pSourcePath = (CSTR)malloc(255); |
|
|
|
sprintf(m_sCameraInfo.m_pSourcePath, "%s", SI->devicePath); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_SOURCE_PATH, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sCameraInfo.m_pSourcePath); |
|
|
|
pSetting = config_setting_get_member(m_pSettings, BCI_TAG_PICTURE_MRL); |
|
|
|
if (pSetting == NULL){ |
|
|
|
pSetting = config_setting_add(m_pSettings, BCI_TAG_PICTURE_MRL, CONFIG_TYPE_STRING); |
|
|
|
}; |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.onvifPictureMRL); |
|
|
|
}; |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
return create(); |
|
|
|
return true; |
|
|
|
}; |
|
|
|
|
|
|
|
void basicCamera::updateSettings(void){ |
|
|
|
@ -284,54 +257,58 @@ void basicCamera::updateSettings(void){ |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_string(m_pSettings, BCI_TAG_CAMERA_NAME, (const char**)&tBuff)){ |
|
|
|
if (strcmp(m_sCameraInfo.m_pName, tBuff) != 0){ |
|
|
|
if (strcmp(m_sSourceInfo.deviceName, tBuff) != 0){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_CAMERA_NAME); |
|
|
|
config_setting_set_string(pSetting, m_sCameraInfo.m_pName); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_string(m_pSettings, BCI_TAG_SOURCE_PATH, (const char**)&tBuff)){ |
|
|
|
if (strcmp(m_sCameraInfo.m_pSourcePath, tBuff) != 0){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
config_setting_set_string(pSetting, m_sCameraInfo.m_pSourcePath); |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.deviceName); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_CAMERA_TYPE, &tInt)){ |
|
|
|
if (m_sCameraInfo.m_iCameraType != tInt){ |
|
|
|
if (m_sSourceInfo.type != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_CAMERA_TYPE); |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iCameraType); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.type); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_SOURCE_TYPE, &tInt)){ |
|
|
|
if (m_sCameraInfo.m_iSourceType != tInt){ |
|
|
|
if (m_sSourceInfo.subtype != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_SOURCE_TYPE); |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iSourceType); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.subtype); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_IMAGE_WIDTH, &tInt)){ |
|
|
|
if (m_sCameraInfo.m_iWidth != tInt){ |
|
|
|
if (m_sSourceInfo.width != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_IMAGE_WIDTH); |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iWidth); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.width); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_IMAGE_HEIGHT, &tInt)){ |
|
|
|
if (m_sCameraInfo.m_iHeight != tInt){ |
|
|
|
if (m_sSourceInfo.height != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_IMAGE_HEIGHT); |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iHeight); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_SOURCE_PORT, &tInt)){ |
|
|
|
if (m_sCameraInfo.m_iSourcePort != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
config_setting_set_int(pSetting, m_sCameraInfo.m_iSourcePort); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.height); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
if(m_sSourceInfo.subtype != 1){ |
|
|
|
if(m_sSourceInfo.subtype ==0){ |
|
|
|
if (config_setting_lookup_int(m_pSettings, BCI_TAG_SOURCE_PORT, &tInt)){ |
|
|
|
if (m_sSourceInfo.capturePin != tInt){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_SOURCE_PORT); |
|
|
|
config_setting_set_int(pSetting, m_sSourceInfo.capturePin); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (config_setting_lookup_string(m_pSettings, BCI_TAG_SOURCE_PATH, (const char**)&tBuff)){ |
|
|
|
if (strcmp(m_sSourceInfo.devicePath, tBuff) != 0){ |
|
|
|
pSetting = config_setting_lookup(m_pSettings, BCI_TAG_SOURCE_PATH); |
|
|
|
config_setting_set_string(pSetting, m_sSourceInfo.devicePath); |
|
|
|
basicSettingsProvider::getInstance()->compromise(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
if (basicSettingsProvider::getInstance()->isCompromised()) basicSettingsProvider::getInstance()->validate(); |
|
|
|
}; |
|
|
|
|
|
|
|
@ -372,4 +349,4 @@ void basicCamera::dispatchEvent( basicEvent *Evt ){ |
|
|
|
break; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |