[CodeClean] fix indent and unnecessary space
authorJaeyun Jung <jy1210.jung@samsung.com>
Tue, 16 May 2023 10:53:53 +0000 (19:53 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Wed, 17 May 2023 06:47:51 +0000 (15:47 +0900)
Code clean, fix indent and remove unnecessary space.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
16 files changed:
ext/nnstreamer/tensor_filter/tensor_filter_mxnet.cc
ext/nnstreamer/tensor_source/tensor_src_tizensensor.c
gst/nnstreamer/elements/gsttensor_trainer.c
gst/nnstreamer/elements/gsttensor_transform.c
gst/nnstreamer/include/nnstreamer_plugin_api.h
gst/nnstreamer/include/nnstreamer_plugin_api_util.h
gst/nnstreamer/nnstreamer_plugin_api_impl.c
gst/nnstreamer/nnstreamer_plugin_api_util_impl.c
gst/nnstreamer/tensor_filter/tensor_filter.c
tests/common/unittest_common.cc
tests/nnstreamer_datarepo/unittest_datareposrc.cc
tests/nnstreamer_filter_lua/unittest_filter_lua.cc
tests/nnstreamer_if/unittest_if.cc
tests/nnstreamer_sink/unittest_sink.cc
tests/nnstreamer_trainer/unittest_trainer.cc
tests/tizen_sensor/unittest_tizen_sensor.cc

index 8cc85af..0982eb4 100644 (file)
@@ -184,7 +184,6 @@ const GstTensorFilterFrameworkInfo TensorFilterMXNet::info_ = { .name = "mxnet",
 /**
  * @brief mxnet class constructor.
  */
-
 TensorFilterMXNet::TensorFilterMXNet ()
     : tensor_filter_subplugin (), empty_model_ (true), ctx_ (Context::cpu ()),
       enable_tensorrt_ (false)
index afec793..d5411bc 100644 (file)
@@ -173,8 +173,6 @@ static GstFlowReturn gst_tensor_src_tizensensor_create (GstBaseSrc * src,
 static GstFlowReturn gst_tensor_src_tizensensor_fill (GstBaseSrc * src,
     guint64 offset, guint size, GstBuffer * buf);
 
-/** internal functions */
-
 #define gst_tensor_src_tizensensor_parent_class parent_class
 G_DEFINE_TYPE (GstTensorSrcTIZENSENSOR, gst_tensor_src_tizensensor,
     GST_TYPE_BASE_SRC);
@@ -855,7 +853,6 @@ gst_tensor_src_tizensensor_finalize (GObject * object)
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-
 /**
  * @brief start function
  * @details This is called when state changed null to ready.
@@ -1275,7 +1272,6 @@ gst_tensor_src_tizensensor_fill (GstBaseSrc * src, guint64 offset,
     }
 
     /* 2. Do not timestamp. Let BaseSrc timestamp */
-
     nns_logd ("read sensor_data at %" GST_TIME_FORMAT,
         GST_TIME_ARGS (event->timestamp * 1000));
 
index fd776f8..8320fed 100644 (file)
@@ -65,12 +65,12 @@ G_DEFINE_TYPE (GstTensorTrainer, gst_tensor_trainer, GST_TYPE_ELEMENT);
 #define DEFAULT_PROP_EPOCHS 1
 
 /**
- * @brief Default string property value 
+ * @brief Default string property value
  */
 #define DEFAULT_STR_PROP_VALUE ""
 
 /**
- * @brief Default string property value 
+ * @brief Default string property value
  */
 enum
 {
index db9c6ed..2f17b2e 100644 (file)
@@ -347,7 +347,7 @@ float16_not_supported (void)
 /**
  * @brief Refrain from heavy operations on float16
  * @todo Remove this after applying SIMD or ORC
- * */
+ */
 static void
 refrain_from_heavy_op_on_float16 (gulong n)
 {
index 480be3d..f797106 100644 (file)
@@ -80,7 +80,8 @@ gst_tensors_caps_from_config (const GstTensorsConfig * config);
  * @brief set alignment that default allocator would align to
  * @param alignment bytes of alignment
  */
-extern void gst_tensor_alloc_init (gsize alignment);
+extern void
+gst_tensor_alloc_init (gsize alignment);
 
 /**
  * @brief Parse memory and fill the tensor meta.
@@ -123,7 +124,7 @@ gst_tensor_caps_can_intersect (GstCaps *caps1, GstCaps *caps2);
  * @param[in] info GstTensorsInfo to be used in parsing buffer.
  * @param[in] index Index of GstMemory to be returned.
  * @return GstMemory if found, otherwise NULL (Caller should free returned memory using gst_memory_unref()).
-*/
+ */
 extern GstMemory *
 gst_tensor_buffer_get_nth_memory (GstBuffer * buffer, const GstTensorsInfo * info, const guint index);
 
@@ -133,7 +134,7 @@ gst_tensor_buffer_get_nth_memory (GstBuffer * buffer, const GstTensorsInfo * inf
  * @param[in] memory GstMemory to append. This function will take ownership of this.
  * @param[in] info GstTensorInfo of given @a memory.
  * @return TRUE if successfully appended, otherwise FALSE.
-*/
+ */
 extern gboolean
 gst_tensor_buffer_append_memory (GstBuffer * buffer, GstMemory * memory, const GstTensorInfo * info);
 
index 0160797..aa3c91c 100644 (file)
@@ -456,14 +456,14 @@ nnstreamer_version_fetch (guint * major, guint * minor, guint * micro);
 /**
  * @brief Allocate and initialize the extra info in given tensors info.
  * @param[in,out] info GstTensorsInfo to be updated.
-*/
+ */
 extern gboolean
 gst_tensors_info_extra_create (GstTensorsInfo * info);
 
 /**
  * @brief Free allocated extra info in given tensors info.
  * @param[in,out] info GstTensorsInfo to be updated
-*/
+ */
 extern void
 gst_tensors_info_extra_free (GstTensorsInfo * info);
 
index fbbab5e..6be62f3 100644 (file)
@@ -1332,7 +1332,6 @@ gst_tensors_caps_from_config (const GstTensorsConfig * config)
   return caps;
 }
 
-
 /**
  * @brief Get tensor caps from tensors config
  * @param config tensors config info
@@ -1526,7 +1525,7 @@ gst_tensor_meta_info_append_header (GstTensorMetaInfo * meta, GstMemory * mem)
 /**
  * @brief Data structure to describe a "extra" tensor data.
  * This represents the information of the NNS_TENSOR_SIZE_LIMIT-th memory block for tensor stream.
-*/
+ */
 typedef struct
 {
   uint32_t magic;
@@ -1540,7 +1539,7 @@ typedef struct
  * @brief Check if given @a mem has extra tensors.
  * @param[in] mem GstMemory to be checked.
  * @return TRUE if @mem has extra tensors, otherwise FALSE.
-*/
+ */
 static gboolean
 gst_tensor_is_extra_memory (GstMemory * mem)
 {
@@ -1568,7 +1567,7 @@ gst_tensor_is_extra_memory (GstMemory * mem)
  * @brief Initialize GstTensorExtraInfo structure with given @a memory.
  * @param[in/out] extra GstTensorExtraInfo to be initialized.
  * @param[in] memory The information of given memory is used to initialize @a extra.
-*/
+ */
 static void
 gst_tensor_extra_info_init (GstTensorExtraInfo * extra, GstMemory * memory)
 {
@@ -1591,7 +1590,7 @@ gst_tensor_extra_info_init (GstTensorExtraInfo * extra, GstMemory * memory)
  * @param[in] info GstTensorsInfo to be used in parsing buffer.
  * @param[in] index Index of GstMemory to be returned.
  * @return GstMemory if found, otherwise NULL (Caller should free returned memory using gst_memory_unref()).
-*/
+ */
 GstMemory *
 gst_tensor_buffer_get_nth_memory (GstBuffer * buffer,
     const GstTensorsInfo * info, const guint index)
@@ -1700,7 +1699,7 @@ gst_tensor_buffer_get_nth_memory (GstBuffer * buffer,
  * @param[in] memory GstMemory to append. This function will take ownership of this.
  * @param[in] info GstTensorInfo of given @a memory.
  * @return TRUE if successfully appended, otherwise FALSE.
-*/
+ */
 gboolean
 gst_tensor_buffer_append_memory (GstBuffer * buffer, GstMemory * memory,
     const GstTensorInfo * info)
index a71ac3e..614fc70 100644 (file)
@@ -330,7 +330,7 @@ gst_tensors_info_get_nth_info (GstTensorsInfo * info, guint nth)
 /**
  * @brief Allocate and initialize the extra info in given tensors info.
  * @param[in,out] info tensors info to be updated.
-*/
+ */
 gboolean
 gst_tensors_info_extra_create (GstTensorsInfo * info)
 {
@@ -1593,7 +1593,6 @@ gst_tensor_meta_info_parse_header (GstTensorMetaInfo * meta, gpointer header)
       break;
   }
 
-
   /** @todo update meta info for each version */
   return gst_tensor_meta_info_validate (meta);
 }
index ecdce82..12a898e 100644 (file)
@@ -455,7 +455,6 @@ record_statistics (GstTensorFilterPrivate * priv)
   }
 }
 
-
 /**
  * @brief Track estimated latency and notify pipeline when it changes.
  *        Latency estimates may be a bit jittery. On the principle we want to
@@ -1217,7 +1216,6 @@ gst_tensor_filter_transform_caps (GstBaseTransform * trans,
      * However, according to gstreamer doxygen entry, if filter is given, that's not to be ignored.
      * For now, we assume that if caps-size is 0, filter is "ANY".
      */
-
     intersection =
         gst_caps_intersect_full (result, filter, GST_CAPS_INTERSECT_FIRST);
 
@@ -1257,7 +1255,6 @@ gst_tensor_filter_fixate_caps (GstBaseTransform * trans,
   /**
    * To get the out-caps, GstTensorFilter has to parse tensor info from NN model.
    */
-
   result = gst_tensor_filter_transform_caps (trans, direction, caps, othercaps);
   gst_caps_unref (othercaps);
   result = gst_caps_make_writable (result);
index 4cf0b93..9ce776f 100644 (file)
@@ -1877,7 +1877,6 @@ TEST (confCustom, checkExtraConfPath_p)
   gchar *filename = g_build_path ("/", dir, "nnstreamer.ini", NULL);
   const gchar *extra_conf = "/opt/usr/vd/product.ini";
   gchar *confenv = g_strdup (g_getenv ("NNSTREAMER_CONF"));
-  ;
 
   FILE *fp = g_fopen (filename, "w");
   ASSERT_TRUE (fp != NULL);
index 284ecb7..f25dbfd 100644 (file)
@@ -278,7 +278,6 @@ TEST (datareposrc, invalidJsonPath0_n)
   /* state chagne failure is expected */
   EXPECT_NE (setPipelineStateSync (pipeline, GST_STATE_PLAYING, UNITTEST_STATECHANGE_TIMEOUT), 0);
 
-
   gst_object_unref (pipeline);
 }
 
index 13f73d5..5c4b197 100644 (file)
@@ -169,7 +169,6 @@ TEST (tensorIfProp, properties0)
   g_free (pipeline);
 }
 
-
 /**
  * @brief Test for invalid properties of tensor_if
  */
@@ -392,7 +391,6 @@ TEST_F (tensor_if_run, action_1)
   g_free (content1);
   g_free (content2);
 
-
   /* False action result */
   EXPECT_TRUE (g_file_get_contents ("./gamut.golden", &content1, &len1, NULL));
   _wait_pipeline_save_files (tmp_false, content2, len2, len1, TEST_TIMEOUT_MS);
@@ -856,7 +854,6 @@ TEST (tensorIfCustom, normal1)
       "tif.src_0 ! queue ! tensor_sink name=sink_true async=false "
       "tif.src_1 ! queue ! tensor_sink name=sink_false async=false");
 
-
   GstElement *pipeline = gst_parse_launch (str_pipeline, NULL);
   EXPECT_NE (pipeline, nullptr);
 
@@ -911,7 +908,6 @@ TEST (tensorIfCustom, invalidParam3_n)
   EXPECT_NE (0, nnstreamer_if_custom_unregister ("tifx"));
 }
 
-
 /**
  * @brief Main GTest
  */
index 23ae0d4..94bb858 100644 (file)
@@ -15,6 +15,7 @@
 #include <string.h>
 
 #include <nnstreamer_conf.h>
+#include <tensor_filter_custom_easy.h>
 #include <unittest_util.h>
 #include "nnstreamer_plugin_api_filter.h"
 #include "tensor_common.h"
@@ -1803,7 +1804,6 @@ TEST (tensorStreamTest, merge16Tensors)
   _free_test_data (option);
 }
 
-
 /**
  * @brief Test for flexible tensors with tensor_mux (nego failure).
  */
@@ -6292,8 +6292,6 @@ TEST (tensorStreamTest, tensorsCap1)
   _free_test_data (option);
 }
 
-#include <tensor_filter_custom_easy.h>
-
 /**
  * @brief In-Code Test Function for custom-easy filter
  */
@@ -6661,7 +6659,6 @@ main (int argc, char **argv)
     }
   }
 
