{
LOGI("ENTER");
+ Mv3d *pMv3d = NULL;
if (!mv3d || !engine_config) {
LOGE("Handle is NULL");
return MEDIA_VISION_ERROR_INVALID_PARAMETER;
return ret;
}
- char *stereoConfigFilePath = NULL;
- ret = mv_engine_config_get_string_attribute(
- engine_config, MV_3D_DEPTH_STEREO_CONFIG_FILE_PATH, &stereoConfigFilePath);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Failed to get stereo configuration file path");
- if (stereoConfigFilePath) {
- free(stereoConfigFilePath);
- stereoConfigFilePath = NULL;
- }
- return ret;
- }
-
double samplingRatio;
ret = mv_engine_config_get_double_attribute(
engine_config, MV_3D_POINTCLOUD_SAMPLING_RATIO,&samplingRatio);
return ret;
}
+ char *stereoConfigFilePath = NULL;
+ ret = mv_engine_config_get_string_attribute(
+ engine_config, MV_3D_DEPTH_STEREO_CONFIG_FILE_PATH, &stereoConfigFilePath);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Failed to get stereo configuration file path");
+ return ret;
+ }
+
char *pointcloudOutputFilePath = NULL;
ret = mv_engine_config_get_string_attribute(
engine_config, MV_3D_POINTCLOUD_OUTPUT_FILE_PATH, &pointcloudOutputFilePath);
if (ret != MEDIA_VISION_ERROR_NONE) {
LOGE("Failed to get stereo configuration file path");
- if (pointcloudOutputFilePath) {
- free(pointcloudOutputFilePath);
- pointcloudOutputFilePath = NULL;
- }
- return ret;
+ goto out;
}
- auto pMv3d = static_cast<Mv3d *>(mv3d);
+ pMv3d = static_cast<Mv3d *>(mv3d);
ret = pMv3d->Configure(mode, depthWidth, depthHeight, minDisp, maxDisp,
samplingRatio, outlierRemovalPoints, outlierRemovalRadius,
stereoConfigFilePath, pointcloudOutputFilePath);
- if (stereoConfigFilePath) {
- free(stereoConfigFilePath);
- stereoConfigFilePath = NULL;
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Failed to configure Depth");
+ goto out;
}
+out:
if (pointcloudOutputFilePath) {
free(pointcloudOutputFilePath);
pointcloudOutputFilePath = NULL;
}
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Failed to configure Depth");
- return ret;
+ if (stereoConfigFilePath) {
+ free(stereoConfigFilePath);
+ stereoConfigFilePath = NULL;
}
LOGI("LEAVE");