int err = (exp); \
if (err != MEDIA_VISION_ERROR_NONE) { \
LOGE("[%s] %s failed\n", __func__, #exp); \
+ return err; \
} \
} while (0)
return ECORE_CALLBACK_PASS_ON;
}
-void vision_init(void)
+int vision_init(void)
{
int err = MEDIA_VISION_ERROR_NONE;
err = image_classification_init();
LOGE("Fail to detect with engine [err:%i]\n", err);
else
LOGD("Success vision_init");
+ return err;
}
-void vision_shutdown(void)
+int vision_shutdown(void)
{
+ int err = MEDIA_VISION_ERROR_NONE;
LOGD("shutdown");
if(_infer)
{
- RET_IF_FAIL(mv_inference_destroy(_infer));
+ err = mv_inference_destroy(_infer);
+ if (err != MEDIA_VISION_ERROR_NONE)
+ {
+ LOGE("Fail to destroy inference [err:%i]\n", err);
+ }
}
if(_engine_cfg)
{
- RET_IF_FAIL(mv_destroy_engine_config(_engine_cfg));
+ err = mv_destroy_engine_config(_engine_cfg);
+ if (err != MEDIA_VISION_ERROR_NONE)
+ {
+ LOGE("Fail to destroy inference [err:%i]\n", err);
+ }
}
ecore_event_handler_del(_event_handlers);
_event_handlers = NULL;
LOGD("end of shutdown");
+ return err;
}
#ifndef __VISION_H__
#define __VISION_H__
-void vision_init(void);
-void vision_shutdown(void);
+int vision_init(void);
+int vision_shutdown(void);
int image_classification_init(void);
int classification_from_image(const char *path_to_image);