*/
int ConfigureTargetDevices(const int targetDevices);
- /**
- * @brief Check supported target devices
- *
- * @since_tizen 6.5
- */
- bool IsTargetDeviceSupported(const int targetDevices);
-
/**
* @brief Configure the maximum number of inference results
*
private:
void CheckSupportedInferenceBackend();
+ bool IsTargetDeviceSupported(const int targetDevices);
int ConvertEngineErrorToVisionError(int error);
int ConvertTargetTypes(int given_types);
int ConvertToCv(int given_type);
return ret;
}
+ if (!IsTargetDeviceSupported(mConfig.mTargetTypes)) {
+ mBackend->UnbindBackend();
+ LOGE("Tried to configure invalid target types.");
+ return MEDIA_VISION_ERROR_NOT_SUPPORTED;
+ }
+
LOGI("LEAVE");
return MEDIA_VISION_ERROR_NONE;
goto out_of_function;
}
- ret = mv_engine_config_get_int_attribute(
- engine_config, MV_INFERENCE_TARGET_DEVICE_TYPE, &targetTypes);
+ ret = pInfer->ConfigureBackendType(
+ (mv_inference_backend_type_e) backendType);
if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get inference target type");
+ LOGE("Fail to configure a backend type.");
goto out_of_function;
}
- ret = pInfer->ConfigureBackendType(
- (mv_inference_backend_type_e) backendType);
+ ret = mv_engine_config_get_int_attribute(
+ engine_config, MV_INFERENCE_TARGET_DEVICE_TYPE, &targetTypes);
if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to configure a backend type.");
+ LOGE("Fail to get inference target type");
goto out_of_function;
}
goto out_of_function;
}
- if (!pInfer->IsTargetDeviceSupported(targetTypes)) {
- ret = MEDIA_VISION_ERROR_NOT_SUPPORTED;
- LOGE("Tried to configure invalid target types.");
- }
-
out_of_function:
LOGI("LEAVE");