-
   try {
     ret = RUN_ALL_TESTS ();
   } catch (...) {
index 802cc41..4564df3 100644 (file)
@@ -38,7 +38,6 @@ get_file_path (const gchar *filename)
   return file_path;
 }
 
-
 /**
  * @brief Model training test using mnist.data (MNIST Test), model.bin is
  * created.
@@ -57,7 +56,6 @@ get_file_path (const gchar *filename)
  * of training samples and validation smaples. number of samples received for
  * model training is (num-training-samples + num-validation-samples) * epochs
  */
-
 TEST (tensor_trainer, SetParams)
 {
   gchar *file_path = NULL;
index 02e7a02..6fa434d 100644 (file)
@@ -367,7 +367,9 @@ TEST (tizensensorAsSource, virtualSensorCreate06_n)
   pipeline = g_strdup_printf ("tensor_src_tizensensor type=SENSOR_HRM_LED_GREEN ! tensor_sink");
   pipe = gst_parse_launch (pipeline, &err);
 
-  if (pipe) {
+  if (err) {
+    failed = TRUE;
+  } else if (pipe) {
     ret = gst_element_set_state (pipe, GST_STATE_PAUSED);
     failed = (ret == GST_STATE_CHANGE_FAILURE);
     gst_object_unref (pipe);