mv_inference_h _infer = NULL;
static Ecore_Event_Handler *_event_handlers;
-typedef struct _video_info{
- mv_video_reader_h reader;
-} video_info;
-
void _send_vision_event_cb(void *data)
{
mmi_provider_event_vision *ev = (mmi_provider_event_vision *)data;
LOGE("ERROR: eos callback can't stop tracking process.");
return;
}
+ mv_video_reader_h reader = (mv_video_reader_h) user_data;
- video_info *video_infos = (video_info *)user_data;
- if(!video_infos)
+ if(reader)
{
- LOGE("video_info malloc fail\n");
- return;
- }
-
- if(video_infos->reader)
- {
- mv_destroy_video_reader(video_infos->reader);
- LOGD("destroy reader well");
+ LOGD("destroy reader");
+ int err = mv_destroy_video_reader(reader);
+ if (MEDIA_VISION_ERROR_NONE != err) {
+ LOGE("ERROR: Errors were occurred during video reader destroying; code %i\n", err);
+ }
}
LOGD("end of destroy");
LOGE("ERROR: eos callback can't stop tracking process.");
return;
}
- video_info *video_infos = calloc(1, sizeof(video_info));
- if(!video_infos)
- {
- LOGE("video_info malloc fail\n");
- return;
- }
-
- video_infos->reader = reader;
- ecore_main_loop_thread_safe_call_async(_vision_finish_cb, video_infos);
+ ecore_main_loop_thread_safe_call_async(_vision_finish_cb, reader);
}
int infer_task_with_frame(mv_source_h frame, int task_id, void *user_data)
else
{
LOGE("Fail to find infer handler\n");
+ err = -1;
}
return err;
}
return err;
}
-void classification_from_image(const char *path_to_image)
+int classification_from_image(const char *path_to_image)
{
int err = MEDIA_VISION_ERROR_NONE;
else
{
LOGE("Fail to find infer handler\n");
+ err = -1;
}
+ return err;
}
int image_classification_init(void)
}
LOGI("path to video = %s", path_to_video);
- classification_from_video(path_to_video);
+ int err = classification_from_video(path_to_video);
+ if (err != MEDIA_VISION_ERROR_NONE) {
+ LOGE("classification_from_video failed");
+ }
return ECORE_CALLBACK_PASS_ON;
}