[ITC][Non-ACR][Machine Learning][remove unnecessary log and free resources] 43/223043/1
authorJaeyun <jy1210.jung@samsung.com>
Wed, 22 Jan 2020 06:47:38 +0000 (15:47 +0900)
committerJaeyun Jung <jy1210.jung@samsung.com>
Wed, 22 Jan 2020 10:20:32 +0000 (10:20 +0000)
Remove unnecessary log in sink callback.
Also remove unused function and add mem-free in _cleanup function.

Change-Id: I1d1e9a3c2927f4d3a4f77bd6d68bbd80b6a67e1e
Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
(cherry picked from commit c953cea20fd6f2b3ec1e902ec276dc57cec5a8e7)

src/itc/nnstreamer/ITs-nnstreamer-common.c
src/itc/nnstreamer/ITs-nnstreamer-src.c
src/itc/nnstreamer/ITs-nnstreamer-switch.c
src/itc/nnstreamer/ITs-nnstreamer.c

index f4e69ba2d2eb35e7491386433151c83437b6b628..bb64d3872d7d34a997f89da9da1b39fc8ac2bda5 100755 (executable)
@@ -47,7 +47,6 @@ gboolean Timeout(gpointer data)
                g_main_loop_quit(pMainLoop);
        }
 
-       FPRINTF("[Line : %d][%s] Callback Timeout\\n", __LINE__, API_NAMESPACE);
        return false;
 }
 
index 095eeb06364b66d13a0528ac5d76ff2772dffd4c..bffe9710c0ff469009b7532196858771a988c5b7 100755 (executable)
@@ -50,10 +50,6 @@ void ITs_nnstreamer_pipeline_src_startup(void)
 
        pszNnpipeline = g_strdup ("appsrc name=srcx ! other/tensor,dimension=(string)4:1:1:1,type=(string)uint8,framerate=(fraction)0/1 ! tensor_sink");
 
-       g_unsinkCount = (guint *) g_malloc (sizeof (guint));
-       *g_unsinkCount = 0;
-
-       g_pipePipeLineState = (TestPipeState *) g_new0 (TestPipeState, 1);
        nRet = ml_pipeline_construct (pszNnpipeline, NULL, NULL, &g_hPipelinehandle);
        if(!g_bFeatureIsSupported)
        {
@@ -101,7 +97,6 @@ void ITs_nnstreamer_pipeline_src_cleanup(void)
                }
                g_hPipelinehandle = NULL;
        }
-       g_free (g_pipePipeLineState);
        g_free (pszNnpipeline);
 }
 
index 704f720809af9b7aaf8fbed028eb6d551d5f0861..9a49a256aee4df520b202c8fd43d91f54331150d 100755 (executable)
 //
 #include "ITs-nnstreamer-common.h"
 
-/**
- * @function           MlPipelineSinkCallback
- * @description A tensor-sink callback for sink handle in a pipeline
- */
-static void MlPipelineSinkCallback(const ml_tensors_data_h data, const ml_tensors_info_h info, void *user_data)
-{
-       FPRINTF("[Line : %d][%s] Inside callback MlPipelineSinkCallback \\n", __LINE__, API_NAMESPACE);
-       guint *count = (guint *) user_data;
-
-       *count = *count + 1;
-       g_bCallbackHit = true;
-}
-
 /**
  * @function           MlPipelineStateChangeCallback
  * @description Pipeline state changed callback
@@ -83,7 +70,7 @@ void ITs_nnstreamer_pipeline_switch_startup(void)
 
        pszNnpipeline = g_strdup ("input-selector name=ins ! tensor_converter ! tensor_sink name=sinkx "
                "videotestsrc is-live=true ! videoconvert ! ins.sink_0 "
-               "videotestsrc num-buffers=3 is-live=true ! videoconvert ! ins.sink_1");
+               "videotestsrc is-live=true ! videoconvert ! ins.sink_1");
 
        g_pipePipeLineState = (TestPipeState *) g_new0 (TestPipeState, 1);
        nRet = ml_pipeline_construct (pszNnpipeline, MlPipelineStateChangeCallback, g_pipePipeLineState, &g_hPipelinehandle);
index a3f0d5da536255c7865b0ee0cf1949a1f77d82b8..b9147b7267245c1285cece265fb13366fdb944f0 100755 (executable)
@@ -29,7 +29,6 @@
  */
 static void MlPipelineSinkCallback(const ml_tensors_data_h data, const ml_tensors_info_h info, void *user_data)
 {
-       FPRINTF("[Line : %d][%s] Inside callback MlPipelineSinkCallback \\n", __LINE__, API_NAMESPACE);
        guint *count = (guint *) user_data;
 
        *count = *count + 1;
@@ -82,7 +81,7 @@ void ITs_nnstreamer_pipeline_startup(void)
        g_bFeatureMLInterference = TCTCheckSystemInfoFeatureSupported(FEATURE_ML_INTERFACE, API_NAMESPACE);
        g_bFeatureIsSupported = g_bFeatureML  && g_bFeatureMLInterference;
 
-       pszNnpipeline = "videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valve1 ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx";
+       pszNnpipeline = g_strdup ("videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=30/1 ! tensor_converter ! valve name=valve1 ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx");
 
        g_unsinkCount = (guint *) g_malloc (sizeof (guint));
        *g_unsinkCount = 0;
@@ -136,6 +135,9 @@ void ITs_nnstreamer_pipeline_cleanup(void)
                }
                g_hPipelinehandle = NULL;
        }
+       g_free (g_unsinkCount);
+       g_free (g_pipePipeLineState);
+       g_free (pszNnpipeline);
 }