From: Jaeyun Date: Wed, 22 Jan 2020 06:47:38 +0000 (+0900) Subject: [ITC][Non-ACR][Machine Learning][remove unnecessary log and free resources] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d38e88eb8ef71a9157ae55955a41fdb41c5299a;p=test%2Ftct%2Fnative%2Fapi.git [ITC][Non-ACR][Machine Learning][remove unnecessary log and free resources] 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 (cherry picked from commit c953cea20fd6f2b3ec1e902ec276dc57cec5a8e7) --- diff --git a/src/itc/nnstreamer/ITs-nnstreamer-common.c b/src/itc/nnstreamer/ITs-nnstreamer-common.c index f4e69ba2d..bb64d3872 100755 --- a/src/itc/nnstreamer/ITs-nnstreamer-common.c +++ b/src/itc/nnstreamer/ITs-nnstreamer-common.c @@ -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; } diff --git a/src/itc/nnstreamer/ITs-nnstreamer-src.c b/src/itc/nnstreamer/ITs-nnstreamer-src.c index 095eeb063..bffe9710c 100755 --- a/src/itc/nnstreamer/ITs-nnstreamer-src.c +++ b/src/itc/nnstreamer/ITs-nnstreamer-src.c @@ -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); } diff --git a/src/itc/nnstreamer/ITs-nnstreamer-switch.c b/src/itc/nnstreamer/ITs-nnstreamer-switch.c index 704f72080..9a49a256a 100755 --- a/src/itc/nnstreamer/ITs-nnstreamer-switch.c +++ b/src/itc/nnstreamer/ITs-nnstreamer-switch.c @@ -15,19 +15,6 @@ // #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); diff --git a/src/itc/nnstreamer/ITs-nnstreamer.c b/src/itc/nnstreamer/ITs-nnstreamer.c index a3f0d5da5..b9147b726 100755 --- a/src/itc/nnstreamer/ITs-nnstreamer.c +++ b/src/itc/nnstreamer/ITs-nnstreamer.c @@ -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); }