From 5e400387d6a7964df5b0b0f1f41a0dddc74b10cc Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Mon, 20 Apr 2020 13:43:26 +0900 Subject: [PATCH] [CodeClean] return type 1. fix ret type of filter callback. 2. minor update (warning w/Wmissing-declarations) Signed-off-by: Jaeyun --- api/capi/src/tensor_filter_single.c | 11 ++++++++--- gst/nnstreamer/registerer/nnstreamer.c | 2 +- tests/tizen_capi/unittest_tizen_capi.cc | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/api/capi/src/tensor_filter_single.c b/api/capi/src/tensor_filter_single.c index 75e7b0e..78f9b70 100644 --- a/api/capi/src/tensor_filter_single.c +++ b/api/capi/src/tensor_filter_single.c @@ -247,7 +247,8 @@ g_tensor_filter_single_invoke (GTensorFilterSingle * self, const GstTensorMemory * input, GstTensorMemory * output) { GstTensorFilterPrivate *priv; - guint i, status; + guint i; + gint status; gboolean allocate_in_invoke; gboolean run_without_model; @@ -297,9 +298,13 @@ g_tensor_filter_single_invoke (GTensorFilterSingle * self, return TRUE; error: - if (allocate_in_invoke == FALSE) - for (i = 0; i < priv->prop.output_meta.num_tensors; i++) + /* if failed to invoke the model, release allocated memory. */ + if (allocate_in_invoke == FALSE) { + for (i = 0; i < priv->prop.output_meta.num_tensors; i++) { g_free (output[i].data); + output[i].data = NULL; + } + } return FALSE; } diff --git a/gst/nnstreamer/registerer/nnstreamer.c b/gst/nnstreamer/registerer/nnstreamer.c index 1dc1b76..2bbaa90 100644 --- a/gst/nnstreamer/registerer/nnstreamer.c +++ b/gst/nnstreamer/registerer/nnstreamer.c @@ -62,7 +62,7 @@ #endif /* __gnu_linux__ && !__ANDROID__ */ #include #include -#include "tensor_if/gsttensorif.h" +#include #define NNSTREAMER_INIT(plugin,name,type) \ do { \ diff --git a/tests/tizen_capi/unittest_tizen_capi.cc b/tests/tizen_capi/unittest_tizen_capi.cc index 494797e..515b4c1 100644 --- a/tests/tizen_capi/unittest_tizen_capi.cc +++ b/tests/tizen_capi/unittest_tizen_capi.cc @@ -499,7 +499,7 @@ file_cmp (const gchar * f1, const gchar * f2) * @brief Wait until the change in pipeline status is done * @return ML_ERROR_NONE success, ML_ERROR_UNKNOWN if failed, ML_ERROR_TIMED_OUT if timeout happens. */ -int +static int waitPipelineStateChange (ml_pipeline_h handle, ml_pipeline_state_e state, guint timeout_ms) { -- 2.7.4