create info handle when allocating private data.
Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
priv = (customfilter_priv_data_s *) pipe_info->priv_data;
- if (priv->in_info && ml_tensors_info_is_equal (in_info, priv->in_info)) {
+ if (ml_tensors_info_is_equal (in_info, priv->in_info)) {
/* do nothing, tensors info is equal. */
return TRUE;
}
return FALSE;
}
+ ml_tensors_info_free (priv->in_info);
+ ml_tensors_info_clone (priv->in_info, in_info);
+
if (priv->in_info_obj)
(*env)->DeleteGlobalRef (env, priv->in_info_obj);
-
- if (priv->in_info)
- ml_tensors_info_free (priv->in_info);
- else
- ml_tensors_info_create (&priv->in_info);
-
- ml_tensors_info_clone (priv->in_info, in_info);
priv->in_info_obj = (*env)->NewGlobalRef (env, obj_info);
(*env)->DeleteLocalRef (env, obj_info);
return TRUE;
"(L" NNS_CLS_TDATA ";)L" NNS_CLS_TDATA ";");
priv->mid_info = (*env)->GetMethodID (env, pipe_info->cls, "getOutputInfo",
"(L" NNS_CLS_TINFO ";)L" NNS_CLS_TINFO ";");
+ ml_tensors_info_create (&priv->in_info);
nns_set_priv_data (pipe_info, priv, nns_customfilter_priv_free);
if ((priv = item->priv_data) == NULL) {
priv = g_new0 (pipeline_sink_priv_data_s, 1);
+ ml_tensors_info_create (&priv->out_info);
item->priv_data = priv;
item->priv_destroy_func = nns_pipeline_sink_priv_free;
}
- if (priv->out_info && ml_tensors_info_is_equal (out_info, priv->out_info)) {
+ if (ml_tensors_info_is_equal (out_info, priv->out_info)) {
/* do nothing, tensors info is equal. */
return TRUE;
}
return FALSE;
}
+ ml_tensors_info_free (priv->out_info);
+ ml_tensors_info_clone (priv->out_info, out_info);
+
if (priv->out_info_obj)
(*env)->DeleteGlobalRef (env, priv->out_info_obj);
-
- if (priv->out_info)
- ml_tensors_info_free (priv->out_info);
- else
- ml_tensors_info_create (&priv->out_info);
-
- ml_tensors_info_clone (priv->out_info, out_info);
priv->out_info_obj = (*env)->NewGlobalRef (env, obj_info);
(*env)->DeleteLocalRef (env, obj_info);
return TRUE;
priv = (singleshot_priv_data_s *) pipe_info->priv_data;
- if (priv->out_info && ml_tensors_info_is_equal (out_info, priv->out_info)) {
+ if (ml_tensors_info_is_equal (out_info, priv->out_info)) {
/* do nothing, tensors info is equal. */
return TRUE;
}
return FALSE;
}
+ ml_tensors_info_free (priv->out_info);
+ ml_tensors_info_clone (priv->out_info, out_info);
+
if (priv->out_info_obj)
(*env)->DeleteGlobalRef (env, priv->out_info_obj);
-
- if (priv->out_info)
- ml_tensors_info_free (priv->out_info);
- else
- ml_tensors_info_create (&priv->out_info);
-
- ml_tensors_info_clone (priv->out_info, out_info);
priv->out_info_obj = (*env)->NewGlobalRef (env, obj_info);
(*env)->DeleteLocalRef (env, obj_info);
return TRUE;
ml_tensors_info_h out_info;
priv = g_new0 (singleshot_priv_data_s, 1);
+ ml_tensors_info_create (&priv->out_info);
nns_set_priv_data (pipe_info, priv, nns_singleshot_priv_free);
/* set output info */