[Transform/Orc] code clean to prepare meson
authorJaeyun <jy1210.jung@samsung.com>
Fri, 7 Dec 2018 03:50:57 +0000 (12:50 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Fri, 7 Dec 2018 05:31:23 +0000 (14:31 +0900)
1. Orc feature is defined in config, include config header to prepare meson build.
2. Set default property value with orc feature.
3. Add log message to indicate orc acceleration.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
gst/nnstreamer/tensor_common.h
gst/tensor_transform/tensor_transform.c
gst/tensor_transform/tensor_transform.h

index 9c5ab53..47ac875 100644 (file)
 #ifndef __GST_TENSOR_COMMON_H__
 #define __GST_TENSOR_COMMON_H__
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <glib.h>
 #include <stdint.h>
 #include "tensor_typedef.h"
index 6834d08..92a61a9 100644 (file)
@@ -103,6 +103,15 @@ enum
   PROP_ACCELERATION
 };
 
+/**
+ * @brief Flag to set orc acceleration.
+ */
+#ifdef HAVE_ORC
+#define DEFAULT_ACCELERATION TRUE
+#else
+#define DEFAULT_ACCELERATION FALSE
+#endif
+
 static const gchar *gst_tensor_transform_mode_string[] = {
   [GTT_DIMCHG] = "dimchg",
   [GTT_TYPECAST] = "typecast",
@@ -194,7 +203,7 @@ gst_tensor_transform_class_init (GstTensorTransformClass * klass)
           "Option for the tensor transform mode ?", "", G_PARAM_READWRITE));
   g_object_class_install_property (gobject_class, PROP_ACCELERATION,
       g_param_spec_boolean ("acceleration", "Acceleration", "Orc acceleration",
-          TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+          DEFAULT_ACCELERATION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   gst_element_class_set_details_simple (gstelement_class,
       "TensorTransform",
@@ -238,11 +247,9 @@ gst_tensor_transform_init (GstTensorTransform * filter)
   filter->option = NULL;
   filter->loaded = FALSE;
   filter->operators = NULL;
+  filter->acceleration = DEFAULT_ACCELERATION;
 #ifdef HAVE_ORC
-  filter->acceleration = TRUE;
   filter->orc_supported = FALSE;
-#else
-  filter->acceleration = FALSE;
 #endif
 
   gst_tensor_config_init (&filter->in_config);
@@ -1662,6 +1669,10 @@ gst_tensor_transform_set_caps (GstBaseTransform * trans,
       out_config.info.type != _NNS_UINT64) {
     filter->orc_supported = TRUE;
   }
+
+  if (orc_supported (filter)) {
+    GST_INFO_OBJECT (filter, "Orc acceleration enabled.");
+  }
 #endif
   return TRUE;
 error:
index 50105f1..2928921 100644 (file)
 #ifndef __GST_TENSOR_TRANSFORM_H__
 #define __GST_TENSOR_TRANSFORM_H__
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <gst/gst.h>
 #include <gst/base/gstbasetransform.h>
 #include <tensor_common.h>